#!/bin/sh CWD=`pwd` TMP=${TMP:-/tmp} PKG=/tmp/package-zlib VERSION=1.2.3 ARCH=${ARCH:-x86_64} BUILD=1 if [ "$ARCH" = "x86_64" ]; then LIBDIR=lib64 else LIBDIR=lib fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf zlib-$VERSION tar jxvf $CWD/zlib-$VERSION.tar.bz2 cd zlib-$VERSION chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; export CFLAGS="$CFLAGS -fPIC" ./configure \ --prefix=/usr make clean make ./configure \ --prefix=/usr \ --libdir=/usr/$LIBDIR \ --shared make mkdir -p $PKG/usr/include cp -a zlib.h zconf.h $PKG/usr/include chmod 644 $PKG/usr/include/* mkdir -p $PKG/usr/$LIBDIR cp -a libz.a libz.so* $PKG/usr/$LIBDIR chmod 755 $PKG/usr/$LIBDIR/* chmod 644 $PKG/usr/$LIBDIR/libz.a mkdir -p $PKG/usr/man/man3 cat zlib.3 | gzip -9c > $PKG/usr/man/man3/zlib.3.gz ( 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/zlib-$VERSION cp -a \ ChangeLog FAQ INDEX README \ $PKG/usr/doc/zlib-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../zlib-$VERSION-$ARCH-$BUILD.tgz