archrelease: copy trunk to extra-x86_64
[arch-packages.git] / php / trunk / generate_patches
blob9ce182415541b7e94377c7bcdd7409bfdb1da9dd
1 #!/bin/bash
3 . PKGBUILD
5 makepkg -o --nodeps --noprepare --skipinteg
7 pushd "src/${pkgbase}-${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/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/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/php-fpm.pid#' \
27 -i.orig sapi/fpm/php-fpm.service.in
29 # available extensions after build
30 # find /var/lib/archbuild/*-x86_64/*/build/php/src/build/modules -name '*.so' -exec basename {} .so \; | sort -u
31 availableExtensions=(
32 bcmath
33 bz2
34 calendar
35 curl
36 dba
37 enchant
38 exif
39 ffi
40 ftp
42 gettext
43 gmp
44 iconv
45 imap
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/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 popd