Update todo.txt package
[slackbuilds.git] / stalonetray / stalonetray.SlackBuild
blobce8f01d05be5c8de642f043e145a2c01a2971487
1 #!/bin/bash
3 # Slackware build script for stalonetray
5 # Copyright 2010 - 2012 Binh Nguyen <binhvng@gmail.com>
6 # Copyright 2013 - 2015 Markus Hutmacher <mailing@markhu.de>
7 # All rights reserved.
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)
28 PRGNAM=stalonetray
29 VERSION=${VERSION:-0.8.3}
30 BUILD=${BUILD:-1}
31 TAG=${TAG:-_SBo}
32 PKGTYPE=${PKGTYPE:-tgz}
34 if [ -z "$ARCH" ]; then
35 case "$( uname -m )" in
36 i?86) ARCH=i586 ;;
37 arm*) ARCH=arm ;;
38 *) ARCH=$( uname -m ) ;;
39 esac
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"
47 exit 0
50 TMP=${TMP:-/tmp/SBo}
51 PKG=$TMP/package-$PRGNAM
52 OUTPUT=${OUTPUT:-/tmp}
54 if [ "$ARCH" = "i586" ]; then
55 SLKCFLAGS="-O2 -march=i586 -mtune=i686"
56 LIBDIRSUFFIX=""
57 elif [ "$ARCH" = "i686" ]; then
58 SLKCFLAGS="-O2 -march=i686 -mtune=i686"
59 LIBDIRSUFFIX=""
60 elif [ "$ARCH" = "x86_64" ]; then
61 SLKCFLAGS="-O2 -fPIC"
62 LIBDIRSUFFIX="64"
63 else
64 SLKCFLAGS="-O2"
65 LIBDIRSUFFIX=""
68 set -eu
70 rm -rf $PKG
71 mkdir -p $TMP $PKG $OUTPUT
72 cd $TMP
73 rm -rf $PRGNAM-$VERSION
74 tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
75 cd $PRGNAM-$VERSION
76 chown -R root:root .
77 find -L . \
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 \) \
81 -exec chmod 644 {} \;
83 CFLAGS="$SLKCFLAGS" \
84 ./configure \
85 --prefix=/usr \
86 --libdir=/usr/lib${LIBDIRSUFFIX} \
87 --sysconfdir=/etc \
88 --localstatedir=/var \
89 --mandir=/usr/man \
90 --infodir=/usr/info \
91 --docdir=/usr/doc/$PRGNAM-$VERSION \
92 --localedir=/usr/share/locale \
93 --build=$ARCH-slackware-linux
95 make
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
111 cd $PKG
112 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE