#!/bin/bash # libxml2.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 24-Jul-2004 # Record toolchain & other info for the build log: slackbuildinfo # Branch version of Python on the system: # e.g. 2.6 , 2.7: PYTHONVER=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.) # 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 # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.?z* cd $PKGNAM-$VERSION || exit 1 slackhousekeeping # Apply patches: zcat $CWD/libxml2.do-not-check-crc.diff.gz | patch -p1 --verbose || exit 1 zcat $CWD/0001-Fix-attribute-decoding-during-XML-schema-validation.diff.gz | patch -p1 --verbose || exit 1 # This is needed after the patch above: #autoreconf || exit 1 # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --build=$ARCH-slackware-linux-gnueabi || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG || failinstall # Install docs: mv $PKG/usr/share/doc $PKG/usr mv $PKG/usr/doc/libxml2-python-$VERSION $PKG/usr/doc/libxml2-$VERSION/ cp -a \ AUTHORS COPYING* INSTALL NEWS README \ $PKG/usr/doc/libxml2-$VERSION # 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 # Be sure to clobber any .pyc files that might have been generated so that # the new .py files will be used instead of the already compiled copies cat << EOF > $PKG/install/doinst.sh rm -f /usr/lib${LIBDIRSUFFIX}/python2.7/site-packages/libxml2.pyc rm -f /usr/lib${LIBDIRSUFFIX}/python2.7/site-packages/drv_libxml2.pyc EOF slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links