diff --git a/control b/control index 5578ece..a029c08 100644 --- a/control +++ b/control @@ -10,7 +10,7 @@ Package: mandaye-cam Architecture: all Depends: ${misc:Depends}, ${python:Depends}, memcached, python-memcache, python-raven, python-crypto, python-lasso, - python-mandaye (>= 0.8) + python-mandaye (>= 0.10) Recommends: python-raven, nginx Description: CAM is a Mandaye project, modular reverse proxy to authentic diff --git a/dirs b/dirs index d04d9e9..359e514 100644 --- a/dirs +++ b/dirs @@ -6,4 +6,5 @@ var/lib/mandaye-cam/data var/lib/mandaye-cam/sessions var/run/mandaye-cam var/log/mandaye-cam +usr/lib/mandaye-cam usr/share/mandaye-cam diff --git a/init.d b/init.d index d7e632e..72a0e33 100755 --- a/init.d +++ b/init.d @@ -18,6 +18,7 @@ PID_DIR=/var/run/mandaye-cam PIDFILE=/var/run/mandaye-cam/$NAME.pid LOG_DIR=/var/log/mandaye-cam SCRIPTNAME=/etc/init.d/$NAME +MANDAYE_CONFIG_FILES=/etc/$NAME/config.ini USER=mandaye-cam GROUP=mandaye-cam @@ -49,6 +50,9 @@ cam.wsgi:application" # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions +# environment for wsgi & settings +export MANDAYE_CONFIG_FILES + # # Function that starts the daemon/service # diff --git a/install b/install index 5e140f6..10d04b7 100644 --- a/install +++ b/install @@ -1 +1,2 @@ debian/config.ini /etc/mandaye-cam/ +debian/mandaye_cam_manager /usr/bin/ diff --git a/mandaye_cam_manager b/mandaye_cam_manager new file mode 100755 index 0000000..f2fdd72 --- /dev/null +++ b/mandaye_cam_manager @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME=mandaye-cam +MANAGER="/usr/lib/$NAME/manager.py --config=/etc/$NAME/config.ini" + +# check user +if test x$1 = x"--forceuser" +then + shift +elif test $(id -un) != "$NAME" +then + echo "error: must use $0 with user ${NAME}" + exit 1 +fi + +if test $# -eq 0 +then + python ${MANAGER} --help + exit 1 +fi + +python ${MANAGER} "$@" diff --git a/postinst b/postinst index bdcc519..5510398 100644 --- a/postinst +++ b/postinst @@ -33,7 +33,7 @@ case "$1" in if [ -z "$2" ]; then echo -n "Creating database.." - su $USER -p -c "/usr/bin/cam_mandaye_manager --createdb" + su $USER -p -c "/usr/bin/mandaye_cud_manager --createdb" echo "..done" fi ;; diff --git a/rules b/rules index a63ae2b..ea3bbd4 100755 --- a/rules +++ b/rules @@ -6,5 +6,7 @@ BUILD_DIR := 'debian/mandaye-cam' dh $@ --with python2 override_dh_install: - dh_install - cp -R cam/static $(BUILD_DIR)/usr/share/mandaye-cam + dh_install + mv $(BUILD_DIR)/usr/bin/server.py $(BUILD_DIR)/usr/lib/mandaye-cam/server.py + mv $(BUILD_DIR)/usr/bin/manager.py $(BUILD_DIR)/usr/lib/mandaye-cam/manager.py + cp -R cam/static $(BUILD_DIR)/usr/share/mandaye-cam