#!/bin/bash # infozip.SlackBuild # by Stuart Winter for the Slackware porting Project. # Heavily based on the original Slackware build script. # 30-May-2004 # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete and re-create temporary directories # Determine the CFLAGS for the known architectures: case $PORTARCH in arm) SLKCFLAGS="-O2 -march=armv3 -mtune=xscale -DACORN_FTYPE_NFS -DFORRISCOS" ;; powerpc) SLKCFLAGS="-O2" ;; sparc) SLKCFLAGS="-O2" ;; *) SLKCFLAGS="-O2" ;; esac ############ Build zip ########################################################### # Extract source: tar jxvvf $CWD/zip*.tar.bz2 cd zip* slackhousekeeping pwd # Grab Zip version from its extracted dir: #ZIPVER=$( ls -d ../zip* | cut -d/ -f2 ) ZIPVER=2.32 # Apply RISC OS filetype patch: bzcat $PORTCWD/sources/acorn-fstypes.patch.bz2 | patch -p1 --verbose || failpatch # Build: make -j4 CC="gcc $SLKCFLAGS" -f unix/Makefile generic || failmake # Install binaries: mkdir -p $PKG/usr/bin install -m755 zipnote zipsplit zipcloak zip $PKG/usr/bin # Install man pages: mkdir -p $PKG/usr/man/man1 install -m644 man/*.1 $PKG/usr/man/man1 # Install docs: mkdir -p $PKG/usr/doc/zip-$ZIPVER cp -fav BUGS CHANGES INSTALL MANUAL README TODO WHATSNEW WHERE \ $PKG/usr/doc/zip-$ZIPVER ############ Build unzip ########################################################### # Extract source: cd $TMPBUILD tar jxvvf $CWD/unzip*.tar.bz2 cd unzip* slackhousekeeping # Grab unzip version number from extracted dir: #UNZIPVER=$( ls -d ../unzip* | cut -d/ -f2 ) UNZIPVER=$VERSION # Build: make -j4 CFLAGS="$SLKCFLAGS -I." -f unix/Makefile LF2="" unzips || failmake # Install binaries: install -m755 unzip unzipsfx funzip unix/zipgrep $PKG/usr/bin ( cd $PKG/usr/bin && ln -sf unzip zipinfo ) # Install man pages: install -m644 man/*.1 $PKG/usr/man/man1 # Install docs: mkdir -p $PKG/usr/doc/unzip-$UNZIPVER cp -a BUGS Contents History.$( echo $UNZIPVER | tr -d .) INSTALL README ToDo WHERE \ $PKG/usr/doc/unzip-$UNZIPVER ##################################################################################### # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links