#!/bin/sh # Ported from Slackware .build # Set initial variables: CWD=`pwd` PKG=/tmp/package-bitchx VERSION=1.1 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64" LIBSUFFIX=64 fi rm -rf $PKG mkdir -p $PKG cd /tmp rm -rf BitchX tar xzvf $CWD/ircii-pana-${VERSION}-final.tar.gz cd BitchX if [ $ARCH = "x86_64" ]; then zcat $CWD/ircii-pana_1.1-1.diff.gz | patch -p1 --verbose || exit 1 # Patch from Debian # I'm sorry - I've tried to find smaller, less intrusive patches for AMD64 support; # there aren't any, and what patches I've tried were fairly large and intrusive anyway. # So it's time to bite the bullet and accept this patch as the only way to get BitchX # to build & run on AMD64. else zcat $CWD/ircii-pana.ncurses.diff.gz | patch -p1 --verbose || exit 1 fi chown -R root.root . find . -perm 775 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; # These are all fixed in 1.1 :-) #zcat $CWD/BitchX-$VERSION.diff.gz | patch -p1 --verbose #zcat $CWD/BitchX.DOS.diff.gz | patch -p1 --verbose #zcat $CWD/1.0c19-evil-server.patch.gz | patch -p1 --verbose # really old options we don't use anymore #./configure --prefix=/usr --enable-sound --enable-cdrom --with-ssl --with-plugins --with-gtk LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --enable-cdrom \ --with-ssl \ --with-plugins \ --enable-ipv6 \ $ARCH-slackware-linux make -j4 make prefix=$PKG/usr libdir=$PKG/usr/lib$LIBSUFFIX install # Inspired by Frugalware chown -R root.root $PKG/usr/bin # Create /usr/bin/BitchX symlink ( cd $PKG/usr/bin ln -sf BitchX-$VERSION-final BitchX ) ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/usr/doc/bitchx-$VERSION cp -a \ README* COMPILE-PROBLEMS INST* IPv6-support doc/* \ $PKG/usr/doc/bitchx-$VERSION chmod 644 $PKG/usr/doc/bitchx-$VERSION/* bzip2 -d $PKG/usr/man/man1/BitchX.1.bz2 gzip -9 $PKG/usr/man/man?/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../bitchx-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf /tmp/BitchX rm -rf $PKG fi