#!/bin/sh CWD=`pwd` PKG=/tmp/package-pilot-link rm -rf $PKG mkdir -p $PKG VERSION=0.12.2 ARCH=${ARCH:-x86_64} BUILD=${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" = "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" fi cd /tmp rm -rf pilot-link-$VERSION tar xjvf $CWD/pilot-link-$VERSION.tar.bz2 || exit 1 cd pilot-link-$VERSION zcat $CWD/pilot-link.serial.group.is.uucp.diff.gz | patch -p1 --verbose || exit 1 chown -R root:root . find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; sed -i "s#PYTHON_EXEC_PREFIX/lib/#PYTHON_EXEC_PREFIX/lib$LIBSUFFIX/#g" configure CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --localstatedir=/var/lib \ --mandir=/usr/man \ --enable-static=no \ --enable-conduits \ --enable-threads \ --enable-libusb \ --with-libpng \ --with-perl=/usr/lib$LIBSUFFIX/perl5/site_perl/$(perl -v | head -2 | tail -1 | cut -f 2 -d v | cut -f 1 -d' ')/$ARCH-linux-thread-multi \ --with-python \ --program-prefix="" \ --program-suffix="" \ --build=$ARCH-$DISTRO-linux make -j4 || exit 1 make install DESTDIR=$PKG # Right. mkdir -p $PKG/etc/udev/rules.d mv $PKG/usr/share/pilot-link/udev/60-libpisock.rules $PKG/etc/udev/rules.d/80-libpisock.rules rmdir $PKG/usr/share/pilot-link/udev ( 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/pilot-link-$VERSION cp -a \ AUTHORS COPYING COPYING.LIB INSTALL NEWS README \ $PKG/usr/doc/pilot-link-$VERSION 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 /tmp/pilot-link-$VERSION-$PKGARCH-$BUILD.tgz