From 0afceb6e89199330f6863fa3a9f2daa5da8e1e11 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 1 Dec 2022 18:11:08 +0100 Subject: [PATCH] php81: Add README, lint the build script --- private/php81/README | 7 ++++ private/php81/php81.SlackBuild | 71 ++++++++++++---------------------- 2 files changed, 32 insertions(+), 46 deletions(-) create mode 100644 private/php81/README mode change 100755 => 100644 private/php81/php81.SlackBuild diff --git a/private/php81/README b/private/php81/README new file mode 100644 index 0000000..d4ff3a4 --- /dev/null +++ b/private/php81/README @@ -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. diff --git a/private/php81/php81.SlackBuild b/private/php81/php81.SlackBuild old mode 100755 new mode 100644 index b0fd594..42e197a --- a/private/php81/php81.SlackBuild +++ b/private/php81/php81.SlackBuild @@ -1,6 +1,8 @@ #!/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 # 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 @@ -28,17 +30,15 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=php81 VERSION=${VERSION:-8.1.13} BUILD=${BUILD:-1} -TAG=${TAG:-_dlack} +TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} VERSION_SUFFIX=8.1 -# Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi @@ -55,9 +55,6 @@ TMP=${TMP:-/tmp} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -rm -rf $PKG -mkdir -p $TMP $PKG - if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -72,31 +69,25 @@ else LIBDIRSUFFIX="" fi -set -e # Exit on most errors +set -e +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf php-$VERSION tar xvf $CWD/php-$VERSION.tar.xz cd php-$VERSION - -# cleanup: -find . -name "*.orig" -delete - -# Fixup perms/owners: 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: -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/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 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: ( cd $PKG rm -rf .channels .depdb .depdblock .filemap .lock .registry ) -# We do not package static extension libraries: -rm -f $PKG/usr/lib${LIBDIRSUFFIX}/php/extensions/*.a - -rm -rf $PKG/usr/share/fpm $PKG/usr/bin/pear $PKG/usr/bin/peardev +rm -r $PKG/usr/share/fpm $PKG/usr/bin/pear $PKG/usr/bin/peardev mv $PKG/usr/bin/pecl $PKG/usr/bin/pecl-${VERSION_SUFFIX} -# Fix $PKG/usr/lib/php perms: -( 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 +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ CODING_STANDARDS* CONTRIBUTING* EXTENSIONS* LICENSE* NEWS* README* UPGRADING* \ - $PKG/usr/doc/php-$VERSION - -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?/*.? + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc