#!/bin/bash ## src2pkg script for: src2pkg-helpers ## src2pkg Copyright 2005-2010 Gilbert Ashley SOURCE_NAME='src2pkg-helpers-0.9.tar.bz2' NAME='src2pkg-helpers' VERSION=0.9 # ARCH='i486' BUILD='1' PRE_FIX='usr' # Any extra options go here # EXTRA_CONFIGS='' # STD_FLAGS='-O2 -march=i486 -mtune=i686' TAR_VERSION=1.13 LIBSENTRY_VERSION=0.6.8 COREUTILS_VERSION=5.2.1 UNIONFS_FUSE_VERSION=0.23 # Get the functions and configs . /usr/libexec/src2pkg/FUNCTIONS ; # do_all_processes can substitute these 16 steps: pre_process find_source make_dirs unpack_source fix_source_perms #configure_source #compile_source #fake_install # make the libs echo "Creating libsentry" mkdir -p $PKG_DIR/usr/libexec/src2pkg/lib cd $SRC_DIR/libsentry-$LIBSENTRY_VERSION ; make cp libsentry.so $PKG_DIR/usr/libexec/src2pkg/lib chmod 755 $PKG_DIR/usr/libexec/src2pkg/lib/libsentry.so # make tar echo "Creating tar-1.13" mkdir -p $PKG_DIR/usr/libexec/src2pkg/bin cd $SRC_DIR/tar-$TAR_VERSION ; patch -p1 < ../01B*.diff patch -p1 < ../02B*.diff patch -p1 < ../03B*.diff patch -p1 < ../04B*.diff patch -p1 < ../05B*.diff patch -p1 < ../06B*.diff patch -p0 < ../07B*.diff # skip this patch against config.guess and config.sub # patch -p1 < ../08*.diff patch -p0 < ../09B*.diff patch -p0 < ../10B*.diff if [[ $ARCH = "x86_64" ]] ; then CFLAGS="-O2 -fPIC -static -s" else CFLAGS='-O2' fi CFLAGS="$CFLAGS" ./configure --disable-nls --with-ncursesw --enable-widec make echo ${VERSION} > $PKG_DIR/usr/libexec/src2pkg/bin/version cp src/tar $PKG_DIR/usr/libexec/src2pkg/bin/tar-1.13 chmod 755 $PKG_DIR/usr/libexec/src2pkg/bin/tar-1.13 # make the coreutils echo "Creating coreutils" cd $SRC_DIR/coreutils-$COREUTILS_VERSION ; patch -p1 < ../coreutils-mini.diff patch -p0 < ../coreutils-include-time_h.diff &> /dev/null patch -p0 < ../coreutils-malloc-type.diff &> /dev/null patch -p1 < ../coreutils-strndup.diff &> /dev/null skip() { # prevent aclocal from running find . -name aclocal.m4 -exec touch {} \; # prevent Automake from running find . -name Makefile.in -exec touch {} \; # prevent Autoheader from running # find . -name 'stamp-h?.in' -exec touch {} \; # prevent Autoconf from running find . -name configure -exec touch {} \; } # keep autotools from running touch * ./configure --disable-nls ( cd lib && make ) ( cd $SRC_DIR/coreutils-$COREUTILS_VERSION/src for PROG in cat chmod chown cp ginstall groups link ln mkdir mknod mv readlink rm rmdir stat touch unlink; do make $PROG cp $PROG $PKG_DIR/usr/libexec/src2pkg/bin chmod 755 $PKG_DIR/usr/libexec/src2pkg/bin/$PROG done ) ( cd $PKG_DIR/usr/libexec/src2pkg/bin ; ln -sf ginstall install ) if [[ -f /usr/include/fuse.h ]] ; then if [[ -L /lib/libfuse.so ]] || [[ -L /usr/lib/libfuse.so ]] \ || [[ -L /usr/local/lib/libfuse.so ]] ; then echo "Creating unionfs-fuse" ( cd $SRC_DIR/unionfs-fuse-$UNIONFS_FUSE_VERSION patch -p0 < ../unionfs-fuse-gcc44.diff &> /dev/null make cp $SRC_DIR/unionfs-fuse-$UNIONFS_FUSE_VERSION/src/unionfs $PKG_DIR/usr/libexec/src2pkg/bin chmod 755 $PKG_DIR/usr/libexec/src2pkg/bin/unionfs ) fi else echo "Skipping creation of unionfs-fuse -you don't have fuse installed." fi mkdir -p $DOC_DIR cp $CWD/README $DOC_DIR fix_pkg_perms strip_bins create_docs compress_man_pages make_description make_doinst make_package post_process # src2pkg - Copyright 2005-2010 Gilbert Ashley ## See the documentation for more help and examples. Below are some of # the most common Extras and Options for easy cut-and-paste use. # EXTRA_CONFIGS='' PRE_FIX='' DOCLIST='' # MAKE_COMMAND='' INSTALL_LINE='' # SHELL_INSTALL='YES' CORRECT_PERMS='NO' # When editing src2pkg scripts to add custom code, use these variables # to refer to the current directory, the sources or the package tree: # $CWD (current directory), $SRC_DIR (sources), $PKG_DIR (package tree)