From 2f3fe04ee40854b57ef94f3f2d390a8cd6129e19 Mon Sep 17 00:00:00 2001 From: Jukka Heino Date: Tue, 13 Dec 2005 13:25:01 +0000 Subject: [PATCH] bitlbee: add user and group in pre-install instead of post-install --- bitlbee/.footprint | 5 ++++- bitlbee/Pkgfile | 5 ++++- bitlbee/README | 15 +++++++++++---- bitlbee/post-install | 25 ------------------------- bitlbee/pre-install | 12 ++++++++++++ 5 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 bitlbee/post-install create mode 100644 bitlbee/pre-install diff --git a/bitlbee/.footprint b/bitlbee/.footprint index 169eb98ca..1a9bf37e5 100644 --- a/bitlbee/.footprint +++ b/bitlbee/.footprint @@ -9,7 +9,10 @@ drwxr-xr-x root/root usr/man/man5/ drwxr-xr-x root/root usr/man/man8/ -rw-r--r-- root/root usr/man/man8/bitlbee.8.gz drwxr-xr-x root/root usr/sbin/ --rwxr-x--- root/root usr/sbin/bitlbee +-rwxr-x--- root/bitlbee usr/sbin/bitlbee drwxr-xr-x root/root usr/share/ drwxr-xr-x root/root usr/share/bitlbee/ -rw-r--r-- root/root usr/share/bitlbee/help.txt +drwx------ bitlbee/bitlbee var/ +drwx------ bitlbee/bitlbee var/lib/ +drwx------ bitlbee/bitlbee var/lib/bitlbee/ diff --git a/bitlbee/Pkgfile b/bitlbee/Pkgfile index 1774e0c19..7b16d67ff 100644 --- a/bitlbee/Pkgfile +++ b/bitlbee/Pkgfile @@ -6,7 +6,7 @@ name=bitlbee version=1.0 -release=1 +release=2 source=(http://get.$name.org/src/$name-$version.tar.gz) build() { @@ -20,5 +20,8 @@ build() { make make DESTDIR=$PKG install make DESTDIR=$PKG install-etc + + install -d -m 0700 -o bitlbee -g bitlbee $PKG/var/lib/bitlbee chmod 0750 $PKG/usr/sbin/$name + chown root:bitlbee $PKG/usr/sbin/$name } diff --git a/bitlbee/README b/bitlbee/README index ee24cc7c7..69759448e 100644 --- a/bitlbee/README +++ b/bitlbee/README @@ -2,11 +2,18 @@ REQUIREMENTS PRE-INSTALL +Run the pre-install script with "sh pre-install" to create the 'bitlbee' +user and group. + POST-INSTALL -Run the post-install script with "sh post-install", see if the ircd -entry was added correctly to /etc/inetd.conf and restart inetd. Now you -should be able to connect 127.0.0.1:6667 with your IRC client. You might -want to add inetd to the SERVICES array in /etc/rc.conf. +Add the following to /etc/inetd.conf: + +ircd stream tcp nowait bitlbee /usr/sbin/bitlbee bitlbee + +Start or restart inetd. Now you should be able to connect 127.0.0.1:6667 +with your IRC client. You might want to add inetd to the SERVICES array +in /etc/rc.conf and set up a firewall or modify /etc/hosts.deny to stop +outsiders from accessing your BitlBee gateway. PRECAUTION diff --git a/bitlbee/post-install b/bitlbee/post-install deleted file mode 100644 index beac47e24..000000000 --- a/bitlbee/post-install +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -/usr/bin/grep -q ^bitlbee: /etc/group -if [ $? -eq 1 ] ; then - /usr/sbin/groupadd bitlbee -fi - -/usr/bin/grep -q ^bitlbee: /etc/passwd -if [ $? -eq 1 ] ; then - /usr/sbin/useradd -g bitlbee -c BitlBee -d /var/lib/bitlbee -s /bin/false bitlbee - /usr/bin/passwd -l bitlbee -fi - -if [ ! -d /var/lib/bitlbee ] ; then - /bin/mkdir /var/lib/bitlbee -fi - -/usr/bin/grep -q bitlbee /etc/inetd.conf -if [ $? -eq 1 ] ; then - echo 'ircd stream tcp nowait bitlbee /usr/sbin/bitlbee bitlbee' >> /etc/inetd.conf -fi - -/bin/chmod 0700 /var/lib/bitlbee -/bin/chown root:bitlbee /usr/sbin/bitlbee -/bin/chown -R bitlbee:bitlbee /var/lib/bitlbee diff --git a/bitlbee/pre-install b/bitlbee/pre-install new file mode 100644 index 000000000..9a095d824 --- /dev/null +++ b/bitlbee/pre-install @@ -0,0 +1,12 @@ +#!/bin/sh + +/usr/bin/grep -q ^bitlbee: /etc/group +if [ $? -eq 1 ] ; then + /usr/sbin/groupadd bitlbee +fi + +/usr/bin/grep -q ^bitlbee: /etc/passwd +if [ $? -eq 1 ] ; then + /usr/sbin/useradd -g bitlbee -c BitlBee -d /var/lib/bitlbee -s /bin/false bitlbee + /usr/bin/passwd -l bitlbee +fi