smlinux/net/php/php.SMBuild
2022-02-20 14:18:17 +05:30

107 lines
2.9 KiB
Text
Executable file

app=php
version=7.4.26
rrdversion=2.0.3
build=2sml
homepage="https://www.php.net/"
download="https://www.php.net/distributions/php-7.4.26.tar.xz"
desc="Scripting language suited for creating dynamic websites"
requires="enchant libgd db gmp icu libsodium libxslt sqlite curl libtool pcre2 postfix aspell openssl oniguruma libffi bzip2 zlib libexif intltool readline libsodium mariadb libwebp"
build() {
mkandenterbuilddir
rm -rf $app-$version
tar xf $srcdir/$app-$version.tar.?z*
cd $app-$version
fixbuilddirpermissions
# Add the rrd graph module
cd ext
tar xf $srcdir/rrd-$rrdversion.tgz
cd ..
./buildconf -f
patch -p1 < $srcdir/cve-2021-21708.patch
./configure \
--prefix="" \
--sysconfdir=/etc/php \
--sbindir=/bin \
--localstatedir=/var \
--mandir=/share/man \
--enable-fpm \
--with-fpm-user=nobody \
--with-fpm-group=nogroup \
--with-layout=PHP \
--with-config-file-scan-dir=/etc/php \
--with-config-file-path=/etc/php/conf.d \
--enable-filter \
--enable-mbstring \
--enable-pcntl \
--with-libxml \
--with-expat \
--with-jpeg \
--with-xpm \
--with-bz2=shared \
--enable-calendar=shared \
--with-ffi=shared \
--with-openssl=shared \
--with-external-pcre \
--with-zlib=shared \
--with-sqlite3=shared \
--with-enchant=shared \
--with-gmp=shared \
--with-gettext=shared \
--with-webp \
--enable-exif=shared \
--enable-intl=shared \
--enable-gd=shared \
--with-tsrm-pthreads \
--with-sodium=shared \
--with-readline \
--enable-static=no \
--enable-shared=yes \
--with-pic \
--enable-sockets \
--enable-opcache \
--with-imap-ssl \
--disable-rpath \
--with-pdo-sqlite=shared \
--with-rrd=shared
make
make install INSTALL_ROOT=$pkg
install -Dm 644 sapi/fpm/init.d.php-fpm $pkg/etc/rc.d/rc.php-fpm.new
install -Dm 644 $srcdir/php.ini $pkg/etc/php/php.ini.new
# We do not package static extension libraries:
rm -fv $pkg/lib/php/extensions/*.a $pkg/lib/php/extensions/*/*.a
(
cd $pkg/etc/php
mv php-fpm.conf.default php-fpm.conf.default.new
cd php-fpm.d ; mv www.conf.default www.conf.default.new
)
# Session directory for PHP:
mkdir -p $pkg/var/lib/php
chmod 770 $pkg/var/lib/php
chown root:www-data $pkg/var/lib/php
# PHP sometimes puts junk in the root directory:
( cd $pkg/lib/php
rm -rfv .channels .depdb .depdblock .filemap .lock .registry
cd $pkg
rm -rfv .channels .depdb .depdblock .filemap .lock .registry
rm -rfv $pkg/php
)
mkfinalpkg
}
sha512sums="
36cd493c9c95aabb1ee47e82cb0c20b2be99fe7ebd98743355139064590d0b9a1746d71e31dd47f164df34ebe3f8366a75f3efc149262e1391b43d83d3045c6e php-7.4.26.tar.xz
28679ccead54806d1e92accc6f5ebab582a41db802f95797ddb43e3e15690889be3437f22e2a14939d217422ac2700ef90ae0a9b36244ddead3856343b3e09b4 rrd-2.0.3.tgz
"