4 # Script for building GNOKII package
5 # Written by Pawe³ Kot <pkot@linuxnews.pl>
15 DOCS2="Docs/protocol Docs/sample"
16 CONF="Docs/sample/gnokiirc"
20 # There will be the sources placed
21 if [ "$TMP" = "" ]; then
24 if [ ! -d $TMP ]; then
28 # The package will be built there
29 PKG=$TMP/package-$PN-$PV
30 if [ ! -d $PKG ]; then
36 tar xzvf $CWD/$PN-$PV.tar.gz
39 # Configure and make package
40 ./configure --prefix=/usr --with-xgnokiidir=/usr/X11R6 i386-slackware-linux
42 make prefix=$PKG/usr xgnokii_libdir=$PKG/usr/X11R6 install
45 mkdir -p $PKG/usr/doc/$PN-$PV
46 cp $DOCS1 $PKG/usr/doc/$PN-$PV
47 cp -r $DOCS2 $PKG/usr/doc/$PN-$PV
49 # and the configuration
51 sed "s|/usr/local/sbin|/usr/sbin|" < $CONF > $PKG/etc/gnokiirc.new
53 # Now, add gnokii group, set the permissions
54 GROUPADD=`which groupadd`
57 cat > install/doinst.sh <<EOF
60 $GROUPADD gnokii >/dev/null 2>&1
61 chown root.gnokii /usr/bin/gnokii
62 chmod 750 /usr/bin/gnokii
63 chown root.gnokii /usr/sbin/gnokiid
64 chmod 750 /usr/sbin/gnokiid
65 chown root.gnokii /usr/sbin/mgnokiidev
66 chmod 4750 /usr/sbin/mgnokiidev
68 if [ -f /etc/gnokiirc ]; then
69 rm -f /etc/gnokiirc.new
71 mv /etc/gnokiirc.new /etc/gnokiirc
75 # and build the package answering "yes" twice
77 y" | makepkg $TMP/$PN-$PV-$ARCH-$BUILD.tgz