summaryrefslogtreecommitdiff
path: root/network/znc/znc.SlackBuild
diff options
context:
space:
mode:
authorSean Donner <sean.donner at gmail dot com>2010-05-12 17:44:31 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-12 17:44:31 +0200
commit5931c240a3a8537ad2d5ab38609c845cb2ac66e3 (patch)
treedf820c4c0621473a3f31306738cd98d4b3c52bdb /network/znc/znc.SlackBuild
parent574bf2541ddabf0d04e0e28f22ae84d01b3b784a (diff)
downloadslackbuilds-5931c240a3a8537ad2d5ab38609c845cb2ac66e3.tar.gz
network/znc: Updated for version 0.062
Diffstat (limited to 'network/znc/znc.SlackBuild')
-rw-r--r--network/znc/znc.SlackBuild72
1 files changed, 55 insertions, 17 deletions
diff --git a/network/znc/znc.SlackBuild b/network/znc/znc.SlackBuild
index 161d88650c..063ce59755 100644
--- a/network/znc/znc.SlackBuild
+++ b/network/znc/znc.SlackBuild
@@ -1,8 +1,8 @@
#!/bin/sh
-# Slackware build script for VDE2
+# Slackware build script for ZNC
-# Copyright 2007-2008 Sean Donner (sean.donner@sbcglobal.net)
+# Copyright 2007-2009 Sean Donner (sean.donner at gmail dot com)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,11 +23,15 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=znc
-VERSION=0.052
+VERSION=0.062
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+ZNC_USER=${ZNC_USER:-znc}
+WITH_SSL=${WITH_SSL:-yes}
+WITH_IPV6=${WITH_IPV6:-yes}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -39,39 +43,73 @@ elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
fi
+# Bail if user and/or group isn't valid on your system
+# uid=219 is suggested to avoid conflicts with other SBo packages,
+# but it's your call: http://slackbuilds.org/uid_gid.txt
+if ! grep -q "^$ZNC_USER:" /etc/passwd; then
+ echo " You must have a $ZNC_USR user to run this script. "
+ echo " Something like this should suffice for most systems: "
+ echo " # useradd -u 219 -g 99 -c \"ZNC User\" -d /etc/znc $ZNC_USER"
+ exit 1
+fi
+
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
+if [ "$WITH_SSL" != "yes" ]; then
+ do_openssl="--without-openssl"
+else
+ do_openssl="--with-openssl"
+fi
+
+if [ "$WITH_IPV6" != "yes" ]; then
+ do_ipv6="--disable-ipv6"
+else
+ do_ipv6="--enable-ipv6"
+fi
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --with-openssl \
- --enable-ipv6
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --build=$ARCH-slackware-linux \
+ $do_openssl \
+ $do_ipv6
+
+make all
+make install DESTDIR=$PKG
-make all || exit 1
-make install DESTDIR=$PKG || exit 1
+# Change the ownership of the configuration directory
+mkdir -p $PKG/etc/znc
+chown -R $ZNC_USER $PKG/etc/znc
-( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-)
+# Install an init script
+mkdir -p $PKG/etc/rc.d
+sed -e "s/_ZNC_USER_/$ZNC_USER/g" -e "s/_VERSION_/$VERSION/g" $CWD/rc.znc \
+ > $PKG/etc/rc.d/rc.znc.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS LICENSE* README $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ AUTHORS LICENSE* README \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+sed s/_ZNC_USER_/$ZNC_USER/g $CWD/README.SBo > \
+ $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz