PKGBUILDs/extra/php/generate_patches

103 lines
2.3 KiB
Text
Raw Normal View History

2020-08-08 18:44:19 +00:00
#!/bin/bash
. PKGBUILD
makepkg -o --nodeps --noprepare --skipinteg
2021-01-29 01:12:46 +00:00
pushd "src/${pkgbase}-${pkgver}"
2020-08-08 18:44:19 +00:00
sed '/APACHE_THREADED_MPM=/d' -i.orig sapi/apache2handler/config.m4
sed 's/.conf.default/.conf/g' -i.orig sapi/fpm/Makefile.frag
sed \
-e 's#run/php-fpm.pid#/run/php-fpm/php-fpm.pid#' \
-e 's#^;error_log =.*#error_log = syslog#' \
-i.orig sapi/fpm/php-fpm.conf.in
sed \
-e 's#^listen =.*#listen = /run/php-fpm/php-fpm.sock#' \
-e 's#^;listen.owner =#listen.owner =#' \
-e 's#^;listen.group =#listen.group =#' \
-e 's#^;chdir =.*#;chdir = /srv/http#' \
-i.orig sapi/fpm/www.conf.in
sed \
-e 's#^PIDFile=.*#PIDFile=/run/php-fpm/php-fpm.pid#' \
-i.orig sapi/fpm/php-fpm.service.in
2021-01-29 01:12:46 +00:00
# available extensions after build
# find /var/lib/archbuild/*-x86_64/*/build/php/src/build/modules -name '*.so' -exec basename {} .so \; | sort -u
availableExtensions=(
bcmath
bz2
calendar
curl
dba
enchant
exif
ffi
ftp
gd
gettext
gmp
iconv
intl
ldap
mysqli
odbc
opcache
pdo_dblib
pdo_mysql
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
pspell
shmop
snmp
soap
sockets
sodium
sqlite3
sysvmsg
sysvsem
sysvshm
tidy
xsl
zip
)
extensions=''
for extension in "${availableExtensions[@]}"; do
if [[ $extension == 'curl' ]]; then
extensions+="extension=${extension}\n"
elif [[ $extension == 'opcache' ]]; then
extensions+=";zend_extension=${extension}\n"
elif [[ $extension == 'zip' ]]; then
extensions+="extension=${extension}\n"
else
extensions+=";extension=${extension}\n"
fi
done
2020-08-08 18:44:19 +00:00
sed \
-r ":a;N;\$!ba;s/; Notes for Windows environments :\n.+;?extension=\w+\n/${extensions}/g" \
-i.orig php.ini-production
sed \
-e 's#^;extension_dir = "\./"$#extension_dir = "/usr/lib/php/modules/"#g' \
-i php.ini-production
diff -u sapi/apache2handler/config.m4.orig sapi/apache2handler/config.m4 | filterdiff --clean --remove-timestamps > ../../apache.patch
2021-01-29 01:12:46 +00:00
{
diff -u sapi/fpm/Makefile.frag.orig sapi/fpm/Makefile.frag
diff -u sapi/fpm/php-fpm.conf.in.orig sapi/fpm/php-fpm.conf.in
diff -u sapi/fpm/www.conf.in.orig sapi/fpm/www.conf.in
diff -u sapi/fpm/php-fpm.service.in.orig sapi/fpm/php-fpm.service.in
} | filterdiff --clean --remove-timestamps > ../../php-fpm.patch
2020-08-08 18:44:19 +00:00
diff -u php.ini-production.orig php.ini-production | filterdiff --clean --remove-timestamps > ../../php.ini.patch
popd