#!/bin/sh PKGNAM=glib2-32 VERSION=2.12.12 ARCH=${ARCH:-x86_64} BUILD=1 DISTRO=${DISTRO:-slamd64} if [ $DISTRO = slackware ]; then PKGARCH=$ARCH else PKGARCH=${ARCH}_${DISTRO} fi if [ $DISTRO = slamd64 ]; then LIBSUFFIX=64 SLKLDFLAGS="-L/usr/lib64" else LIBSUFFIX= SLKLDFLAGS= fi if [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC -m32" fi CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-$PKGNAM rm -rf $PKG mkdir -p $PKG/usr cd $TMP rm -rf glib-$VERSION tar xjvf $CWD/glib-$VERSION.tar.bz2 || exit 1 cd glib-$VERSION chown -R root:root . find . -perm 664 -exec chmod 644 {} \; CC="gcc -m32" \ CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/man \ --host="i686-pc-linux-gnu" make -j4 || exit 1 make install DESTDIR=$PKG ( 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 ) rm -rf $PKG/usr/share rm -rf $PKG/usr/include rm -rf $PKG/usr/bin rm -rf $PKG/usr/man mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $TMP/package-$PKGNAM makepkg -l y -c n ../$PKGNAM-$VERSION-$PKGARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/${PKGNAM}-$VERSION rm -rf $PKG fi