db-move: moved webkitgtk-6.0 from [testing] to [extra] (x86_64)
[arch-packages.git] / php-legacy / trunk / generate_patches
blob293bd046d40226bc571fcb3aa13c75f5760049f1
1 #!/bin/bash
3 . PKGBUILD
5 makepkg -o --nodeps --noprepare --skipinteg
7 pushd "src/php-${pkgver}"
9 sed '/APACHE_THREADED_MPM=/d' -i.orig sapi/apache2handler/config.m4
11 sed 's/.conf.default/.conf/g' -i.orig sapi/fpm/Makefile.frag
13 sed \
14 -e 's#run/php-fpm.pid#/run/php-fpm-legacy/php-fpm.pid#' \
15 -e 's#^;error_log =.*#error_log = syslog#' \
16 -i.orig sapi/fpm/php-fpm.conf.in
18 sed \
19 -e 's#^listen =.*#listen = /run/php-fpm-legacy/php-fpm.sock#' \
20 -e 's#^;listen.owner =#listen.owner =#' \
21 -e 's#^;listen.group =#listen.group =#' \
22 -e 's#^;chdir =.*#;chdir = /srv/http#' \
23 -i.orig sapi/fpm/www.conf.in
25 sed \
26 -e 's#^PIDFile=.*#PIDFile=/run/php-fpm-legacy/php-fpm.pid#' \
27 -e 's#^ExecStart=@EXPANDED_SBINDIR@/php-fpm#ExecStart=@EXPANDED_SBINDIR@/php-fpm-legacy#' \
28 -i.orig sapi/fpm/php-fpm.service.in
30 # available extensions after build
31 # find /var/lib/archbuild/*-x86_64/*/build/php/src/build/modules -name '*.so' -exec basename {} .so \; | sort -u
32 availableExtensions=(
33 bcmath
34 bz2
35 calendar
36 curl
37 dba
38 enchant
39 exif
40 ffi
41 ftp
43 gettext
44 gmp
45 iconv
46 intl
47 ldap
48 mysqli
49 odbc
50 opcache
51 pdo_dblib
52 pdo_mysql
53 pdo_odbc
54 pdo_pgsql
55 pdo_sqlite
56 pgsql
57 pspell
58 shmop
59 snmp
60 soap
61 sockets
62 sodium
63 sqlite3
64 sysvmsg
65 sysvsem
66 sysvshm
67 tidy
68 xsl
69 zip
72 extensions=''
73 for extension in "${availableExtensions[@]}"; do
74 if [[ $extension == 'curl' ]]; then
75 extensions+="extension=${extension}\n"
76 elif [[ $extension == 'opcache' ]]; then
77 extensions+=";zend_extension=${extension}\n"
78 elif [[ $extension == 'zip' ]]; then
79 extensions+="extension=${extension}\n"
80 else
81 extensions+=";extension=${extension}\n"
83 done
85 sed \
86 -r ":a;N;\$!ba;s/; Notes for Windows environments :\n.+;?extension=\w+\n/${extensions}/g" \
87 -i.orig php.ini-production
88 sed \
89 -e 's#^;extension_dir = "\./"$#extension_dir = "/usr/lib/php-legacy/modules/"#g' \
90 -i php.ini-production
92 diff -u sapi/apache2handler/config.m4.orig sapi/apache2handler/config.m4 | filterdiff --clean --remove-timestamps > ../../apache.patch
95 diff -u sapi/fpm/Makefile.frag.orig sapi/fpm/Makefile.frag
96 diff -u sapi/fpm/php-fpm.conf.in.orig sapi/fpm/php-fpm.conf.in
97 diff -u sapi/fpm/www.conf.in.orig sapi/fpm/www.conf.in
98 diff -u sapi/fpm/php-fpm.service.in.orig sapi/fpm/php-fpm.service.in
99 } | filterdiff --clean --remove-timestamps > ../../php-fpm.patch
101 diff -u php.ini-production.orig php.ini-production | filterdiff --clean --remove-timestamps > ../../php.ini.patch
103 sed -i.orig 's/ \[php-config\],/ [php-config-legacy],/g' scripts/phpize.m4
104 diff -u scripts/phpize.m4.orig scripts/phpize.m4 | filterdiff --clean --remove-timestamps > ../../php-legacy.patch
106 popd