From 19a8088455308088139d0b2f6a8d0d4fbf982b29 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 6 Jul 2007 00:36:48 +0100 Subject: Adding debian/ tree to the repository again. Updated it to include all 1.0.x versions and some other changes. Might soon start building snapshots again. :-) --- debian/postinst | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 debian/postinst (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 00000000..6c99c40d --- /dev/null +++ b/debian/postinst @@ -0,0 +1,68 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +db_get bitlbee/serveport +PORT="$RET" + +CONFDIR=/var/lib/bitlbee/ + +update-rc.d bitlbee defaults > /dev/null 2>&1 + +## Load default option. Don't want to put this in debconf (yet?) +BITLBEE_OPTS=-F +BITLBEE_DISABLED=0 +BITLBEE_UPGRADE_DONT_RESTART=0 +[ -r /etc/default/bitlbee ] && source /etc/default/bitlbee + +if [ "$BITLBEE_DISABLED" = "0" ]; then + ## In case it's still there (if we're upgrading right now) + update-inetd --remove '.*/usr/sbin/bitlbee' +fi + +cat</etc/default/bitlbee +## /etc/default/bitlbee: Auto-generated/updated script. +## +## Don't edit this line, use dpkg-reconfigure bitlbee +BITLBEE_PORT="$PORT" + +## Use single-process or forking daemon mode? Can't be changed from debconf, +## but maintainer scripts will save your changes here. +BITLBEE_OPTS="$BITLBEE_OPTS" + +## In case you want to stick with inetd mode (or if you just want to disable +## the init scripts for some other reason), you can disable the init script +## here. (Just set it to 1) +BITLBEE_DISABLED=$BITLBEE_DISABLED + +## As a server operator, you can use the RESTART command to restart only the +## master process while keeping all the child processes and their IPC +## connections. By enabling this, the maintainer scripts won't restart +## BitlBee during upgrades so you can restart the master process by hand. +BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART +EOF + +## Bye-bye DebConf, we don't need you anymore. +db_stop + +if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then + /etc/init.d/bitlbee restart +fi + +## If we're upgrading, we'll probably skip this next part +if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then + echo 'BitlBee (probably) already installed, skipping user/configdir installation' + exit 0 +fi + +adduser --system --home /var/lib/bitlbee/ --disabled-login --disabled-password bitlbee +chmod 700 /var/lib/bitlbee/ + +## Can't do this in packaging phase: Don't know the UID yet. Access to +## the file should be limited, now that it stores passwords. +chmod 600 /etc/bitlbee/bitlbee.conf +chown bitlbee /etc/bitlbee/bitlbee.conf + +if [ -z "$2" ]; then + /etc/init.d/bitlbee start +fi -- cgit v1.2.3 From 7448e1bdb7ea75ed8a845816bd2f6bc76ce43785 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 22 Oct 2007 23:39:46 +0100 Subject: debian/ specific: Changed "rm help.txt at upgrade" hack to not remove the file but rename it and rename it back in postinst in case we were doing a dpkg-reconfigure instead of an upgrade. --- debian/postinst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index 6c99c40d..37608e47 100755 --- a/debian/postinst +++ b/debian/postinst @@ -45,6 +45,15 @@ EOF ## Bye-bye DebConf, we don't need you anymore. db_stop +## Restore the helpfile in case we weren't upgrading but just reconfiguring: +if [ -e /usr/share/bitlbee/help.upgrading ]; then + if [ -e /usr/share/bitlbee/help.txt ]; then + rm -f /usr/share/bitlbee/help.upgrading + else + mv /usr/share/bitlbee/help.upgrading /usr/share/bitlbee/help.txt + fi +fi + if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then /etc/init.d/bitlbee restart fi -- cgit v1.2.3 From 379c08a27e637dbcbbe3f39a8723daa765ad0e48 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 21 Mar 2008 00:27:24 +0000 Subject: Updated/Fixed Debian package. --- debian/postinst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index 37608e47..c4edb8e8 100755 --- a/debian/postinst +++ b/debian/postinst @@ -15,9 +15,16 @@ BITLBEE_DISABLED=0 BITLBEE_UPGRADE_DONT_RESTART=0 [ -r /etc/default/bitlbee ] && source /etc/default/bitlbee -if [ "$BITLBEE_DISABLED" = "0" ]; then +if [ "$BITLBEE_DISABLED" = "0" ] && expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null; then ## In case it's still there (if we're upgrading right now) update-inetd --remove '.*/usr/sbin/bitlbee' + if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then + # Thanks for breaking update-inetd! (bugs.debian.org/311111) + # I hope that it works at least with xinetd, because this + # emergency hack doesn't: + perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf + killall -HUP inetd + fi fi cat</etc/default/bitlbee -- cgit v1.2.3 From fcd5003bd6c10f176f63df459e8ca479c5292dc1 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 23 Mar 2008 21:53:53 +0000 Subject: Some Debian package fixes. If nothing else comes up, this will be 1.2-2. (Not sure if I will roll back the non-Debian changes...) --- debian/postinst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index c4edb8e8..1a906474 100755 --- a/debian/postinst +++ b/debian/postinst @@ -13,17 +13,19 @@ update-rc.d bitlbee defaults > /dev/null 2>&1 BITLBEE_OPTS=-F BITLBEE_DISABLED=0 BITLBEE_UPGRADE_DONT_RESTART=0 -[ -r /etc/default/bitlbee ] && source /etc/default/bitlbee +[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee -if [ "$BITLBEE_DISABLED" = "0" ] && expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null; then - ## In case it's still there (if we're upgrading right now) +if [ "$BITLBEE_DISABLED" = "0" ] && type update-inetd > /dev/null 2> /dev/null && + ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then + ## Make sure the inetd entry is gone (can still be there from a + ## previous version. update-inetd --remove '.*/usr/sbin/bitlbee' if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then # Thanks for breaking update-inetd! (bugs.debian.org/311111) # I hope that it works at least with xinetd, because this # emergency hack doesn't: perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf - killall -HUP inetd + killall -HUP inetd || true fi fi -- cgit v1.2.3 From 628e6018a8387603e67f4ce1c8b3b67126408726 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 24 Mar 2008 19:48:36 +0000 Subject: Some more changes for 1.2-2: Adding a bitlbee group for extra security and small stuff. --- debian/postinst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'debian/postinst') diff --git a/debian/postinst b/debian/postinst index 1a906474..80249bfe 100755 --- a/debian/postinst +++ b/debian/postinst @@ -73,13 +73,21 @@ if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then exit 0 fi -adduser --system --home /var/lib/bitlbee/ --disabled-login --disabled-password bitlbee +adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee chmod 700 /var/lib/bitlbee/ ## Can't do this in packaging phase: Don't know the UID yet. Access to -## the file should be limited, now that it stores passwords. -chmod 600 /etc/bitlbee/bitlbee.conf -chown bitlbee /etc/bitlbee/bitlbee.conf +## the file should be limited, now that it stores passwords. Added +## --group later for a little more security, but have to see if I can +## apply this change to existing installations on upgrades. Will think +## about that later. +if getent group bitlbee > /dev/null; then + chmod 640 /etc/bitlbee/bitlbee.conf + chown root:bitlbee /etc/bitlbee/bitlbee.conf +else + chmod 600 /etc/bitlbee/bitlbee.conf + chown bitlbee /etc/bitlbee/bitlbee.conf +fi if [ -z "$2" ]; then /etc/init.d/bitlbee start -- cgit v1.2.3