#!/bin/bash # libjpeg.SlackBuild # by Stuart Winter for the Slackware porting Project. # Heavily based on the original Slackware build script. # 14-Jun-2004 # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/l/libjpeg export PORTCWD=$PWD # Package meta-data: export PACKAGE=libjpeg export PKGSERIES=l export ARCH=${ARCH:=$PORTARCH} export VERSION=${VERSION:=6b} export BUILD=${BUILD:=1} # 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 armv3) ARCH_CFLAGS="-O2 -march=armv3 -mtune=xscale" ;; powerpc) ARCH_CFLAGS="-O2" ;; sparc) ARCH_CFLAGS="-O2" ;; *) ARCH_CFLAGS="-O2" ;; esac # Untar source: tar zxvf $CWD/jpegsrc.v${VERSION}.tar.gz cd jpeg* # House keeping: slackhousekeeping # Apply patches: zcat $CWD/jpeg-6b.diff.gz | patch -p0 -E # Make package framework: mkdir -p $PKG/usr/{man/man1,include,bin,lib,doc/$PACKAGE-$VERSION} # Configure & build: ./configure || failconfig make || failmake # Install binaries: install -m755 cjpeg djpeg jpegtran rdjpgcom wrjpgcom \ $PKG/usr/bin # Install man pages: install -m644 cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 \ $PKG/usr/man/man1 # Install libraries: install -m755 libjpeg.so.62.0.0 $PKG/usr/lib install -m644 libjpeg.a $PKG/usr/lib # Install headers: install -m644 jconfig.h jpeglib.h jmorecfg.h jerror.h \ $PKG/usr/include # Install docs: cp -a README *.doc $PKG/usr/doc/$PACKAGE-$VERSION # Enter the package's root: cd $PKG # Slackware policies: slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # set all files to root.root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh # Build the package: if [ $PORTARCH = armv3 ]; then . $PORTCWD/arm/pkger 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