3 # Slackware build script for stalonetray
5 # Copyright 2010 - 2012 Binh Nguyen <binhvng@gmail.com>
6 # Copyright 2013 - 2015 Markus Hutmacher <mailing@markhu.de>
9 # Redistribution and use of this script, with or without modification, is
10 # permitted provided that the following conditions are met:
12 # 1. Redistributions of this script must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
16 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 cd $
(dirname $0) ; CWD
=$
(pwd)
29 VERSION
=${VERSION:-0.8.3}
32 PKGTYPE
=${PKGTYPE:-tgz}
34 if [ -z "$ARCH" ]; then
35 case "$( uname -m )" in
38 *) ARCH
=$
( uname
-m ) ;;
42 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
43 # the name of the created package would be, and then exit. This information
44 # could be useful to other scripts.
45 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
46 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
51 PKG
=$TMP/package-
$PRGNAM
52 OUTPUT
=${OUTPUT:-/tmp}
54 if [ "$ARCH" = "i586" ]; then
55 SLKCFLAGS
="-O2 -march=i586 -mtune=i686"
57 elif [ "$ARCH" = "i686" ]; then
58 SLKCFLAGS
="-O2 -march=i686 -mtune=i686"
60 elif [ "$ARCH" = "x86_64" ]; then
71 mkdir
-p $TMP $PKG $OUTPUT
73 rm -rf $PRGNAM-$VERSION
74 tar xvf
$CWD/$PRGNAM-$VERSION.
tar.bz2
78 \
( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \
) \
79 -exec chmod 755 {} \
; -o \
80 \
( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \
) \
86 --libdir=/usr
/lib
${LIBDIRSUFFIX} \
88 --localstatedir=/var \
91 --docdir=/usr
/doc
/$PRGNAM-$VERSION \
92 --localedir=/usr
/share
/locale \
93 --build=$ARCH-slackware-linux
96 make install DESTDIR
=$PKG
98 find $PKG |
xargs file |
grep -e "executable" -e "shared object" |
grep ELF \
99 | cut
-f 1 -d : |
xargs strip
--strip-unneeded 2> /dev
/null || true
101 find $PKG/usr
/man
-type f
-exec gzip -9 {} \
;
103 mkdir
-p $PKG/usr
/doc
/$PRGNAM-$VERSION
104 cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README TODO stalonetrayrc.sample \
105 $PKG/usr
/doc
/$PRGNAM-$VERSION
106 cat $CWD/$PRGNAM.SlackBuild
> $PKG/usr
/doc
/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
108 mkdir
-p $PKG/install
109 cat $CWD/slack-desc
> $PKG/install
/slack-desc
112 /sbin
/makepkg
-l y
-c n
$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.
$PKGTYPE