2010-05-13 01:00:03 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for irssi_otr
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
2013-01-02 02:32:12 +01:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2015-05-10 20:52:50 +02:00
|
|
|
# 20150510 bkw:
|
|
|
|
# - updated for 1.0.0.
|
|
|
|
# - 1.0.0 uses libotr-4.x, so rip out all the static linking mess.
|
|
|
|
# - upstream switched from cmake to autoconf, rewrite most of script.
|
|
|
|
# - xchat support was dropped by upstream, so remove all references.
|
2013-04-12 00:08:54 +02:00
|
|
|
|
2010-05-13 01:00:03 +02:00
|
|
|
PRGNAM=irssi_otr
|
2015-05-10 20:52:50 +02:00
|
|
|
VERSION=${VERSION:-1.0.0}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-13 01:00:03 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:13:02 +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 01:00:03 +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"
|
2010-06-04 07:13:02 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 01:00:03 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
TARNAM=$( echo $PRGNAM | sed 's/_/-/g' )
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $TARNAM-$VERSION
|
|
|
|
tar xvf $CWD/$TARNAM-$VERSION.tar.gz
|
|
|
|
cd $TARNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-25 12:23:31 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-13 01:00:03 +02:00
|
|
|
|
2015-05-10 20:52:50 +02:00
|
|
|
# irssi module dir is hardcoded to lib.
|
|
|
|
sed -i "/^IRSSI_MODULE_DIR/s,lib,lib$LIBDIRSUFFIX," configure.ac
|
2013-04-12 00:08:54 +02:00
|
|
|
|
2015-05-10 20:52:50 +02:00
|
|
|
./bootstrap
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-13 01:00:03 +02:00
|
|
|
|
2015-05-10 20:52:50 +02:00
|
|
|
make
|
|
|
|
make install-strip DESTDIR=$PKG
|
2010-05-13 01:00:03 +02:00
|
|
|
|
2015-05-10 20:52:50 +02:00
|
|
|
# AUTHORS is a 0-byte placeholder.
|
2010-05-13 01:00:03 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2015-05-10 20:52:50 +02:00
|
|
|
cp -a ChangeLog LICENSE README* $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 01:00:03 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
2015-05-10 20:52:50 +02:00
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-13 01:00:03 +02:00
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|