Not yet working stack checking (symbol STACKCHECK)
[gnokii.git] / packaging / Slackware / SlackBuild.in
1 #!/bin/sh
2
3 #
4 # Script for building GNOKII package
5 # Written by Pawe³ Kot <pkot@linuxnews.pl>
6 #
7
8 ARCH=@ARCH@
9 PN=@PACKAGE@
10 PV=@VERSION@
11
12 DOCS="COPYING ChangeLog VERSION Docs/CREDITS Docs/DataCalls-QuickStart Docs/README*"
13 CONF="Docs/sample/gnokiirc"
14
15 CWD=`pwd`
16
17 # There will be the sources placed
18 if [ "$TMP" = "" ]; then
19         TMP=/tmp
20 fi
21 if [ ! -d $TMP ]; then
22         mkdir -p $TMP
23 fi
24
25 # The package will be built there
26 PKG=$TMP/package-$PN-$PV
27 if [ ! -d $PKG ]; then
28         mkdir -p $PKG
29 fi
30
31 # Untar the sources
32 cd $TMP
33 tar xzvf $CWD/$PN-$PV.tar.gz
34 cd $PN-$PV
35
36 # Configure and make package
37 ./configure --prefix=/usr --with-x --enable-nls $ARCH-slackware-linux || exit 1
38 make || exit 1
39 make prefix=$PKG/usr install || exit 1
40
41 # Copy the docs
42 mkdir -p $PKG/usr/doc/$PN-$PV
43 cp -a $DOCS $PKG/usr/doc/$PN-$PV
44 chmod 644 $PKG/usr/doc/$PN-$PV
45
46 # and the configuration
47 mkdir -p $PKG/etc
48 sed "s|/usr/local/sbin|/usr/sbin|" < $CONF > $PKG/etc/gnokiirc
49
50 # Now, add gnokii group, set the permissions
51 GROUPADD=`which groupadd`
52 cd $PKG
53 mkdir install
54 cat > install/doinst.sh <<EOF
55 $GROUPADD gnokii >/dev/null 2>&1
56 chown root.gnokii /usr/bin/gnokii
57 chmod 750 /usr/bin/gnokii
58 chown root.gnokii /usr/sbin/gnokiid
59 chmod 750 /usr/sbin/gnokiid
60 chown root.gnokii /usr/sbin/mgnokiidev
61 chmod 4750 /usr/sbin/mgnokiidev
62 EOF
63
64 # and build the package answering "yes" twice
65 echo "y
66 y" | makepkg $TMP/$PN.tgz
67
68 # Cleanup
69 rm -rf $TMP/$PN-$PV
70 rm -rf $PKG