#!/bin/bash # freetype.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 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 CWD=$SLACKSOURCE/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv5te" export LIBDIRSUFFIX="" ;; *) export SLKCFLAGS="-O2" ;; esac # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.xz cd $PKGNAM-$VERSION || exit 1 slackhousekeeping # This breaks far too many things. Freetype2 developers will have to get their # punishment on someone else's distribution. zcat $CWD/freetype.illadvisederror.diff.gz | patch -p1 --verbose || exit 1 # Configure: CFLAGS="$SLKCFLAGS" make setup CFG="--prefix=/usr --build=$ARCH-slackware-linux-gnueabi" # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Can't imagine a lot of use for this: rm -fv $PKG/usr/lib/*.a # This shouldn't be needed (apps should pick up -I/usr/include/freetype2 from # `freetype-config --cflags` while compiling), but it's so often reported as # a bug that I'll give in to the point. Now that Freetype1 is pretty much gone # having this link shouldn't hurt anything. Try not to rely on it, though. mkdir -vpm755 $PKG/usr/include ( cd $PKG/usr/include rm -rf freetype ln -vsf freetype2 freetype ) # Install docs: mkdir -vpm755 $PKG/usr/doc/$PKGNAM-$VERSION cp -favv docs README \ $PKG/usr/doc/$PKGNAM-$VERSION rm -rf $PKG/usr/doc/freetype-$VERSION/docs/reference # Move man pages in to Slackware location: mv -fv $PKG/usr/share/man $PKG/usr/ # 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