slackbuilds/l/phpredis/SlackBuild

84 lines
1.7 KiB
Text
Raw Normal View History

#!/bin/sh
2015-10-20 16:37:37 +02:00
# variables
2020-06-25 11:23:11 +02:00
TAG=gwh
2015-10-20 16:37:37 +02:00
OUTPUT=/tmp
TMP=/tmp/$TAG
CWD=$(pwd)
2015-10-21 09:01:47 +02:00
PRGNAM=$(basename $CWD)
2015-10-20 16:37:37 +02:00
PKG=$TMP/pkg-$PRGNAM
VERSION=$(date +%Y.%m.%d_%H.%M)
EXT=tar.gz
2015-10-21 08:49:54 +02:00
DOCS="COPYING CREDITS README.markdown"
2015-10-20 16:37:37 +02:00
ARCH=$(uname -m)
BUILD=1
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
PREFIX=/usr
SLCKFLAGS="-fPIC -O2"
# nettoyage pr<70>alable
rm -fr $PKG $TMP/$PRGNAM
2015-10-20 16:37:37 +02:00
mkdir -p $PKG
# mise en place
[ ! -e $REPOSITORY ] && git clone https://github.com/phpredis/phpredis.git $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
cp -R $REPOSITORY $PRGNAM
cd $PRGNAM
2015-10-20 16:37:37 +02:00
# configuration
phpize
CFLAGS=$SLCKFLAGS \
CPPFLAGS=$SLCKFLAGS \
./configure \
--prefix=$PREFIX \
--mandir=$PREFIX/man \
--libdir=$PREFIX/lib$( [ $ARCH = "x86_64" ] && echo 64 )
# compilation
2015-10-21 08:49:54 +02:00
make -j3 prefix=$PREFIX
2015-10-20 16:37:37 +02:00
# installation
2015-10-21 08:49:54 +02:00
make install INSTALL_ROOT=$PKG
2015-10-20 16:37:37 +02:00
# correction
cd $PKG
chown -R root:root *
mkdir -p $PKG/usr/doc/$PRGNAM
cd $TMP/$PRGNAM
cp -R $DOCS $PKG/usr/doc/$PRGNAM
2015-10-20 16:37:37 +02:00
# embaumement
mkdir -p $PKG/install
cat <<EOF > $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
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
2015-10-20 16:37:37 +02:00
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz