2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
# variables
|
2020-06-25 11:23:11 +02:00
|
|
|
TAG=gwh
|
2015-10-21 08:59:33 +02:00
|
|
|
OUTPUT=/tmp
|
|
|
|
TMP=/tmp/$TAG
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
|
2021-09-23 15:52:55 +02:00
|
|
|
GITHUB_REPO=krakjoe/apcu
|
2022-01-22 10:52:07 +01:00
|
|
|
VERSION=${VERSION:-latest}
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
EXT=tar.gz
|
|
|
|
|
|
|
|
DOCS="CHANGELOG INSTALL LICENSE NOTICE README.md TECHNOTES.txt TODO"
|
|
|
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
BUILD=1
|
|
|
|
|
2022-01-22 19:52:02 +01:00
|
|
|
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
SLCKFLAGS="-fPIC -O2"
|
|
|
|
|
|
|
|
# nettoyage préalable
|
2016-09-18 22:28:40 +02:00
|
|
|
rm -fr $PKG $TMP/$PRGNAM
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
# mise en place
|
2021-09-23 15:52:55 +02:00
|
|
|
[ ! -e $REPOSITORY ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORY
|
2021-06-15 10:59:49 +02:00
|
|
|
cd $REPOSITORY
|
|
|
|
git pull --all
|
2016-09-18 22:28:40 +02:00
|
|
|
|
|
|
|
cp -R $REPOSITORY $PRGNAM
|
|
|
|
cd $PRGNAM
|
2024-01-11 14:48:15 +01:00
|
|
|
[ "x$VERSION" == "xlatest" ] && VERSION=$(git tag --sort=-taggerdate | head -n1)
|
2022-01-22 10:52:07 +01:00
|
|
|
[ "x$VERSION" == "x" ] && VERSION=trunk
|
2023-03-23 09:54:21 +01:00
|
|
|
[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
# 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 *
|
|
|
|
|
2016-09-18 22:28:40 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM
|
|
|
|
cd $TMP/$PRGNAM
|
|
|
|
cp -R $DOCS $PKG/usr/doc/$PRGNAM
|
2015-10-21 08:59:33 +02:00
|
|
|
|
|
|
|
# embaumement
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat <<EOF > $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:
|
2021-09-23 15:52:55 +02:00
|
|
|
$PRGNAM: https://github.com/${GITHUB_REPO}
|
2015-10-21 08:59:33 +02:00
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# empaquetage
|
|
|
|
cd $PKG
|
2018-04-20 23:02:35 +02:00
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|