##!/bin/bash # cdrtools.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 26-Aug-2004 # This may need an update at some stage, so don't forget! ZISOFSTOOLS=1.0.6 # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/ap/cdrtools export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PACKAGE export PKG=$TMP/package-$PACKAGE mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $PORTARCH in arm) export SLKCFLAGS="-O2 -march=armv3 -mtune=xscale" ;; powerpc) export SLKCFLAGS="-O2" ;; sparc) export SLKCFLAGS="-O2" ;; esac ### Build cdrtools ######################################## # Extract source: tar jxvf $CWD/$PACKAGE-$VERSION.tar.bz2 cd $PACKAGE-$VERSION slackhousekeeping # Fix install location: sed -i 's?INS_BASE=.*?INS_BASE=\t'"$PKG/usr"'?' DEFAULTS/Defaults.linux mkdir -pm755 $PKG/usr # Let it know about our later ARM systems. # This schilly build system is quite adaptable -- I wish GNU'd thought of something # like this instead of autoconf. ( cd RULES ln -vfs i586-linux-cc.rul armv5l-linux-cc.rul ln -vfs i586-linux-gcc.rul armv5l-linux-gcc.rul ) # Build & install into package: make install || failmake ( cd $PKG/usr/bin ; ln -vsf mkisofs mkhybrid ) # Install docs (removed a number of hardlinks that exist in the Slackware package; they # were an oversight anyway): mkdir -p $PKG/usr/doc/$PACKAGE-$VERSION/{mkisofs,cdda2wav} cp -a AN-* COPYING INSTALL README* \ $PKG/usr/doc/$PACKAGE-$VERSION rm -f $PKG/usr/doc/$PACKAGE-$VERSION/README.compile # this is hardlinked of INSTALL ( cd mkisofs cp -a COPYING ChangeLog README* TODO \ $PKG/usr/doc/$PACKAGE-$VERSION/mkisofs ) ( cd cdda2wav cp -a FAQ Frontends GPL HOWTOUSE NEEDED OtherProgs README THANKS TODO Changelog \ $PKG/usr/doc/$PACKAGE-$VERSION/cdda2wav ) # Delete junk: rm -rf $PKG/usr/{lib,sbin,include,man/man5,man/man1/cdda2ogg.1,doc/cdrtools-$VERSION/README.rscsi} ### Build mkisofs with Acorn file type support ################################ # I could include the RISC OS patch with the main version but I'd rather keep # it separate. # Apply the RISC OS file type patch: bzcat $PORTCWD/sources/acorn-filetypes-cdrtools-2.0.1.patch.bz2 | patch -p1 --verbose || failpatch # Build: make || failmake cd mkisofs make || failmake # Install into package: install -vm755 OBJ/*/mkisofs $PKG/usr/bin/mkisofs-riscos #install -vm644 mkisofs.8 $PKG/usr/man/man8/mkisofs-riscos.8 # Yeah I know it's a bit lame doing this but ... I just don't care :) sed 's?mkisofs?mkisofs-riscos?g' mkisofs.8 > $PKG/usr/man/man8/mkisofs-riscos.8 ### Add the mkzftree tool for zisofs ######################################## # Extract source: cd $TMPBUILD tar jxvf $CWD/zisofs-tools-$ZISOFSTOOLS.tar.bz2 cd zisofs-tools-$ZISOFSTOOLS slackhousekeeping # Build: ./configure \ --prefix=/usr || failconfig make || failmake # Install: install -m755 mkzftree $PKG/usr/bin install -m644 mkzftree.1 $PKG/usr/man/man1 # Install docs: mkdir -p $PKG/usr/doc/zisofs-tools-$ZISOFSTOOLS cp -a CHANGES COPYING INSTALL README zisofs.magic \ $PKG/usr/doc/zisofs-tools-$ZISOFSTOOLS ############################################################################## # 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 # Build the package: if [ $PORTARCH = arm ]; then slackmp # run makepkg else makepkg -l y -c n $PKGSTORE/$PKGSERIES/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links