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
. /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
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)
;;
+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
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.
mkdir -p $LOGDIR
fi
-
-
# are we disabled?
if test "$1" -lt "0"; 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.
}
#
#
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
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
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
;;