archrelease: copy trunk to testing-x86_64
[arch-packages.git] / php7 / trunk / generate_patches
blob8e281d586f10431ed9ff065021d81cb63086935f
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-fpm7/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-fpm7/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-fpm7/php-fpm.pid#' \
27 -e 's#^ExecStart=@EXPANDED_SBINDIR@/php-fpm#ExecStart=@EXPANDED_SBINDIR@/php-fpm7#' \
28 -i.orig sapi/fpm/php-fpm.service.in
30 extensions=";extension=bcmath\n;extension=bz2\n;extension=calendar\nextension=curl\n;extension=dba\n;extension=enchant\n;extension=exif\n;extension=ffi\n;extension=ftp\n;extension=gd\n;extension=gettext\n;extension=gmp\n;extension=iconv\n;extension=imap\n;extension=intl\n;extension=ldap\n;extension=mysqli\n;extension=odbc\n;zend_extension=opcache\n;extension=pdo_dblib\n;extension=pdo_mysql\n;extension=pdo_odbc\n;extension=pdo_pgsql\n;extension=pdo_sqlite\n;extension=pgsql\n;extension=pspell\n;extension=shmop\n;extension=snmp\n;extension=soap\n;extension=sockets\n;extension=sodium\n;extension=sqlite3\n;extension=sysvmsg\n;extension=sysvsem\n;extension=sysvshm\n;extension=tidy\n;extension=xmlrpc\n;extension=xsl\nextension=zip\n"
32 sed \
33 -r ":a;N;\$!ba;s/; Notes for Windows environments :\n.+;?extension=\w+\n/${extensions}/g" \
34 -i.orig php.ini-production
35 sed \
36 -e 's#^;extension_dir = "\./"$#extension_dir = "/usr/lib/php7/modules/"#g' \
37 -i php.ini-production
39 sed \
40 -r 's#PKG_CHECK_MODULES\(\[ENCHANT\], \[enchant\]\)#PKG_CHECK_MODULES([ENCHANT], [enchant-2])#g' \
41 -i.orig ext/enchant/config.m4
42 sed \
43 -r 's#enchant_dict_free_suggestions\(pdict->pdict, suggs\)#enchant_dict_free_string_list(pdict->pdict, suggs)#g' \
44 -i.orig ext/enchant/enchant.c
45 sed \
46 -r 's#enchant_dict_add_to_personal\(pdict->pdict, word, wordlen\)#enchant_dict_add(pdict->pdict, word, wordlen)#g' \
47 -i ext/enchant/enchant.c
48 sed \
49 -r 's#enchant_dict_is_in_session\(pdict->pdict, word, wordlen\)#enchant_dict_is_added(pdict->pdict, word, wordlen)#g' \
50 -i ext/enchant/enchant.c
52 diff -u sapi/apache2handler/config.m4.orig sapi/apache2handler/config.m4 | filterdiff --clean --remove-timestamps > ../../apache.patch
54 diff -u sapi/fpm/Makefile.frag.orig sapi/fpm/Makefile.frag | filterdiff --clean --remove-timestamps > ../../php-fpm.patch
55 diff -u sapi/fpm/php-fpm.conf.in.orig sapi/fpm/php-fpm.conf.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
56 diff -u sapi/fpm/www.conf.in.orig sapi/fpm/www.conf.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
57 diff -u sapi/fpm/php-fpm.service.in.orig sapi/fpm/php-fpm.service.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
59 diff -u php.ini-production.orig php.ini-production | filterdiff --clean --remove-timestamps > ../../php.ini.patch
61 diff -u ext/enchant/config.m4.orig ext/enchant/config.m4 | filterdiff --clean --remove-timestamps > ../../enchant-2.patch
62 diff -u ext/enchant/enchant.c.orig ext/enchant/enchant.c | filterdiff --clean --remove-timestamps >> ../../enchant-2.patch
65 sed -i.orig 's/ \[php-config\],/ [php-config7],/g' scripts/phpize.m4
66 diff -u scripts/phpize.m4.orig scripts/phpize.m4 | filterdiff --clean --remove-timestamps > ../../php7.patch
68 popd