2010-05-13 08:19:34 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-12-10 00:42:47 +01:00
|
|
|
# Originally written by hollywoodb (hollywoodb@fastmail.fm)
|
|
|
|
# Maintained by sero (firebird209 at gmail dot com)
|
2010-05-13 08:19:34 +02:00
|
|
|
|
|
|
|
PRGNAM=weechat
|
2011-12-10 00:42:47 +01:00
|
|
|
VERSION=0.3.6
|
2010-05-13 08:19:34 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:14:28 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 08:19:34 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:14:28 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 08:19:34 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2011-12-10 00:42:47 +01:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-13 08:19:34 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
if [ "$ARCH" = "x86_64" ]; then
|
2011-12-10 00:42:47 +01:00
|
|
|
patch -p1 < $CWD/weechat-0.3.6-set_pkgconfig_libdir_on_x86_64.diff || exit 1
|
2010-05-13 08:19:34 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake \
|
|
|
|
-DPREFIX=/usr \
|
|
|
|
-DLIBDIR=/usr/lib${LIBDIRSUFFIX} \
|
2011-12-10 00:42:47 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
|
2010-05-13 08:19:34 +02:00
|
|
|
..
|
2011-12-10 00:42:47 +01:00
|
|
|
make VERBOSE=1
|
2010-05-13 08:19:34 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Make the binary and manpage required for this a bit more obvious
|
|
|
|
( cd $PKG/usr/bin ; ln -s weechat-curses weechat )
|
2011-12-10 00:42:47 +01:00
|
|
|
mv $PKG/usr/share/man $PKG/usr/man/
|
2010-05-13 08:19:34 +02:00
|
|
|
( cd $PKG/usr/man/man1 ; ln -s weechat-curses.1 weechat.1 )
|
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2011-12-10 00:42:47 +01:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-05-13 08:19:34 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-12-10 00:42:47 +01:00
|
|
|
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README ABOUT-NLS UPGRADE_0.3 $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 08:19:34 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|