mitsuhiko  committed b4234d7

Selected scripts are now distributed in the "scripts" folder in $PREFIX/share/zine.

  • Participants
  • Parent commits 60e20db

Comments (0)

Files changed (2)

File scripts/

 from os.path import abspath, join, dirname, pardir, isfile
 import sys
+# set to None first because the installation replaces this
+# with the path to the installed zine library.
+ZINE_LIB = None
+if ZINE_LIB is None:
+    ZINE_LIB = abspath(join(dirname(__file__), pardir))
 # make sure we load the correct zine
-sys.path.insert(0, abspath(join(dirname(__file__), pardir)))
+sys.path.insert(0, ZINE_LIB)
 def find_instance():

File scripts/install-posix

 SRC="`dirname $0`/../zine"
 PACKAGES="_dynamic _ext importers utils views websetup i18n docs"
+SCRIPTS="create-apache-config server shell"
 if [ x$PREFIX == x ]; then
 sed -i '' -E -e "s|^ZINE_LIB =.*$|ZINE_LIB = '$PREFIX/lib/zine'|g" \
     -e "s|^#!/usr/bin/python|#!$PYTHON|g" $PREFIX/share/zine/servers/*
+# copy some of the scripts
+mkdir -p $PREFIX/share/zine/scripts
+for script in $SCRIPTS; do
+  cp $SRC/../scripts/$script $PREFIX/share/zine/scripts
+  chmod +x $PREFIX/share/zine/scripts
+cp $SRC/../scripts/ $PREFIX/share/zine/scripts
+sed -i '' -E -e "s|^ZINE_LIB = None$|ZINE_LIB = '$PREFIX/lib/zine'|g" \
+   $PREFIX/share/zine/scripts/
+sed -i '' -E -e "s|^#!/usr/bin/(env )?python|#!$PYTHON|g" \
+   $PREFIX/share/zine/scripts/*
 echo "All done."