From 2532a889e1cb3b6e652beb692c7d57fbe64284bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 10 Jan 2007 21:46:55 +0000 Subject: [PATCH] * integrate apache package. * finetune the config script * don't use Webcits TinyMCE, as there is a debian package out there. * move our templates to /usr/share/webcit/ --- webcit/debian/changelog | 8 ++-- webcit/debian/citadel-webcit.config | 65 +++++++++++++++++++++++--- webcit/debian/citadel-webcit.postinst | 46 ++++++++++++------ webcit/debian/citadel-webcit.templates | 10 ++++ webcit/debian/control | 2 +- webcit/debian/webcit.init | 55 +--------------------- 6 files changed, 109 insertions(+), 77 deletions(-) diff --git a/webcit/debian/changelog b/webcit/debian/changelog index 7e3ddf8ad..ed0c2d7a8 100644 --- a/webcit/debian/changelog +++ b/webcit/debian/changelog @@ -1,7 +1,9 @@ webcit (7.02-3) unstable; urgency=high - - * purge TinyMCE, as there is a debian package out there. - * move our templates to /etc/citadel/www/ + + * integrate apache package. + * finetune the config script + * don't use Webcits TinyMCE, as there is a debian package out there. + * move our templates to /usr/share/webcit/ * use DESTDIR * remove ucf from package * add po-debconf to Build-Depends diff --git a/webcit/debian/citadel-webcit.config b/webcit/debian/citadel-webcit.config index 9b01a7596..efc7d7a3f 100755 --- a/webcit/debian/citadel-webcit.config +++ b/webcit/debian/citadel-webcit.config @@ -3,15 +3,66 @@ set -e . /usr/share/debconf/confmodule +if test -e /etc/default/webcit; then + source /etc/default/webcit +else + export WEBCIT_CITADEL_IP=127.0.0.1 + export WEBCIT_CITADEL_PORT=504 +fi + +db_capb backup + if test -n "$2"; then - if test "`echo $2 | sed -e 's/[.-]//g'`" -lt 127 \ - -o $1 = reconfigure - then - db_input high citadel/WebcitHttpPort - db_input high citadel/WebcitHttpsPort - db_input high citadel/WebcitInstallnote + if test "`echo $2 | sed -e 's/[.-]//g'`" -lt 127 \ + -o $1 = reconfigure + then + + + STATE=1 + LASTSTATE=2 + while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do + case "$STATE" in + 1) + db_input high citadel/WebcitApacheIntegration + ;; + 2) + db_get citadel/WebcitApacheIntegration + if test "$RET" = "Internal"; then + db_input high citadel/WebcitHttpPort + else + db_set citadel/WebcitHttpPort 8504 + fi + ;; + 3) + db_get citadel/WebcitApacheIntegration + if test "$RET" = "Internal"; then + db_input high citadel/WebcitHttpsPort + db_set citadel/WebcitBindIp 0.0.0.0 + else + db_set citadel/WebcitHttpsPort -1 + db_set citadel/WebcitBindIp 127.0.0.1 + fi + ;; + 4) + db_input high citadel/WebcitInstallnote + ;; + esac + if db_go; then + STATE=$(($STATE + 1)) + else + STATE=$(($STATE - 1)) + fi + + done db_go - fi + db_get ciatdel/WebcitWebserver &&WWWTYPE="$RET" + db_get citadel/WebcitHttpPort && WEBCIT_HTTP_PORT="$RET" + db_get citadel/WebcitHttpsPort && WEBCIT_HTTPS_PORT="$RET" + db_get citadel/WebcitBindIp && WEBCIT_LISTEN_IP="$RET" + + set |grep WEBCIT |sed "s;^;export ;;" >/etc/default/webcit + + fi fi diff --git a/webcit/debian/citadel-webcit.postinst b/webcit/debian/citadel-webcit.postinst index 75ea4bb28..bec157359 100644 --- a/webcit/debian/citadel-webcit.postinst +++ b/webcit/debian/citadel-webcit.postinst @@ -13,22 +13,42 @@ case "$1" in if test ! -d /var/run/citadel/keys; then mkdir -p /var/run/citadel/keys fi - ln -sf /usr/share/tinymce/www /etc/citadel/www/tiny_mce - db_get citadel/WebcitHttpPort && http_port="$RET" - db_get citadel/WebcitHttpsPort && https_port="$RET" - - echo "aplying your settings" - 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 + db_get citadel/WebcitApacheIntegration &&WWWTYPE="$RET" db_stop - + #DEBHELPER# + +# update the webserver, if needed + case "$WWWTYPE" in + "Apache") + webservers="apache" + aenmod proxy + ;; + "Apache-SSL") + webservers="apache-ssl" + ;; + "Apache2") + webservers="apache2" + a2enmod proxy + ;; + "All") + webservers="apache apache-ssl apache2" + ;; + *) + webservers="" + ;; + esac + + for server in $webservers; do + if [ -d "/etc/${server}/conf.d" ]; then + if [ ! -e "/etc/${server}/conf.d/webcit-citadel" ] ; then + ln -s /etc/citadel/apache.conf "/etc/${server}/conf.d/webcit.conf" + fi + invoke-rc.d $server reload || true + fi + done + ;; abort-upgrade|abort-remove|abort-deconfigure) ;; diff --git a/webcit/debian/citadel-webcit.templates b/webcit/debian/citadel-webcit.templates index 7326103ac..e001d4ea2 100644 --- a/webcit/debian/citadel-webcit.templates +++ b/webcit/debian/citadel-webcit.templates @@ -1,3 +1,13 @@ +Template: citadel/WebcitApacheIntegration +Type: select +_Choices: Apache, Apache-SSL, Apache2, All, Internal +Default: Internal +_Description: Should Webcit be integrated in your Apache? + If you want Webcit to run alongside with one of your other installed + Apache Webservers, select it from the list, else use Internal to make + Webcit use its own HTTP Server Facilities. + + Template: citadel/WebcitHttpPort Type: string Default: 8504 diff --git a/webcit/debian/control b/webcit/debian/control index 8c1d98ddf..c90c27c1c 100644 --- a/webcit/debian/control +++ b/webcit/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.7.2 Package: citadel-webcit Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, debconf, tinymce +Depends: ${shlibs:Depends}, ${misc:Depends}, debconf, tinymce, citadel-common Suggests: citadel-server, apache2 | apache Description: web-based frontend to Citadel groupware server WebCit is a web-based, AJAX-enabled frontend to the Citadel groupware system. diff --git a/webcit/debian/webcit.init b/webcit/debian/webcit.init index a9b0f1b95..3e3521ba4 100644 --- a/webcit/debian/webcit.init +++ b/webcit/debian/webcit.init @@ -71,8 +71,6 @@ do_start() mkdir -p $LOGDIR fi - - # are we disabled? if test "$1" -lt "0"; then return 0 @@ -88,9 +86,6 @@ do_start() 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. } # @@ -98,47 +93,13 @@ do_start() # 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 - for i in $PIDFILE.*; do if test -f $i; then kill `cat $i` rm -f $i fi; done - - #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 @@ -176,20 +137,7 @@ case "$1" in esac fi ;; - #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 - # if test -n "$MODERN"; then log_daemon_msg "Restarting $DESC" "$NAME" else @@ -213,10 +161,11 @@ case "$1" in log_end_msg 1 ;; esac + else + do_start fi ;; *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 3 ;; -- 2.30.2