#!/bin/bash ## src2pkg-helpers-sources.build ## Gilbert Ashley ## This script assembles the sources for the various ## libraries and binaries needed by src2pkg into one ## src2pkg-helpers-x.x.tar.bz2 archive. ## The combined archive contains the sources for ## libsentry, tar-1.13 and coreutils and unionfs-fuse ## Some extraneous material is removed from the original ## archives by this script, to save space in the archive. # Everything is done locally for this build, as it is really # only of use to me for preparing the archive which gets # included in the src2pkg package. SRC_PKG_HELPERS_VERSION=0.9 TAR_VERSION=1.13 LIBSENTRY_VERSION=0.6.8 COREUTILS_VERSION=5.2.1 UNIONFS_FUSE_VERSION=0.23 CWD=$(pwd) # remove stale working directory if present [[ -d src2pkg-helpers-$SRC_PKG_HELPERS_VERSION ]] && echo "Removing existing build directory" && rm -rf src2pkg-helpers-$SRC_PKG_HELPERS_VERSION # create a fresh directory to work in mkdir -p src2pkg-helpers-$SRC_PKG_HELPERS_VERSION # remove stale archive if present [[ -f src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 ]] && echo "Removing existing archive" && rm -rf src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 [[ -f ../src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 ]] && echo "Removing existing archive" && rm -rf ../src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 cd src2pkg-helpers-$SRC_PKG_HELPERS_VERSION ; echo "Unpacking coreutils" tar xjf $CWD/coreutils-$COREUTILS_VERSION.tar.bz2 echo "Unpacking libsentry" tar xjf $CWD/libsentry-$LIBSENTRY_VERSION.tar.bz2 echo "Unpacking tar-1.13" tar xjf $CWD/tar-$TAR_VERSION.tar.bz2 echo "Unpacking unionfs-fuse" tar xjf $CWD/unionfs-fuse-$UNIONFS_FUSE_VERSION.tar.bz2 # remove a bunch of extra files we don't need from coreutils echo "Removing 20MB of cruft files from coreutils" ( cd coreutils-$COREUTILS_VERSION ; rm -rf doc man old po tests ) # this patch only patches the toplevel config files so that the build # doesn't try to build the directories moved above. echo "Patching coreutils sources" patch -p0 < $CWD/coreutils-mini-source.diff # the configure script must be regenerated after the above patch ( echo "Reconfiguring coreutils" cd coreutils-$COREUTILS_VERSION rm -f configure #autoreconf -if autoconf rm -rf autom4te.cache ) # note that when the src2pkg-helpers archive gets built, # another patch is applied which disables compiling # most the individual binaries in the coreutils sources # That is kept in a separate pacth because the list # of unused programs could change in the future cd $CWD ; # copy all the patches except the coreutils-mini-source.diff used above cp *.diff src2pkg-helpers-$SRC_PKG_HELPERS_VERSION # remove this one rm -f src2pkg-helpers-$SRC_PKG_HELPERS_VERSION/coreutils-mini-source.diff cat README > src2pkg-helpers-$SRC_PKG_HELPERS_VERSION/README cat ChangeLog > src2pkg-helpers-$SRC_PKG_HELPERS_VERSION/ChangeLog # create our final source archive echo "Creating tar archive of src2pkg-helpers-$SRC_PKG_HELPERS_VERSION" tar -cf src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar src2pkg-helpers-$SRC_PKG_HELPERS_VERSION echo "Creating src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2" bzip2 src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar # remove temporary working directory if present [[ -d src2pkg-helpers-$SRC_PKG_HELPERS_VERSION ]] && echo "Removing existing build directory" && rm -rf src2pkg-helpers-$SRC_PKG_HELPERS_VERSION # move the finished archive up one level mv src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 ../src2pkg-helpers-$SRC_PKG_HELPERS_VERSION.tar.bz2 echo "Done"