From: Wilfried Göesgens Date: Sun, 17 Dec 2006 22:32:07 +0000 (+0000) Subject: * modified debian scripts to use sysV X-Git-Tag: v7.86~3792 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d84703f4b7c01cd5a2c23d1972481a80d2689af9 * modified debian scripts to use sysV --- diff --git a/webcit/buildpackages b/webcit/buildpackages index a2a7a60d7..3f10f911a 100755 --- a/webcit/buildpackages +++ b/webcit/buildpackages @@ -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 $DATE + -- Wilfried Goesgens $DATE " >/tmp/webcit_changelog cat debian/changelog >>/tmp/webcit_changelog mv /tmp/webcit_changelog debian/changelog diff --git a/webcit/debian/changelog b/webcit/debian/changelog index 81ab04942..f17006f19 100644 --- a/webcit/debian/changelog +++ b/webcit/debian/changelog @@ -1,18 +1,24 @@ +webcit (7.00-2) unstable; urgency=low + + * update to actual Webcit SVN. many new features. see Packages changelog. + + -- Wilfried Goesgens 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 Sat, 21 Jan 2006 19:07:00 +0100 + -- Wilfried Goesgens 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 Tue, 01 Nov 2005 18:06:00 +0100 + -- Wilfried Goesgens 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 Mon, 25 Jul 2005 12:46:10 +0200 + -- Wilfried Goesgens Mon, 25 Jul 2005 12:46:10 +0200 diff --git a/webcit/debian/citadel-webcit.postinst b/webcit/debian/citadel-webcit.postinst index b38eea2cb..3ab67b1aa 100644 --- a/webcit/debian/citadel-webcit.postinst +++ b/webcit/debian/citadel-webcit.postinst @@ -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 diff --git a/webcit/debian/citadel-webcit.postrm.debhelper b/webcit/debian/citadel-webcit.postrm.debhelper index bc035b98c..850be5dc1 100644 --- a/webcit/debian/citadel-webcit.postrm.debhelper +++ b/webcit/debian/citadel-webcit.postrm.debhelper @@ -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 diff --git a/webcit/debian/citadel-webcit.substvars b/webcit/debian/citadel-webcit.substvars index 5d46b7e8c..0d543a002 100644 --- a/webcit/debian/citadel-webcit.substvars +++ b/webcit/debian/citadel-webcit.substvars @@ -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) diff --git a/webcit/debian/citadel-webcit.templates b/webcit/debian/citadel-webcit.templates index 1208a9441..8e35ea99f 100644 --- a/webcit/debian/citadel-webcit.templates +++ b/webcit/debian/citadel-webcit.templates @@ -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 diff --git a/webcit/debian/rules b/webcit/debian/rules index d3d67d683..d07ffaee4 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -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 index 000000000..25a54b42b --- /dev/null +++ b/webcit/debian/webcit.init @@ -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 +# +# 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 + +: