forked from dreamcat4/php-fpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-fpm-patch
executable file
·49 lines (42 loc) · 1.62 KB
/
generate-fpm-patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# generate-fpm-patch - Generate a patch file from fpm sources
#
START_DIR=`pwd`
if [ "$1" ] ; then FPM_DIR="$1"; else FPM_DIR=`dirname "$0"`; fi
CONFIGURE_AC="$FPM_DIR/configure.ac"
if [ "$FPM_DIR" = '.' ] || [ ! -f "$CONFIGURE_AC" ]; then
echo This command must be executed one directory ABOVE the
echo php-fpm source tree, with `php-fpm/generate-fpm-patch`
fi
PKG_DESCR=`cat "$CONFIGURE_AC" | grep AC_INIT | sed -e "s/AC_INIT.//" -e "s/. *$//"`
FPM_PATCH_HEADER=`cat <<- \
FPM_PATCH_HEADER
#
# Ubuntu: https://bugs.launchpad.net/bugs/397721
# Patch: https://code.launchpad.net/php-fpm
# Description: $PKG_DESCR
#
FPM_PATCH_HEADER
`
echo "$FPM_PATCH_HEADER" > fpm.patch
PHP_SRC="43fa2d06781b784bb2025b57a2230267" # echo "php-src" | md5
mkdir -p "$PHP_SRC/php-src-vanilla/sapi"
mkdir -p "$PHP_SRC/php-src/sapi"
cd "$PHP_SRC/php-src"
cp -RfL "../../$FPM_DIR" sapi/fpm
cd sapi/fpm
# Remove non-project files
rm -Rf .bzr* .git* *.cache autotools
# Remove standalone project files
STANDALONE_FILES="INSTALL Makefile.am Makefile.in acinclude.m4 aclocal.m4 autoconf.markdown \
buildconf compile config.guess config.sub configure configure.ac depcomp \
generate-autotools generate-fpm-patch fpm_autoconfig.h.in install-sh ltmain.sh m4 missing \
readme.markdown fpm/Makefile.am fpm/Makefile.in cgi/Makefile.am cgi/Makefile.in"
rm -rf $STANDALONE_FILES
# Remove those standalone files here that php-src won't use
# rm -rf file1 file2 file3...
cd "$START_DIR/$PHP_SRC"
# diff -Naur php-src-vanilla php-src | filterdiff --remove-timestamps >> fpm.patch
diff -Naur php-src-vanilla php-src >> fpm.patch
cp fpm.patch ../ && cd ../
rm -Rf $PHP_SRC