#!/bin/bash # variables TAG=gwh OUTPUT=/tmp TMP=/tmp/$TAG CWD=$(pwd) PRGNAM=$(basename $CWD) PKG=$TMP/pkg-$PRGNAM GITHUB_REPO=krakjoe/apcu VERSION=${VERSION:-latest} EXT=tar.gz DOCS="CHANGELOG INSTALL LICENSE NOTICE README.md TECHNOTES.txt TODO" ARCH=$(uname -m) BUILD=1 REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM PREFIX=/usr SLCKFLAGS="-fPIC -O2" # nettoyage préalable rm -fr $PKG $TMP/$PRGNAM mkdir -p $PKG # mise en place [ ! -e $REPOSITORY ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORY cd $REPOSITORY git pull --all cp -R $REPOSITORY $PRGNAM cd $PRGNAM [ "x$VERSION" == "xlatest" ] && VERSION=$(git tag --sort=-version:refname | head -n1) [ "x$VERSION" == "x" ] && VERSION=trunk [ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION # configuration phpize CFLAGS=$SLCKFLAGS \ CPPFLAGS=$SLCKFLAGS \ ./configure \ --enable-static=no \ --enable-shared=yes \ --enable-apcu \ --disable-valgrind-checks \ --host=$ARCH-slackware-linux \ --build=$ARCH-slackware-linux \ --prefix=$PREFIX \ --mandir=$PREFIX/man \ --libdir=$PREFIX/lib$( [ $ARCH = "x86_64" ] && echo 64 ) # compilation make -j3 prefix=$PREFIX # installation make install INSTALL_ROOT=$PKG # correction cd $PKG chown -R root:root * mkdir -p $PKG/usr/doc/$PRGNAM cd $TMP/$PRGNAM cp -R $DOCS $PKG/usr/doc/$PRGNAM # embaumement mkdir -p $PKG/install cat < $PKG/install/slack-desc $PRGNAM: $PRGNAM (APC User Cache) $PRGNAM: $PRGNAM: APCu is userland caching: APC stripped of opcode caching in preparation for the $PRGNAM: deployment of Zend Optimizer+ as the primary solution to opcode caching in $PRGNAM: future versions of PHP. $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: https://github.com/${GITHUB_REPO} $PRGNAM: EOF # empaquetage cd $PKG rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la /sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz