php81: Add README, lint the build script

This commit is contained in:
Eugen Wissner 2022-12-01 18:11:08 +01:00
parent 539a78dba9
commit 0afceb6e89
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
2 changed files with 32 additions and 46 deletions

7
private/php81/README Normal file
View File

@ -0,0 +1,7 @@
PHP is an HTML-embedded scripting language. It shares syntax
characteristics with C, Java, and Perl. The primary objective behind
this language is to make a fast and easy-to-use scripting language for
dynamic web sites.
This installation is compatible with the official php package and
doesn't overwrit any stock files.

71
private/php81/php81.SlackBuild Executable file → Normal file
View File

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
# Build and package mod_php on Slackware. # Build and package PHP FPM 8.1
# Copyright 2022 Eugene Wissner, Germany, Dachau
#
# by: David Cantrell <david@slackware.com> # by: David Cantrell <david@slackware.com>
# Modified for PHP 4-5 by volkerdi@slackware.com # Modified for PHP 4-5 by volkerdi@slackware.com
# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2017, 2019, 2020, 2021 Patrick Volkerding, Sebeka, MN, USA # Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2017, 2019, 2020, 2021 Patrick Volkerding, Sebeka, MN, USA
@ -28,17 +30,15 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=php81 PRGNAM=php81
VERSION=${VERSION:-8.1.13} VERSION=${VERSION:-8.1.13}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dlack} TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz} PKGTYPE=${PKGTYPE:-tgz}
VERSION_SUFFIX=8.1 VERSION_SUFFIX=8.1
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
case "$( uname -m )" in case "$( uname -m )" in
i?86) ARCH=i586 ;; i?86) ARCH=i586 ;;
arm*) ARCH=arm ;; arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;; *) ARCH=$( uname -m ) ;;
esac esac
fi fi
@ -55,9 +55,6 @@ TMP=${TMP:-/tmp}
PKG=$TMP/package-$PRGNAM PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp} OUTPUT=${OUTPUT:-/tmp}
rm -rf $PKG
mkdir -p $TMP $PKG
if [ "$ARCH" = "i586" ]; then if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686" SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX="" LIBDIRSUFFIX=""
@ -72,31 +69,25 @@ else
LIBDIRSUFFIX="" LIBDIRSUFFIX=""
fi fi
set -e # Exit on most errors set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP cd $TMP
rm -rf php-$VERSION rm -rf php-$VERSION
tar xvf $CWD/php-$VERSION.tar.xz tar xvf $CWD/php-$VERSION.tar.xz
cd php-$VERSION cd php-$VERSION
# cleanup:
find . -name "*.orig" -delete
# Fixup perms/owners:
chown -R root:root . chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
find . -name "*.h" -exec chmod 644 {} \+
# Sometimes they ship a few of these: # Sometimes they ship a few of these:
find . -name "*.orig" -exec rm {} \+ find . -name "*.orig" -delete
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Install the build folder into /usr/lib$LIBDIRSUFFIX/php/build
# and adapt phpize accordingly:
sed -i "s|build$|php/${VERSION_SUFFIX}/build|" scripts/Makefile.frag sed -i "s|build$|php/${VERSION_SUFFIX}/build|" scripts/Makefile.frag
sed -i "s|build\"$|php/${VERSION_SUFFIX}/build\"|" scripts/phpize.in sed -i "s|build\"$|php/${VERSION_SUFFIX}/build\"|" scripts/phpize.in
@ -201,38 +192,26 @@ mkdir -p $PKG/etc/rc.d
cp sapi/fpm/init.d.php-fpm $PKG/etc/rc.d/rc.php-fpm-${VERSION_SUFFIX}.new cp sapi/fpm/init.d.php-fpm $PKG/etc/rc.d/rc.php-fpm-${VERSION_SUFFIX}.new
chmod 644 $PKG/etc/rc.d/rc.php-fpm-${VERSION_SUFFIX}.new chmod 644 $PKG/etc/rc.d/rc.php-fpm-${VERSION_SUFFIX}.new
# Strip ELF objects.
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
# PHP sometimes puts junk in the root directory: # PHP sometimes puts junk in the root directory:
( cd $PKG ( cd $PKG
rm -rf .channels .depdb .depdblock .filemap .lock .registry rm -rf .channels .depdb .depdblock .filemap .lock .registry
) )
# We do not package static extension libraries: rm -r $PKG/usr/share/fpm $PKG/usr/bin/pear $PKG/usr/bin/peardev
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/php/extensions/*.a
rm -rf $PKG/usr/share/fpm $PKG/usr/bin/pear $PKG/usr/bin/peardev
mv $PKG/usr/bin/pecl $PKG/usr/bin/pecl-${VERSION_SUFFIX} mv $PKG/usr/bin/pecl $PKG/usr/bin/pecl-${VERSION_SUFFIX}
# Fix $PKG/usr/lib/php perms: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
( cd $PKG/usr/lib${LIBDIRSUFFIX}/php
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
)
mkdir -p $PKG/usr/doc/php-$VERSION
cp -a \ cp -a \
CODING_STANDARDS* CONTRIBUTING* EXTENSIONS* LICENSE* NEWS* README* UPGRADING* \ CODING_STANDARDS* CONTRIBUTING* EXTENSIONS* LICENSE* NEWS* README* UPGRADING* \
$PKG/usr/doc/php-$VERSION $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
chown root:root $PKG/etc/*
# Strip ELF objects.
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
gzip -9 $PKG/usr/man/man?/*.?
mkdir -p $PKG/install mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/install/slack-desc