summaryrefslogtreecommitdiff
path: root/extra/bitlbee
diff options
context:
space:
mode:
Diffstat (limited to 'extra/bitlbee')
-rw-r--r--extra/bitlbee/PKGBUILD52
-rw-r--r--extra/bitlbee/bitlbee.rcd54
-rw-r--r--extra/bitlbee/bitlbee.xinetd12
-rw-r--r--extra/bitlbee/install14
4 files changed, 132 insertions, 0 deletions
diff --git a/extra/bitlbee/PKGBUILD b/extra/bitlbee/PKGBUILD
new file mode 100644
index 000000000..15d0d5ae2
--- /dev/null
+++ b/extra/bitlbee/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id: PKGBUILD 113245 2011-03-08 11:01:22Z bisson $
+# Contributor: FUBAR <mrfubar@gmail.com>
+# Contributor: simo <simo@archlinux.org>
+# Contributor: Jeff 'codemac' Mickey <jeff@archlinux.org>
+# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+
+pkgname=bitlbee
+pkgver=3.0.2
+pkgrel=1
+pkgdesc='Brings instant messaging (XMPP, MSN, Yahoo!, AIM, ICQ, Twitter) to IRC'
+arch=('i686' 'x86_64')
+url='http://www.bitlbee.org/'
+license=('GPL')
+depends=('gnutls' 'glib2' 'libotr')
+optdepends=('xinetd: to run bitlbee through xinetd')
+source=("http://get.bitlbee.org/src/${pkgname}-${pkgver}.tar.gz"
+ 'bitlbee.xinetd'
+ 'bitlbee.rcd')
+sha1sums=('59113b1dc440ebd775e6cf324d1cfb698fb20cfc'
+ '5e0af27ba9cc4fe455e3381c75fc49a9326e2f17'
+ '299776783902cc2e20be49e2fe729572ca656383')
+
+backup=('etc/bitlbee/bitlbee.conf' 'etc/bitlbee/motd.txt' 'etc/xinetd.d/bitlbee')
+install=install
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr \
+ --etcdir=/etc/bitlbee \
+ --pidfile=/var/run/bitlbee/bitlbee.pid \
+ --ipcsocket=/var/run/bitlbee/bitlbee.sock \
+ --strip=0 \
+ --otr=1 \
+ --ssl=gnutls
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ install -dm755 "${pkgdir}"/var/{lib,run}
+ install -o65 -g65 -dm770 "${pkgdir}"/var/lib/bitlbee
+ install -o65 -g65 -dm755 "${pkgdir}"/var/run/bitlbee
+ install -Dm644 "${srcdir}"/bitlbee.xinetd "${pkgdir}"/etc/xinetd.d/bitlbee
+ install -Dm755 "${srcdir}"/bitlbee.rcd "${pkgdir}"/etc/rc.d/bitlbee
+
+ make DESTDIR="${pkgdir}" install
+ make DESTDIR="${pkgdir}" install-etc
+ make DESTDIR="${pkgdir}" install-dev
+}
diff --git a/extra/bitlbee/bitlbee.rcd b/extra/bitlbee/bitlbee.rcd
new file mode 100644
index 000000000..9597b4ab9
--- /dev/null
+++ b/extra/bitlbee/bitlbee.rcd
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+get_pid() {
+ pidof -o %PPID /usr/sbin/bitlbee
+}
+
+case "$1" in
+ start)
+ stat_busy 'Starting Bitlbee'
+ PID=$(get_pid)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/bitlbee/bitlbee.pid ] && rm -f /var/run/bitlbee/bitlbee.pid
+ su -s /bin/sh -c '/usr/sbin/bitlbee -F' 'bitlbee'
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ add_daemon bitlbee
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy 'Stopping Bitlbee'
+ PID=$(get_pid)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/bitlbee/bitlbee.pid &> /dev/null
+ rm_daemon bitlbee
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/extra/bitlbee/bitlbee.xinetd b/extra/bitlbee/bitlbee.xinetd
new file mode 100644
index 000000000..d671a8cfc
--- /dev/null
+++ b/extra/bitlbee/bitlbee.xinetd
@@ -0,0 +1,12 @@
+service bitlbee
+{
+ type = UNLISTED
+ socket_type = stream
+ protocol = tcp
+ wait = no
+ user = bitlbee
+ group = bitlbee
+ server = /usr/sbin/bitlbee
+ port = 6667
+ disable = yes
+}
diff --git a/extra/bitlbee/install b/extra/bitlbee/install
new file mode 100644
index 000000000..0e1caa93f
--- /dev/null
+++ b/extra/bitlbee/install
@@ -0,0 +1,14 @@
+post_install() {
+ echo '==> Bitlbee can run through xinetd or as a daemon for now.'
+ getent group bitlbee &>/dev/null || groupadd -r -g 65 bitlbee >/dev/null
+ getent passwd bitlbee &>/dev/null || useradd -r -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false -c bitlbee bitlbee >/dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ getent passwd bitlbee &>/dev/null && userdel bitlbee >/dev/null
+ getent group bitlbee &>/dev/null && groupdel bitlbee >/dev/null
+}