#!/bin/sh -x # variables TAG=cyco OUTPUT=/tmp TMP=/tmp/$TAG CWD=$(pwd) PRGNAM=$(basename $CWD) PKG=$TMP/pkg-$PRGNAM VERSION=$(date +%Y.%m.%d_%H.%M) EXT=tar.gz DOCS="COPYING CREDITS README.markdown" ARCH=$(uname -m) BUILD=1 REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM PREFIX=/usr SLCKFLAGS="-fPIC -O2" # nettoyage préalable rm -fr $PKG $TMP/$PRGNAM-$VERSION mkdir -p $PKG # mise en place cd $TMP if [ -e $REPOSITORY ]; then ( cd $REPOSITORY git pull ) else git clone https://github.com/phpredis/phpredis.git $REPOSITORY fi cp -R $REPOSITORY $PRGNAM-$VERSION cd $PRGNAM-$VERSION # configuration phpize CFLAGS=$SLCKFLAGS \ CPPFLAGS=$SLCKFLAGS \ ./configure \ --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-$VERSION cd $TMP/$PRGNAM-$VERSION cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION # embaumement mkdir -p $PKG/install cat < $PKG/install/slack-desc $PRGNAM: $PRGNAM ( A PHP extension for Redis) $PRGNAM: $PRGNAM: The phpredis extension provides an API for communicating with the Redis $PRGNAM: key-value store. It is released under the PHP License, version 3.01. $PRGNAM: This code has been developed and maintained by Owlient from November 2009 to March 2011. $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: https://github.com/phpredis/phpredis $PRGNAM: EOF # empaquetage cd $PKG makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz