From 39bb231890f62d31bc44930f2eae2f127281bdfb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 21 Nov 2005 16:13:29 +0000 Subject: [PATCH] * Apache config package added * make recursive examples * automatization of the upstream version --- webcit/debian/changelog | 6 ++ webcit/debian/citadel-webcit-apache.config | 20 ++++ webcit/debian/citadel-webcit-apache.postinst | 100 ++++++++++++++++++ webcit/debian/citadel-webcit-apache.postrm | 89 ++++++++++++++++ .../citadel-webcit-apache.postrm.debhelper | 6 ++ webcit/debian/citadel-webcit-apache.substvars | 1 + webcit/debian/citadel-webcit-apache.templates | 21 ++++ webcit/debian/citadel-webcit.postinst | 68 ++++++++---- webcit/debian/citadel-webcit.postrm | 20 ++-- webcit/debian/citadel-webcit.substvars | 2 +- webcit/debian/citadel-webcit.templates | 3 +- webcit/debian/control | 6 ++ webcit/debian/files | 1 - webcit/debian/rules | 15 ++- 14 files changed, 324 insertions(+), 34 deletions(-) create mode 100644 webcit/debian/citadel-webcit-apache.config create mode 100644 webcit/debian/citadel-webcit-apache.postinst create mode 100644 webcit/debian/citadel-webcit-apache.postrm create mode 100644 webcit/debian/citadel-webcit-apache.postrm.debhelper create mode 100644 webcit/debian/citadel-webcit-apache.substvars create mode 100644 webcit/debian/citadel-webcit-apache.templates delete mode 100644 webcit/debian/files diff --git a/webcit/debian/changelog b/webcit/debian/changelog index 902f4cdcc..b396c11c6 100644 --- a/webcit/debian/changelog +++ b/webcit/debian/changelog @@ -1,3 +1,9 @@ +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 + webcit (6.21-1) unstable; urgency=low * Initial release Closes: #nnnn (nnnn is the bug number of your ITP) diff --git a/webcit/debian/citadel-webcit-apache.config b/webcit/debian/citadel-webcit-apache.config new file mode 100644 index 000000000..6050001a3 --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.config @@ -0,0 +1,20 @@ +#!/bin/bash + +PACKAGE="citadel" +SOURCE="citadel" +VERSION="4:2.6.4-pl3-1" + +. /usr/share/debconf/confmodule +db_version 2.0 || [ 0 -lt 30 ] + +# Package maintainer's commands follow: +if test -n "$2"; then + if test "`echo $2 | sed -e 's/[.-]//g'`" -lt 127 \ + -o $1 = reconfigure + then + db_input medium citadel/reconfigure-webserver || true + db_go +# End of package maintainer's commands + fi +fi +exit 0 diff --git a/webcit/debian/citadel-webcit-apache.postinst b/webcit/debian/citadel-webcit-apache.postinst new file mode 100644 index 000000000..0d3edb9ea --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.postinst @@ -0,0 +1,100 @@ +#! /bin/sh +# postinst.skeleton +# Skeleton maintainer script showing all the possible cases. +# Written by Charles Briscoe-Smith, March-June 1998. Public Domain. + +# Abort if any command returns an error value +set -e +. /usr/share/debconf/confmodule + + +uninclude() { + if [ ! -a /etc/$server/conf.d/webcit ]; then + if [ -f /etc/$server/httpd.conf \ + -a -f /usr/share/wwwconfig-common/apache-uninclude_all.sh ] + then + includefile=$1 + . /usr/share/wwwconfig-common/apache-uninclude_all.sh + fi + fi +} + + +case "$1" in + configure) + # Configure this package. If the package must prompt the user for + # information, do it here. + . /usr/share/debconf/confmodule + db_version 2.0 + db_get "citadel/baseurl" && baseurl="$RET" + if echo "$baseurl"|grep -q "http"; then + if echo "$baseurl"|grep -q "https"; then + HOSTNAME= ServerName `echo "$baseurl" |sed "s;https://\(.*\)/.*;\1;"` + BASEURL=`echo "$baseurl" |sed "s;http://.*\..*/.*;\1;"` + else + HOSTNAME= ServerName `echo "$baseurl" |sed "s;https://\(.*\)/.*;\1;"` + BASEURL=`echo "$baseurl" |sed "s;https://.*\..*/.*;\1;"` + fi + else + HOSTNAME="ServerName *" + BASEURL="$baseurl" + fi + echo " + +${SERVERNAME} + DocumentRoot /var/www/ +# ProxyPass /dotskip http://127.0.0.1:2000/dotskip +# ProxyPassReverse /dotskip http://127.0.0.1:2000/dotskip + ProxyPass /webcit/ http://127.0.0.1:2000/ + ProxyPassReverse /webcit/ http://127.0.0.1:2000/ + ProxyPass /listsub/ http://127.0.0.1:2000/listsub/ + ProxyPassReverse /listsub/ http://127.0.0.1:2000/listsub/ + ProxyPass /groupdav/ http://127.0.0.1:2000/groupdav/ + ProxyPassReverse /groupdav/ http://127.0.0.1:2000/groupdav/ + +" >/tmp/apache.conf + ucf /tmp/apache.conf /etc/citadel/apache.conf + db_get "citadel/webserver" && webserver="$RET" + case "$webserver" in + Apache) webservers="apache";; + Apache-SSL) webservers="apache-ssl";; + Apache-Perl) webservers="apache-perl";; + Apache2) + webservers="apache2" + a2enmod proxy + ;; + + *) webservers="";; + esac + + + + for server in $webservers; do + test -d /etc/$server || continue + + if [ -n "$2" ]; then + uninclude + fi + + if [ ! -e /etc/$server/conf.d/webcit ] + then + ln -s /etc/citadel/apache.conf /etc/$server/conf.d/webcit + fi + restart=$server + servers=$webservers + . /usr/share/wwwconfig-common/restart.sh + done + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/webcit/debian/citadel-webcit-apache.postrm b/webcit/debian/citadel-webcit-apache.postrm new file mode 100644 index 000000000..de0073f90 --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.postrm @@ -0,0 +1,89 @@ +#! /bin/sh +# postrm.skeleton +# Skeleton maintainer script showing all the possible cases. +# Written by Charles Briscoe-Smith, March-June 1998. Public Domain. +. /usr/share/debconf/confmodule + +# Abort if any command returns an error value +set -e + +# This script is called twice during the removal of the package; once +# after the removal of the package's files from the system, and as +# the final step in the removal of this package, after the package's +# conffiles have been removed. + +# Ensure the menu system is updated +: [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus + +case "$1" in + remove) + # This package is being removed, but its configuration has not yet + # been purged. + + ;; + purge) + # This package has previously been removed and is now having + # its configuration purged from the system. + # remove the gunzipped setup executable. + db_purge 'citadel/webserver' + db_purge 'citadel/baseurl' + ### TODO: remove citadel from inittab! + ;; + disappear) + if test "$2" != overwriter; then + echo "$0: undocumented call to \`postrm $*'" 1>&2 + exit 0 + fi + # This package has been completely overwritten by package $3 + # (version $4). All our files are already gone from the system. + # This is a special case: neither "prerm remove" nor "postrm remove" + # have been called, because dpkg didn't know that this package would + # disappear until this stage. + : + + ;; + upgrade) + # About to upgrade FROM THIS VERSION to version $2 of this package. + # "prerm upgrade" has been called for this version, and "preinst + # upgrade" has been called for the new version. Last chance to + # clean up. + : + + ;; + failed-upgrade) + # About to upgrade from version $2 of this package TO THIS VERSION. + # "prerm upgrade" has been called for the old version, and "preinst + # upgrade" has been called for this version. This is only used if + # the previous version's "postrm upgrade" couldn't handle it and + # returned non-zero. (Fix old postrm bugs here.) + : + + ;; + abort-install) + # Back out of an attempt to install this package. Undo the effects of + # "preinst install...". There are two sub-cases. + : + + if test "${2+set}" = set; then + # When the install was attempted, version $2's configuration + # files were still on the system. Undo the effects of "preinst + # install $2". + : + + else + # We were being installed from scratch. Undo the effects of + # "preinst install". + : + + fi ;; + abort-upgrade) + # Back out of an attempt to upgrade this package from version $2 + # TO THIS VERSION. Undo the effects of "preinst upgrade $2". + : + + ;; + *) echo "$0: didn't understand being called with \`$1'" 1>&2 + exit 0;; +esac + +exit 0 diff --git a/webcit/debian/citadel-webcit-apache.postrm.debhelper b/webcit/debian/citadel-webcit-apache.postrm.debhelper new file mode 100644 index 000000000..bc035b98c --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.postrm.debhelper @@ -0,0 +1,6 @@ +# Automatically added by dh_installdebconf +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi +# End automatically added section diff --git a/webcit/debian/citadel-webcit-apache.substvars b/webcit/debian/citadel-webcit-apache.substvars new file mode 100644 index 000000000..a8fe3cff5 --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.substvars @@ -0,0 +1 @@ +misc:Depends=debconf (>= 0.5) | debconf-2.0 diff --git a/webcit/debian/citadel-webcit-apache.templates b/webcit/debian/citadel-webcit-apache.templates new file mode 100644 index 000000000..1fae6ef7f --- /dev/null +++ b/webcit/debian/citadel-webcit-apache.templates @@ -0,0 +1,21 @@ + +Template: citadel/webserver +Type: multiselect +Choices: Apache, Apache-SSL, Apache-Perl, Apache2, None +Default: Apache2 +Description: Select Server + Integrates Citadel with your Webserver. + Please select one or more Webservers, you want webcit to + be visible under. Webcit can run under any Proxy enabled + Webserver but this automatic configuration process only + supports Apache servers. + +Template: citadel/baseurl +Type: string +Default: /webcit +Description: HTTP Location + Please specify the way you want to make Webcit visible + through your Webserver. Just enter a path, if you want + to make it visible under that path at any of your vhosts. + Alternate enter a FQDN of the VHost you want to use, like + http://webcit.yoursite.net \ No newline at end of file diff --git a/webcit/debian/citadel-webcit.postinst b/webcit/debian/citadel-webcit.postinst index 3bbc468f8..b38eea2cb 100644 --- a/webcit/debian/citadel-webcit.postinst +++ b/webcit/debian/citadel-webcit.postinst @@ -61,31 +61,49 @@ case "$1" in # maintainer version, and let it handle how to manage the real # confuguration file in /etc. This is how a static configuration # file can be handled: - cd /var/lib/citadel/www/static; md5sum * |grep -v ".gz" |grep -v md5sums>/tmp/md5sums - gunzip -c /usr/share/doc/citadel-webcit/examples/static/md5sums > /tmp/newsums + rm -f /tmp/md5sums + touch /tmp/md5sums + cd /var/lib/citadel/www/; + for i in `find -type f `; do + md5sum "$i" >>/tmp/md5sums + done + + cd /usr/share/doc/citadel-webcit/examples/ + # if target dirs don't exist, create them. + for i in `find -type d` ; do + if test ! -d /var/lib/citadel/www/$i; then + mkdir -p /var/lib/citadel/www/$i + fi + done + + gunzip -c md5sums > /tmp/newsums if diff /tmp/newsums /tmp/md5sums >/dev/null; then - echo >/dev/null + echo ''>/dev/null else - cd /usr/share/doc/citadel-webcit/examples/static; for i in `echo *|sed "s;md5sums.gz;;"`; do - case $i in - *.gz) - j=`echo $i|sed "s;.gz;;"` - gunzip -c "/usr/share/doc/citadel-webcit/examples/static/$i" >"/tmp/$j" - i=$j - ;; - *) - cp "/usr/share/doc/citadel-webcit/examples/static/$i" "/tmp" - ;; - esac - origsum=`grep " $i" /tmp/md5sums |sed "s; .*;;"` - newsum=`grep " $i" /tmp/newsums |sed "s; .*;;"` - if test -z "$origsum"; then - ucf "/tmp/$i" "/var/lib/citadel/www/static/$i" + cd /usr/share/doc/citadel-webcit/examples/ + for i in `cat /tmp/newsums |sed "s;.* \./;;"`; do + if test -f $i.gz; then + j=`basename $i|sed -e "s;.gz;;" ` + gunzip -c "/usr/share/doc/citadel-webcit/examples$REL_PATH/$i" >"/tmp/$j" + i=`dirname $i`/$j else - if test "$origsum" != "$newsum"; then - ucf "/tmp/$i" "/var/lib/citadel/www/static/$i" + j=`basename $i` + cp "/usr/share/doc/citadel-webcit/examples/$i" "/tmp" + fi + if test -f /var/lib/citadel/www/$i; then + origsum=`grep "$i" /tmp/md5sums |sed "s; .*;;"` + newsum=`grep "$i" /tmp/newsums |sed "s; .*;;"` + if test -z "$origsum"; then + ucf "/tmp/$j" "/var/lib/citadel/www/$i" + else + if test "$origsum" != "$newsum"; then + ucf "/tmp/$j" "/var/lib/citadel/www/$i" + fi fi + else + ucf "/tmp/$j" "/var/lib/citadel/www/$i" fi + rm -f "/tmp/$j" done fi rm -f /tmp/newsums /tmp/md5sums @@ -109,6 +127,14 @@ 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 @@ -163,7 +189,7 @@ No ###: ;; - *) echo "$0: didn't understand being called with \`$1'" 1>&2 + *) echo "$0: didn't understand being called with '$1'" 1>&2 exit 0;; esac diff --git a/webcit/debian/citadel-webcit.postrm b/webcit/debian/citadel-webcit.postrm index 1b834a654..63e9d9fc7 100644 --- a/webcit/debian/citadel-webcit.postrm +++ b/webcit/debian/citadel-webcit.postrm @@ -5,6 +5,7 @@ # Abort if any command returns an error value set -e +. /usr/share/debconf/confmodule # This script is called twice during the removal of the package; once # after the removal of the package's files from the system, and as @@ -18,7 +19,7 @@ case "$1" in remove) # This package is being removed, but its configuration has not yet # been purged. - + # TODO: remove from inittab. # Remove diversion #: dpkg-divert --package foo --remove --rename \ @@ -35,11 +36,18 @@ case "$1" in # we mimic dpkg as closely as possible, so we remove configuration # files with dpkg backup extensions too: ### Some of the following is from Tore Anderson: - cd /usr/share/doc/citadel-webcit/examples/static; for i in *; do - i=`echo $i|sed "s;.gz;;"` - ucf --purge "/var/lib/citadel/www/static/$i" - rm -f "/var/lib/citadel/www/static/$i" - done + if test -d /var/lib/citadel/www/static; then + cd /var/lib/citadel/www/static; for i in *; do + i=`echo $i|sed "s;.gz;;"` + ucf --purge "/var/lib/citadel/www/static/$i" + rm -f "/var/lib/citadel/www/static/$i" + done + fi + #rmdir /var/lib/citadel/www/static + echo "/var/lib/citadel/www/keys not removed. " + db_purge 'citadel/WebcitHttpsPort' + db_purge 'citadel/WebcitHttpPort' + db_purge 'citade/WebcitInstallnote' ### TODO: remove citadel from inittab! ;; disappear) diff --git a/webcit/debian/citadel-webcit.substvars b/webcit/debian/citadel-webcit.substvars index 6a583f0e7..552c6985f 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.2.ds1-21), libssl0.9.7, zlib1g (>= 1:1.2.1) +shlibs:Depends=libc6 (>= 2.3.5-1), libssl0.9.8, zlib1g (>= 1:1.2.1) diff --git a/webcit/debian/citadel-webcit.templates b/webcit/debian/citadel-webcit.templates index 71a215255..1208a9441 100644 --- a/webcit/debian/citadel-webcit.templates +++ b/webcit/debian/citadel-webcit.templates @@ -20,4 +20,5 @@ Description: Citadel/UX specified as the Administrator, and review the Points under the Administration menu. If you have further questions review www.citadel.org, specialy the FAQ and Documentation - section. \ No newline at end of file + section. + diff --git a/webcit/debian/control b/webcit/debian/control index a3ab22e30..dca2d215b 100644 --- a/webcit/debian/control +++ b/webcit/debian/control @@ -15,3 +15,9 @@ Description: Webcit, the Webfrontend to the Citadel. FireFox, simply the best web browser on the market. It's the best, it's secure, and it's free, so if you haven't switched yet, why not do so now? + +Package: citadel-webcit-apache +Architecture: any +Depends: citadel-webcit, apache2 | httpd, debconf +Description: Integrates Webcit with your local Apache + diff --git a/webcit/debian/files b/webcit/debian/files deleted file mode 100644 index 742f72c6b..000000000 --- a/webcit/debian/files +++ /dev/null @@ -1 +0,0 @@ -citadel-webcit_6.21-1_i386.deb unknown optional diff --git a/webcit/debian/rules b/webcit/debian/rules index deb4b2d8c..9ce903b6c 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -12,12 +12,12 @@ -CFLAGS = -Wall -g +CFLAGS = -Wall -g -ggdb ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else - CFLAGS += -O2 + CFLAGS += -O0 -ggdb endif configure: configure-stamp @@ -31,7 +31,7 @@ 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-ical --with-db --with-ldap --with-zlib --with-ssl --with-libiconf --with-newt --with-included-gettext touch configure-stamp @@ -73,7 +73,14 @@ install: build mkdir -p $(CURDIR)/debian/citadel-webcit/usr/lib/citadel-webcit/ mv $(CURDIR)/debian/webcit/var/lib/citadel/www/static \ $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/ - cd $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/static; md5sum *|grep -v ".gz"|grep -v md5sums >md5sums + mv $(CURDIR)/debian/webcit/var/lib/citadel/www/tiny_mce \ + $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/ +# TODO: locale -> /usr/share/locale + mv $(CURDIR)/debian/webcit/var/lib/citadel/www/locale \ + $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/ + + cd $(CURDIR)/debian/citadel-webcit/usr/share/doc/citadel-webcit/examples/; \ + 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/webserver \ -- 2.30.2