* modified debian scripts to use sysV
authorWilfried Göesgens <willi@citadel.org>
Sun, 17 Dec 2006 22:32:07 +0000 (22:32 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 17 Dec 2006 22:32:07 +0000 (22:32 +0000)
webcit/buildpackages
webcit/debian/changelog
webcit/debian/citadel-webcit.postinst
webcit/debian/citadel-webcit.postrm.debhelper
webcit/debian/citadel-webcit.substvars
webcit/debian/citadel-webcit.templates
webcit/debian/rules
webcit/debian/webcit.init [new file with mode: 0644]

index a2a7a60d7bf9221928fd68a74c18089d9bb5d36c..3f10f911a231ee76b335cb93649f78125b9e901f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
+export WEBCIT_`grep VERSION= configure.in |sed -e "s;';;g"`
 
-WEBCIT_VERSION=`grep "THIS IS" ChangeLog  |head -n 1|sed "s;.* ;;"`
 PACKAGE_VERSION=`cat packageversion`
 DATE=`date '+%a, %d %b %Y %H:%I:00 %z'`
 ACTUAL_DIR=`pwd`
@@ -35,14 +35,14 @@ case $1 in
                        -e "s;@WEBCIT_VERSION@;${WEBCIT_VERSION};" \
                        -e "s;@PACKAGE_VERSION@;${PACKAGE_VERSION};" \
                        > debian/files
-               if grep -q "$WEBCIT_VERSION" debian/changelog; then
+               if grep -q "($WEBCIT_VERSION" debian/changelog; then
                        echo rebuilding package.
                else
                        echo "webcit (${WEBCIT_VERSION}-${PACKAGE_VERSION}) unstable; urgency=low
        
   * update to actual Webcit SVN. many new features. see Packages changelog.
 
- -- Wilfried Goesgens <w.goesgens@chaosindustries.de>  $DATE
+ -- Wilfried Goesgens <citadel@outgesourced.org>  $DATE
        " >/tmp/webcit_changelog
                        cat debian/changelog >>/tmp/webcit_changelog
                        mv /tmp/webcit_changelog debian/changelog
index 81ab0494258c6cc3e4d796d59a9146229e4298ba..f17006f19b0353e8e178f774fd4b2d0702f16d57 100644 (file)
@@ -1,18 +1,24 @@
+webcit (7.00-2) unstable; urgency=low
+       
+  * update to actual Webcit SVN. many new features. see Packages changelog.
+
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Sun, 17 Dec 2006 17:05:00 +0100
+       
 webcit (6.71-2) unstable; urgency=low
        
   * update to actual Webcit SVN. many new features. see Packages changelog.
 
- -- Wilfried Goesgens <w.goesgens@chaosindustries.de>  Sat, 21 Jan 2006 19:07:00 +0100
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Sat, 21 Jan 2006 19:07:00 +0100
        
 webcit (6.31-2) unstable; urgency=low
        
   * update to actual Citadel SVN. many new features. see Packages changelog.
 
- -- Wilfried Goesgens <w.goesgens@chaosindustries.de>  Tue, 01 Nov 2005 18:06:00 +0100
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Tue, 01 Nov 2005 18:06:00 +0100
        
 webcit (6.21-1) unstable; urgency=low
 
   * Initial release Closes: #nnnn  (nnnn is the bug number of your ITP)
 
- -- Wilfried Goesgens <willi@jordy.home.net>  Mon, 25 Jul 2005 12:46:10 +0200
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Mon, 25 Jul 2005 12:46:10 +0200
 
index b38eea2cb3dc94ec4c4ed36f90da9b929e8934d4..3ab67b1aa388d31e761d809e48de6791220b3af5 100644 (file)
@@ -118,28 +118,15 @@ case "$1" in
        db_get citadel/WebcitHttpsPort && https_port="$RET"     
        set >/tmp/testfoo
        echo "aplying your settings"
-       if grep -q "webserver" /etc/inittab; then
-               echo "/usr/sbin
-Yes
-$http_port
-$https_port
-No
-127.0.0.1
-504
-"|/usr/lib/citadel-webcit/setup -q
-               echo "/usr/sbin
-Yes
-$http_port
-$https_port
-No
-127.0.0.1
-504
-/usr/lib/citadel-webcit/setup -q" >>/tmp/foo
-       else 
-               echo "/usr/sbin
-" |/usr/lib/citadel-webcit/setup -q
-
-       fi
+       echo "
+export WEBCIT_HTTP_PORT=$http_port
+export WEBCIT_HTTPS_PORT=$https_port
+export WEBCIT_CITADEL_IP=127.0.0.1
+export WEBCIT_CITADEL_PORT=504
+export WEBCIT_LISTEN_IP=0.0.0.0
+" >>/etc/default/webcit
+
+       update-rc.d webcit defaults >/dev/null
 
     #### There are three sub-cases:
     ###if test "${2+set}" != set; then
index bc035b98cdb5d458ae83547feb4c99b9fb7ac772..850be5dc13f15e4d4a5e1d3d56eb2d8f1cdcabac 100644 (file)
@@ -4,3 +4,8 @@ if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
        db_purge
 fi
 # End automatically added section
+# Automatically added by dh_installinit
+if [ "$1" = "purge" ] ; then
+       update-rc.d webcit remove >/dev/null || exit $?
+fi
+# End automatically added section
index 5d46b7e8c7b02088b255b721d703bf2cc52ca411..0d543a002d05c362fcfdd67f1c06bbc1aa093087 100644 (file)
@@ -1,2 +1,2 @@
 misc:Depends=debconf (>= 0.5) | debconf-2.0
-shlibs:Depends=libc6 (>= 2.3.6-6), libssl0.9.8 (>= 0.9.8b-1), zlib1g (>= 1:1.2.1)
+shlibs:Depends=libc6 (>= 2.3.6-6), libssl0.9.8 (>= 0.9.8c-1), zlib1g (>= 1:1.2.1)
index 1208a9441b001f56a08d324134bf8fc75377c22e..8e35ea99fd9da739dcabecb5140e53ac534e01cf 100644 (file)
@@ -1,15 +1,15 @@
 Template: citadel/WebcitHttpPort
 Type: string
-Default: 2000
+Default: 2020
 Description: Webcit HTTP Port
-  Select the Port, which the plain HTTP webcit server should listen on.
+  Select the Port, which the plain HTTP webcit server should listen on. -1 to disable.
 
 
 Template: citadel/WebcitHttpsPort
 Type: string
 Default: 443
 Description: WebCit HTTPS port
-  Select the Port, which the SSL HTTP webcit server should listen on.
+  Select the Port, which the SSL HTTP webcit server should listen on. -1 to disable.
 
 
 Template: citadel/WebcitInstallnote
index d3d67d683ce0bef48f8ff3c7ad5df7356f89787b..d07ffaee477e9ba1301d7e4b68a81e9943f0201f 100755 (executable)
@@ -31,7 +31,9 @@ configure-stamp:
                --with-spooldir=/var/spool/citadel \
                --with-datadir=/var/lib/citadel \
                --with-rundir=/var/run/citadel \
-               --with-ical --with-db --with-ldap --with-zlib --with-ssl --with-libiconf --with-newt --with-included-gettext
+               --with-ical --with-db --with-ldap \
+               --with-zlib --with-ssl --with-libiconf \
+               --with-newt --with-included-gettext
 
        touch configure-stamp
 
@@ -41,9 +43,9 @@ build: build-stamp
 build-stamp: configure-stamp 
        dh_testdir
 
-       # Add here commands to compile the package.
+# Add here commands to compile the package.
        $(MAKE)
-       #docbook-to-man debian/webcit.sgml > webcit.1
+#docbook-to-man debian/webcit.sgml > webcit.1
 
        touch build-stamp
 
@@ -52,7 +54,7 @@ clean:
        dh_testroot
        rm -f build-stamp configure-stamp
 
-       # Add here commands to clean up after the build process.
+# Add here commands to clean up after the build process.
        -$(MAKE) clean
 
        dh_clean 
@@ -82,6 +84,8 @@ install: build
                                md5sum `find -type f |grep -v md5sums `>md5sums; 
        mv $(CURDIR)/debian/webcit/var/lib/citadel/www/setup \
                $(CURDIR)/debian/citadel-webcit/usr/lib/citadel-webcit/
+       mv $(CURDIR)/debian/webcit/var/lib/citadel/www/ctdlsvc \
+               $(CURDIR)/debian/citadel-webcit/usr/lib/citadel-webcit/
        mv $(CURDIR)/debian/webcit/var/lib/citadel/www/webserver \
                $(CURDIR)/debian/citadel-webcit/usr/sbin/
 
@@ -94,7 +98,7 @@ binary-indep: build install
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs ChangeLog
+#      dh_installchangelogs ChangeLog
        dh_installdocs
        dh_installexamples
 #      dh_install
@@ -104,7 +108,7 @@ binary-arch: build install
 #      dh_installemacsen
 #      dh_installpam
 #      dh_installmime
-#      dh_installinit
+       dh_installinit --name=webcit
 #      dh_installcron
 #      dh_installinfo
        dh_installman
diff --git a/webcit/debian/webcit.init b/webcit/debian/webcit.init
new file mode 100644 (file)
index 0000000..25a54b4
--- /dev/null
@@ -0,0 +1,196 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          skeleton
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Example initscript
+# Description:       This file should be used to construct scripts to be
+#                    placed in /etc/init.d.
+### END INIT INFO
+
+# Author: Foo Bar <foobar@baz.org>
+#
+# Please remove the "Author" lines above and replace them
+# with your own name if you copy and modify this script.
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+RUNDIR=/var/run/webcit
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Citadel Groupware Webserver "
+NAME=webserver
+DAEMON=/usr/sbin/$NAME
+CTDLSVC=/usr/lib/citadel-webcit/ctdlsvc
+DAEMON_ARGS=""
+PIDFILE=$RUNDIR/$NAME.pid
+SCRIPTNAME=/etc/init.d/webcit
+SENDCOMMAND=/usr/sbin/sendcommand
+DEFAULT=/etc/default/webcit
+LOGDIR=/var/log/webcit/
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+if test -f $DEFAULT; then
+  . $DEFAULT
+fi
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    #1: -p flag
+    #1: port
+    #2: ssl
+
+        # for ubuntu: check our volatile dirs.
+        if test ! -d $RUNDIR; then
+           mkdir -p $RUNDIR
+       fi
+
+        if test ! -d $LOGDIR; then
+           mkdir -p $LOGDIR
+       fi
+
+
+
+       # are we disabled?
+       if test "$1" -lt "0"; then
+           return 0
+       fi
+
+       # Return
+       #   0 if daemon has been started
+       #   1 if daemon was already running
+       #   2 if daemon could not be started
+       if $CTDLSVC $PIDFILE.$1 $DAEMON \
+               -p$@ -t$LOGDIR/access.${1}.log ; then
+           return 0
+       else
+           return 2
+       fi
+       # Add code here, if necessary, that waits for the process to be ready
+       # to handle requests from services started subsequently which depend
+       # on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+       # Return
+       #   0 if daemon has been stopped
+       #   1 if daemon was already stopped
+       #   2 if daemon could not be stopped
+       #   other if a failure occurred
+
+        kill `cat  $PIDFILE.*`
+       rm -f $PIDFILE.*
+
+       #while test -d /proc/`cat $PIDFILE`; do
+       #    /usr/bin/printf  '.'
+       #    /bin/sleep 1
+       #done
+       #start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+       #RETVAL="$?"
+       #[ "$RETVAL" = 2 ] && return 2
+       # Wait for children to finish too if this is a daemon that forks
+       # and if the daemon is only ever run from this initscript.
+       # If the above conditions are not satisfied then add some other code
+       # that waits for the process to drop all resources that could be
+       # needed by services started subsequently.  A last resort is to
+       # sleep for some time.
+       #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+       #[ "$?" = 2 ] && return 2
+       # Many daemons don't delete their pidfiles when they exit.
+       # rm -f $PIDFILE
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+       #
+       # If the daemon can reload its configuration without
+       # restarting (for example, when it is sent a SIGHUP),
+       # then implement that here.
+       #
+#      start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+        do_stop
+        do_start
+       return 0
+}
+
+case "$1" in
+  start)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       do_start $WEBCIT_HTTP_PORT $WEBCIT_CITADEL_IP $WEBCIT_CITADEL_PORT
+       do_start $WEBCIT_HTTPS_PORT $WEBCIT_CITADEL_IP $WEBCIT_CITADEL_PORT -s
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  stop)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  #reload|force-reload)
+       #
+       # If do_reload() is not implemented then leave this commented out
+       # and leave 'force-reload' as an alias for 'restart'.
+       #
+       #log_daemon_msg "Reloading $DESC" "$NAME"
+       #do_reload
+       #log_end_msg $?
+       #;;
+  restart|force-reload)
+       #
+       # If the "reload" option is implemented then remove the
+       # 'force-reload' alias
+       #
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0|1)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       1) log_end_msg 1 ;; # Old process is still running
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+: