[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | ##################################################################### |
---|
| 4 | # trackbuild.liunxdoc-tools |
---|
| 5 | # by Stuart Winter <mozes@slackware.com> |
---|
| 6 | # Preform a few pre-build requirements then launch the build script |
---|
| 7 | # through slacktrack |
---|
| 8 | # 31-Jul-2009 |
---|
| 9 | ##################################################################### |
---|
| 10 | |
---|
| 11 | # Known build requirements: |
---|
| 12 | # a/unzip for the docbook stuff |
---|
| 13 | # l/libxml2 for /usr/bin/xmlcatalogue |
---|
| 14 | # a/rpm2tgz to unpack some SRPMs |
---|
| 15 | # d/python for AsciiDoc |
---|
| 16 | # l/libxslt |
---|
| 17 | # l/seamonkey-solibs for rpm2cpio |
---|
| 18 | # t/tetex (not required for a bootstrap build, but will be required |
---|
| 19 | # later for a full build of this linuxdoc-tools package). |
---|
| 20 | |
---|
| 21 | # Package info: |
---|
| 22 | PKGNAM=linuxdoc-tools |
---|
| 23 | |
---|
| 24 | # Automatically determine the architecture we're building on: |
---|
| 25 | if [ -z "$ARCH" ]; then |
---|
| 26 | case "$( uname -m )" in |
---|
| 27 | i?86) export ARCH=i586 ;; |
---|
| 28 | armv7hl) export ARCH=armv7hl ;; |
---|
| 29 | arm*) export ARCH=arm ;; |
---|
| 30 | # Unless $ARCH is already set, use uname -m for all other archs: |
---|
| 31 | *) export ARCH=$( uname -m ) ;; |
---|
| 32 | esac |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | export PKGVERSION=0.9.69 # use the version of linuxdoc-tools as the package version. |
---|
| 36 | BUILD=${BUILD:-5} |
---|
| 37 | PKGEXT=${PKGEXT:-txz} |
---|
| 38 | |
---|
| 39 | export CWD=$PWD |
---|
| 40 | export PKGSTORE=/tmp |
---|
| 41 | export TMP=/tmp/build-$PKGNAM/ |
---|
| 42 | rm -rf $TMP |
---|
| 43 | |
---|
| 44 | ####################### Clean up before build ##################### |
---|
| 45 | |
---|
| 46 | # It's best to clear this stuff up prior to the build. |
---|
| 47 | # All of these directories (apart from /usr/share/xml/libglade) are |
---|
| 48 | # created by this build script: |
---|
| 49 | removepkg linuxdoc-tools |
---|
| 50 | rm -rf /etc/{xml,sgml} |
---|
| 51 | rm -rf /usr/share/doc/linuxdoc-tools |
---|
| 52 | rm -rf /usr/share/sgml |
---|
| 53 | rm -rf /usr/share/xml/{docbook,xml-iso-entities*} # can't wipe the entire dir because of libglade |
---|
| 54 | rm -rf ~/.texmf-var/ # created by docbook-utils |
---|
| 55 | rm -rf ~/.texlive* # incase you were using Texlive rather than Textex-3 |
---|
| 56 | |
---|
| 57 | #################################################################### |
---|
| 58 | |
---|
| 59 | ######## WARNING ################################################### |
---|
| 60 | # This will touch nearly every file on your expendable development |
---|
| 61 | # box. You wouldn't try this on a production system, right? |
---|
| 62 | ######## WARNING ################################################### |
---|
| 63 | |
---|
| 64 | # This the faster option, but not the safest. On a full Slackware |
---|
| 65 | # installation, you'll find new files in this directory which have |
---|
| 66 | # been 'touch'ed. The --touch-filesystem-first will not do this, |
---|
| 67 | # but is slower. However, if you really want extra speed, copy |
---|
| 68 | # this entire package source directory to a temporary location |
---|
| 69 | # and run it from there. |
---|
| 70 | # TFS="--touch-filesystem-faster" |
---|
| 71 | |
---|
| 72 | TFS="--touch-filesystem-first" |
---|
| 73 | |
---|
| 74 | # Launch the build script: |
---|
| 75 | slacktrack $TFS \ |
---|
| 76 | --notidy \ |
---|
| 77 | --showdeps \ |
---|
| 78 | -T $TMP \ |
---|
| 79 | -l $CWD/build.$ARCH.log \ |
---|
| 80 | -R $CWD/postbuildfixes.sh \ |
---|
| 81 | -b $PKGSTORE \ |
---|
| 82 | -rYQOcp $PKGNAM-$PKGVERSION-$ARCH-$BUILD.$PKGEXT ./linuxdoc-tools.build || exit 1 |
---|
| 83 | |
---|
| 84 | # Compress build log: |
---|
| 85 | bzip2 -9fvz $CWD/build.$ARCH.log |
---|