#!/bin/sh CWD=`pwd` TMP=${TMP:-/tmp} PKG=$TMP/package-pcmciautils VERSION=014 ARCH=${ARCH:-i486} BUILD=3 rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf pcmciautils-$VERSION tar xvjf $CWD/pcmciautils-$VERSION.tar.bz2 cd pcmciautils-$VERSION 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 {} \; make || 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 ) # Add some firmware: ( cd $PKG tar xvzf $CWD/cis-cs-3.2.8.tar.gz chown -R root:root lib ) rm -rf $PKG/etc/* mkdir -p $PKG/etc/pcmcia $PKG/etc/rc.d $PKG/etc/udev/rules.d cp -a $CWD/config/rc.pcmcia $PKG/etc/rc.d/rc.pcmcia.new chown root:root $PKG/etc/rc.d/rc.pcmcia.new chmod 755 $PKG/etc/rc.d/rc.pcmcia.new cp -a $CWD/config/config.opts $PKG/etc/pcmcia/config.opts.new chown root:root $PKG/etc/pcmcia/config.opts.new chmod 644 $PKG/etc/pcmcia/config.opts.new cp -a $CWD/config/60-pcmcia.rules $PKG/etc/udev/rules.d/60-pcmcia.rules.new chown root:root $PKG/etc/udev/rules.d/60-pcmcia.rules.new chmod 644 $PKG/etc/udev/rules.d/60-pcmcia.rules.new mv $PKG/usr/share/man $PKG/usr rmdir $PKG/usr/share # Compress and if needed symlink the man pages: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.? ) done ) fi mkdir -p $PKG/usr/doc/pcmciautils-$VERSION cp COPYING $PKG/usr/doc/pcmciautils-$VERSION mkdir $PKG/install cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../pcmciautils-$VERSION-$ARCH-$BUILD.tgz