gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14385 - gauger


From: gnunet
Subject: [GNUnet-SVN] r14385 - gauger
Date: Thu, 10 Feb 2011 19:25:34 +0100

Author: bartpolot
Date: 2011-02-10 19:25:34 +0100 (Thu, 10 Feb 2011)
New Revision: 14385

Added:
   gauger/install.sh
Modified:
   gauger/README
   gauger/gauger-cli.py
   gauger/gauger.py
Log:
Added basic install & check script, changed default python version expected, 
updated doc


Modified: gauger/README
===================================================================
--- gauger/README       2011-02-10 12:59:38 UTC (rev 14384)
+++ gauger/README       2011-02-10 18:25:34 UTC (rev 14385)
@@ -4,15 +4,21 @@
 =====
 
 This software is written in python v2. If your distribution packages
-python v2 as the default, change the first line of each script:
+python v3 as the default (as for instance Arch Linux), running
+install.sh automatically changes the first line of each script:
 
-From: #!/usr/bin/env python2
-To:   #!/usr/bin/env python
+From: #!/usr/bin/env python
+To:   #!/usr/bin/env python2
 
+If your distribution packages python2 with a different binary name,
+then change it accordingly by hand and/or contact the author of the
+program. Contact information is in AUTHORS file.
 
 Installation
 ============
 
+* Run install.sh
+
 * Client
   Put gauger.py into your $PATH
 
@@ -77,3 +83,6 @@
 
  * subversion >= 1.6
     web site: http://subversion.tigris.org/
+
+ * PHP >= 5.2
+    web site: http://php.net/

Modified: gauger/gauger-cli.py
===================================================================
--- gauger/gauger-cli.py        2011-02-10 12:59:38 UTC (rev 14384)
+++ gauger/gauger-cli.py        2011-02-10 18:25:34 UTC (rev 14385)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#/usr/bin/env python
 """gauger-cli.py
 
      This file is part of gauger.

Modified: gauger/gauger.py
===================================================================
--- gauger/gauger.py    2011-02-10 12:59:38 UTC (rev 14384)
+++ gauger/gauger.py    2011-02-10 18:25:34 UTC (rev 14385)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#/usr/bin/env python
 """gauger.py
 
      This file is part of gauger.

Added: gauger/install.sh
===================================================================
--- gauger/install.sh                           (rev 0)
+++ gauger/install.sh   2011-02-10 18:25:34 UTC (rev 14385)
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# ################ PYTHON ################ #
+
+V=$(/usr/bin/env python --version 2>&1)
+if [ "$?" != "0" ]; then
+    "Please make sure python is installed."
+    exit 1
+fi
+V=${V#* }
+MSD=${V%%.*}
+case $MSD in
+    2)
+       echo "Default python version: 2"
+       echo "Nothing to change..."
+       ;;
+    3)
+       echo "Default python version: 3"
+       echo "Trying version 2..."
+       V=$(/usr/bin/env python2 --version 2>&1)
+       if [ "$?" != "0" ]; then
+           echo "Please make sure python v2 is installed"
+           echo "Consult README for more information"
+           echo "and adapt scripts accordingly."
+           exit 1
+       fi
+       V=${V##* }
+       MSD=${V%%.*}
+       if [ "$MSD" != "2" ]; then
+           echo "Executlabe python2 is NOT python 2!!"
+           echo "Consult README for more information"
+           echo "and adapt scripts accordingly."
+           exit 1
+       fi
+       for i in *.py; do
+           echo "Adapting $i..."
+           sed -e "s/#!\/usr\/bin\/env python$/#\/usr\/bin\/env python2/" $i > 
$i.tmp
+           mv $i.tmp $i
+       done
+       echo "Done!!"
+       ;;
+    *)
+       echo "Unknown version of python $MSD."
+       echo "*** PROGRAM MIGHT NOT WORK ***"
+       echo "Consult README file."
+esac
+
+# ################ GNUPLOT ################ #
+
+V=$(gnuplot --version 2>&1)
+if [ "$?" != "0" ]; then
+    "Please make sure gnuplot is installed."
+    exit 1
+fi
+V=${V#* }
+MSD=${V%%.*}
+case $MSD in
+    4)
+       echo "Version of gnuplot is OK."
+       ;;
+    *)
+        echo "Untested version of gnuplot $MSD."
+        echo "Plotting might not work."
+esac
+
+# ################ PHP ################ #
+
+V=$(php --version 2>&1 | head -n 1)
+if [ "$?" != "0" ]; then
+    "Please make sure PHP is installed."
+    exit 1
+fi
+V=${V#* }
+MSD=${V%%.*}
+case $MSD in
+    5)
+       echo "Version of PHP is OK."
+       ;;
+    *)
+        echo "Untested version of PHP $MSD."
+        echo "Dynamic page generation might not work."
+esac




reply via email to

[Prev in Thread] Current Thread [Next in Thread]