#!/bin/bash # git.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter eval `perl '-V:installsitelib'` PERLDIR=$installsitelib/$ARCH-linux-thread-multi/auto # 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 & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv4 -mtune=xscale" ;; powerpc) export SLKCFLAGS="-O2" ;; sparc) export SLKCFLAGS="-O2" ;; hppa) export SLKCFLAGS="-O2" ;; *) export SLKCFLAGS="-O2" ;; esac # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.bz2 cd $PKGNAM-$VERSION slackhousekeeping # Copy docs: mkdir -pm755 $PKG/usr/doc/$PKGNAM-$VERSION cp -a \ COPYING INSTALL README \ Documentation \ contrib \ $PKG/usr/doc/$PKGNAM-$VERSION ( cd $PKG/usr/doc/$PKGNAM-$VERSION/Documentation ; rm *.1 *.3 *.7 ) # Build: make $NUMJOBS prefix=/usr mandir=/usr/man CFLAGS="$SLKCFLAGS" INSTALLDIRS=vendor all doc || failmake # Install into package: make prefix=/usr mandir=/usr/man "CFLAGS=$SLKCFLAGS" install install-doc INSTALLDIRS=vendor DESTDIR=$PKG || failinstall mv $PKG/usr/share/man/man3 $PKG/usr/man rmdir $PKG/usr/share/man # This removes our DESTDIR from the packlist filenames, to keep perl's # internal inventories consistent and correct. sed -i "s#$PKG##" $PKG/$PERLDIR/Git/.packlist # Replace some binary hardlinks with symlinks: ( cd $PKG/usr/bin find . -links +1 -not -name git | while read gitfile ; do if [ git -ef $gitfile ]; then rm -vf $gitfile ln -vfs git $gitfile fi done ) # This is junk: ( cd $PKG/usr/lib/perl5 && rm -rf 5.* ) # 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