diff options
-rw-r--r-- | network/bitlbee/README | 29 | ||||
-rw-r--r-- | network/bitlbee/bitlbee.SlackBuild | 42 | ||||
-rw-r--r-- | network/bitlbee/bitlbee.info | 6 | ||||
-rw-r--r-- | network/bitlbee/doinst.sh | 17 | ||||
-rw-r--r-- | network/bitlbee/rc.bitlbee | 70 |
5 files changed, 144 insertions, 20 deletions
diff --git a/network/bitlbee/README b/network/bitlbee/README index 83c4387f6f..80aa8a0fa6 100644 --- a/network/bitlbee/README +++ b/network/bitlbee/README @@ -4,7 +4,18 @@ with popular chat networks such as AIM, ICQ, MSN, Yahoo, and Jabber. The user's buddies appear as normal IRC users in a channel, and conversations use the private message facility of IRC. -After the installation, you need to modify your /etc/inetd.conf so bitlbee will +After your installation you will need to configure bitlbee. There are two ways +starting bitlbee: Either as a forked deamon (preferred), or the old way of starting +it through inetd (mostly deprecated these days). + +Bitlbee now includes a standard rc.bitlbee. To have this start on boot-up, add +the following code to /etc/rc.d/rc.local for example + +if [ -x /etc/rc.d/rc.bitlbee ]; then + /etc/rc.d/rc.bitlbee start +fi + +If you choose to use inetd , you need to modify your /etc/inetd.conf so bitlbee will be started when /etc/rc.d/rc.inetd is called on bootup. Add the line below to your /etc/inetd.conf file: 6667 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/bitlbee @@ -12,12 +23,6 @@ your /etc/inetd.conf file: Restart inetd (/etc/rc.d/rc.inetd restart). All that is left to do now is connect your irc client to the localhost. -NOTE: The default "bot"/bitlbee daemon is called 'root'. This is not the root -user on your system. You can easily change it. Register and identify yourself -first, and then: - rename root BitlBot - (or whatever you want) - if you want to use libevent for events, instead of the default glib, install libevent and run the script like this: EVENTS=libevent ./bitlbee.SlackBuild @@ -25,3 +30,13 @@ OTR (Off the record) is not compiled by default. If you want bitlbee to compile with OTR capabilities, you'll need to install libotr from Slackware and run the script as follows: OTR=yes ./bitlbee.SlackBuild +NOTE: The default "bot"/bitlbee daemon is called 'root'. This is not the root +user on your system. You can easily change it. Register and identify yourself +first, and then: + rename root BitlBot + (or whatever you want) + +NOTE: Since bitlbee now runs as a daemon instead of from inetd, bitlbee runs +under its own user (UID/GID: 250). If you have older databases of bitlbee, you +may want to change the permissions on the files in /var/lib/bitlbee. + diff --git a/network/bitlbee/bitlbee.SlackBuild b/network/bitlbee/bitlbee.SlackBuild index 3635aac4ce..44564ac02f 100644 --- a/network/bitlbee/bitlbee.SlackBuild +++ b/network/bitlbee/bitlbee.SlackBuild @@ -2,7 +2,7 @@ # SlackBuild Script for bitlbee -# Copyright 2007-2010 Michiel van Wessem, Manchester, United Kingdom +# Copyright 2007-2011 Michiel van Wessem, Manchester, United Kingdom # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=bitlbee -VERSION=${VERSION:-3.0.1} +VERSION=${VERSION:-3.0.3} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -42,6 +42,9 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +BITLBEE_USER=${BITLBEE_USER:-250} +BITLBEE_GROUP=${BITLBEE_GROUP:-250} + if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" @@ -78,6 +81,31 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Bail if user or group isn't valid on your system +if ! grep ^bitlbee: /etc/passwd 2>&1 > /dev/null; then + +cat << EOF + + You must have a bitlbee user to run this script + + # groupadd -g $BITLBEE_USER bitlbee + # useradd -u $BITLBEE_USER -d /var/lib/bitlbee -s /bin/false -g bitlbee bitlbee + +EOF + + exit +elif ! grep ^bitlbee: /etc/group 2>&1 > /dev/null; then + +cat << EOF + + You must have a bitlbee group to run this script + # groupadd -g $BITLBEE_GROUP bitlbee + +EOF + + exit +fi + # This seems to require gnutls to work properly... CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -85,6 +113,8 @@ CPU="$ARCH" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ + --pcdir=/usr/lib${LIBDIRSUFFIX}/pkgconfig \ + --plugindir=/usr/lib${LIBDIRSUFFIX}/$PRGNAM \ --config=/var/lib/$PRGNAM \ --etcdir=/etc/$PRGNAM \ --datadir=/usr/doc/$PRGNAM-$VERSION \ @@ -107,7 +137,7 @@ if [ -e Makefile.settings ]; then fi make all -make install install-etc install-doc install-plugins DESTDIR=$PKG +make install install-dev install-etc install-doc install-plugins DESTDIR=$PKG find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true @@ -132,7 +162,11 @@ sed -i 's#/etc/init.d/inetd#/etc/rc.d/rc.inetd#' {} \; mv $PKG/etc/$PRGNAM/$PRGNAM.conf $PKG/etc/$PRGNAM/$PRGNAM.conf.new mv $PKG/etc/$PRGNAM/motd.txt $PKG/etc/$PRGNAM/motd.txt.new -chown -R nobody:nogroup $PKG/var/lib/$PRGNAM +chown -R $BITLBEE_USER:$BITLBEE_GROUP $PKG/var/lib/$PRGNAM + +mkdir -p $PKG/etc/rc.d/ +cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new +chmod 0755 $PKG/etc/rc.d/rc.$PRGNAM.new mkdir $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/network/bitlbee/bitlbee.info b/network/bitlbee/bitlbee.info index da8a263cff..59c87e3b77 100644 --- a/network/bitlbee/bitlbee.info +++ b/network/bitlbee/bitlbee.info @@ -1,8 +1,8 @@ PRGNAM="bitlbee" -VERSION="3.0.1" +VERSION="3.0.3" HOMEPAGE="http://www.bitlbee.org" -DOWNLOAD="http://get.bitlbee.org/src/bitlbee-3.0.1.tar.gz" -MD5SUM="4d00c6e09859b653f955b16b988db0ac" +DOWNLOAD="http://get.bitlbee.org/src/bitlbee-3.0.3.tar.gz" +MD5SUM="4fe688e3a80efe011743f4c9265c0310" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Michiel van Wessem" diff --git a/network/bitlbee/doinst.sh b/network/bitlbee/doinst.sh index 54681d8426..7e36c27041 100644 --- a/network/bitlbee/doinst.sh +++ b/network/bitlbee/doinst.sh @@ -1,17 +1,22 @@ -#!/bin/sh -# Handle the incoming configuration files: config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" - # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi - # Otherwise, we leave the .new copy for the admin to consider... } - +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} +preserve_perms etc/rc.d/rc.bitlbee.new config etc/bitlbee/bitlbee.conf.new config etc/bitlbee/motd.txt.new - diff --git a/network/bitlbee/rc.bitlbee b/network/bitlbee/rc.bitlbee new file mode 100644 index 0000000000..5f0ef7ad00 --- /dev/null +++ b/network/bitlbee/rc.bitlbee @@ -0,0 +1,70 @@ +#!/bin/sh + +# /etc/rc.d/rc.bitlbee - Start/stop/restart the bitlbee daemon. +# To make bitlbee start automatically at boot, make this +# file executable: chmod 0755 /etc/rc.d/rc.bitlbee and add it +# to slackware's startup scripts (ie: rc.local) +# + +BITLBEE_CONFIG="/etc/bitlbee/bitlbee.conf" +BITLBEE_PORT="6667" +BITLBEE_OPTS="-F" + +PIDFILE="/var/run/bitlbee.pid" +SOCKFILE="/var/run/bitlbee.sock" + +bitlbee_start() { + echo "Starting bitlbee on port $BITLBEE_PORT..." + CHECK=$(ps aux | grep /usr/sbin/bitlbee | grep -v grep) + STATUS=$? + + # make sure bitlbee isn't running yet + if [ "$STATUS" == "1" ]; then + touch $PIDFILE + chown bitlbee:bitlbee $PIDFILE + + # Start bitlbee in forked mode. + # /usr/sbin/bitlbee -c $BITLBEE_CONFIG # if you have configured bitlbee properly. + /usr/sbin/bitlbee -u bitlbee -p $BITLBEE_PORT $BITLBEE_OPTS + else + echo "bitlbee is already active and running under PID: $(cat $PIDFILE)" + echo "if you think this is wrong, remove the offending PID file" + echo "and restart bitlbee" + exit 1 + fi +} + +bitlbee_stop() { + echo -n "Stopping bitlbee..." + # Are we running a normal daemon or are we forked + if [ "$BITLBEE_OPTS" == "-D" ]; then + if [ -r $PIDFILE ]; then + kill $(cat $PIDFILE) + rm $PIDFILE $SOCKFILE + echo "done" + fi + else + killall bitlbee + rm $PIDFILE $SOCKFILE + echo "done" + fi +} + +# Let's see how we are being called. +case "$1" in + start) + bitlbee_start + ;; + stop) + bitlbee_stop + ;; + restart) + bitlbee_start + sleep 3 + bitlbee_stop + ;; + *) + echo "Usage: $(basename $0) {start|stop|restart}" + exit 1 + ;; +esac |