smlinux/net/php/smbuild

110 lines
2.8 KiB
Text

# Maintainer: PktSurf <smlinux@pktsurf.in>
app=php
version=7.4.33
rrdversion=2.0.3
build=3sml
homepage="https://www.php.net/"
download="https://www.php.net/distributions/php-$version.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 libwebp rrdtool"
prepbuilddir() {
mkandenterbuilddir
rm -rf $app-$version
tar xf $srcdir/$app-$version.tar.?z*
cd $app-$version
# Add the rrd graph module
(
cd ext
tar xf $srcdir/rrd-$rrdversion.tgz
)
fixbuilddirpermissions
./buildconf -f
}
build() {
./configure \
--prefix=/usr \
--sysconfdir=/etc/php \
--sbindir=/usr/bin \
--localstatedir=/var \
--mandir=/usr/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
cp LICENSE $pkgdocs/
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
(
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/usr/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="
213729a46f12230d24dbff2d99f298559269e1aabae748056d9ae16e8fad6081c86f886678a0d8d851c5109f2d523a9d6b84e57a7ec3b8f8899820d6222f1e4c php-7.4.33.tar.lz
28679ccead54806d1e92accc6f5ebab582a41db802f95797ddb43e3e15690889be3437f22e2a14939d217422ac2700ef90ae0a9b36244ddead3856343b3e09b4 rrd-2.0.3.tgz
"