packages: php/php.spec, php/php-fpm-shared.patch (NEW) - fpm patch added

glen glen at pld-linux.org
Thu Nov 26 21:45:03 CET 2009


Author: glen                         Date: Thu Nov 26 20:45:03 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fpm patch added

---- Files affected:
packages/php:
   php.spec (1.824 -> 1.825) , php-fpm-shared.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php/php.spec
diff -u packages/php/php.spec:1.824 packages/php/php.spec:1.825
--- packages/php/php.spec:1.824	Thu Nov 26 21:41:49 2009
+++ packages/php/php.spec	Thu Nov 26 21:44:57 2009
@@ -75,7 +75,7 @@
 %undefine	with_interbase
 %endif
 
-%ifnarch %{ix86} %{x8664}
+%ifnarch %{ix86} %{x8664} sparc sparcv9
 # unsupported, see sapi/cgi/fpm/fpm_atomic.h
 %undefine	with_fpm
 %endif
@@ -105,6 +105,8 @@
 Source5:	%{name}-cli.ini
 # Taken from: http://browsers.garykeith.com/downloads.asp
 Source9:	%{name}_browscap.ini
+Source10:	%{name}-fpm.init
+Source11:	%{name}-fpm.logrotate
 Patch0:		%{name}-shared.patch
 Patch1:		%{name}-pldlogo.patch
 Patch2:		%{name}-mail.patch
@@ -137,6 +139,7 @@
 #Patch41:	%{name}-fpm-config.patch
 #Patch42:	%{name}-fpm-initdir.patch
 Patch43:	%{name}-use-prog_sendmail.patch
+Patch44:	%{name}-fpm-shared.patch
 Patch47:	suhosin.patch
 %if %{with type_hints}
 Patch50:	http://ilia.ws/patch/type_hint_53_v2.txt
@@ -210,6 +213,10 @@
 BuildRequires:	apr-devel >= 1:1.0.0
 BuildRequires:	apr-util-devel >= 1:1.0.0
 %endif
+%if %{with fpm}
+BuildRequires:	judy-devel
+BuildRequires:	libevent-devel >= 1.4.7-3
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		php_sysconfdir		/etc/php
@@ -358,6 +365,19 @@
 %description program -l pl.UTF-8
 Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
 
+%package fpm
+Summary:	PHP FastCGI Process Manager
+Group:		Development/Languages/PHP
+URL:		http://www.php-fpm.org/
+Requires(post,preun):	/sbin/chkconfig
+Requires:	%{name}-common = %{epoch}:%{version}-%{release}
+Requires:	libevent >= 1.4.7-3
+Requires:	rc-scripts
+Provides:	webserver(php) = %{version}
+
+%description fpm
+PHP FastCGI Process Manager.
+
 %package common
 Summary:	Common files needed by both Apache modules and CGI/CLI SAPI-s
 Summary(pl.UTF-8):	Wspólne pliki dla modułu apache'a i programu CGI
@@ -1644,6 +1664,7 @@
 %patch40 -p1
 #%patch41 -p1
 #%patch42 -p1
+%patch44 -p1
 %endif
 
 %patch43 -p1
@@ -1652,6 +1673,9 @@
 %patch47 -p1
 %endif
 
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
 # conflict seems to be resolved by recode patches
 rm -f ext/recode/config9.m4
 
@@ -1661,7 +1685,6 @@
 #rm -rf ext/bcmath/libbcmath
 #rm -rf ext/date/lib
 #rm -rf ext/dba/libcdb
-cp -af Zend/LICENSE{,.Zend}
 #rm -rf ext/dba/libflatfile
 #rm -rf ext/dba/libinifile
 #rm -rf ext/gd/libgd
@@ -1672,6 +1695,8 @@
 #rm -rf ext/soap/interop
 rm -rf ext/xmlrpc/libxmlrpc
 
+cp -af Zend/LICENSE{,.Zend}
+
 # breaks build
 sed -i -e 's#-fvisibility=hidden##g' configure*
 
@@ -1695,8 +1720,10 @@
 fi
 
 export EXTENSION_DIR="%{php_extensiondir}"
-if [ ! -f _built-conf ]; then # configure once (for faster debugging purposes)
-	rm -f Makefile.{cgi-fcgi,cli,apxs{1,2}} # now remove Makefile copies
+# configure once (for faster debugging purposes)
+if [ ! -f _built-conf ]; then
+	# now remove Makefile copies
+	rm -f Makefile.{cgi-fcgi,fpm,cli,apxs{1,2}}
 	%{__libtoolize}
 	%{__aclocal}
 	cp -f /usr/share/automake/config.* .
@@ -1708,6 +1735,9 @@
 
 sapis="
 cgi-fcgi cli
+%if %{with fpm}
+fpm
+%endif
 %if %{with apache1}
 apxs1
 %endif
@@ -1717,23 +1747,27 @@
 "
 for sapi in $sapis; do
 	: SAPI $sapi
-	[ -f Makefile.$sapi ] && continue # skip if already configured (for faster debugging purposes)
+	# skip if already configured (for faster debugging purposes)
+	[ -f Makefile.$sapi ] && continue
 
 	sapi_args=''
 	case $sapi in
 	cgi-fcgi)
-		sapi_args=''
+		sapi_args='--disable-cli'
 	;;
 	cli)
 		sapi_args='--disable-cgi'
 	;;
+	fpm)
+		sapi_args='--disable-cli --with-fpm'
+		;;
 	apxs1)
 		ver=$(rpm -q --qf '%{V}' apache1-devel)
-		sapi_args="--with-apxs=%{apxs1} --with-apache-version=$ver"
+		sapi_args="--disable-cli --with-apxs=%{apxs1} --with-apache-version=$ver"
 	;;
 	apxs2)
 		ver=$(rpm -q --qf '%{V}' apache-devel)
-		sapi_args="--with-apxs2=%{apxs2} --with-apache-version=$ver"
+		sapi_args="--disable-cli --with-apxs2=%{apxs2} --with-apache-version=$ver"
 	;;
 	esac
 
@@ -1768,6 +1802,15 @@
 	--enable-json=shared \
 	--enable-hash=shared \
 	--enable-xmlwriter=shared \
+%if %{with fpm}
+	--with-libevent=shared \
+	--with-fpm-conf=%{_sysconfdir}/fpm.conf \
+	--with-fpm-log=/var/log/fpm.log \
+	--with-fpm-pid=/var/run/php/fpm.pid \
+	--with-fpm-port=9000 \
+	--with-fpm-user=http \
+	--with-fpm-group=http \
+%endif
 %if %{with mssql} || %{with sybase_ct}
 	--with-pdo-dblib=shared \
 %endif
@@ -1843,6 +1886,7 @@
 	--with-zlib-dir=shared,/usr \
 	--enable-zip=shared,/usr \
 
+	# safe for debug
 	cp -f Makefile Makefile.$sapi
 	cp -f main/php_config.h php_config.h.$sapi
 	cp -f config.log config.log.$sapi
@@ -1864,17 +1908,22 @@
 %{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache2handler/libphp5.la -f Makefile.apxs2
 %endif
 
-# CGI
+# CGI/FCGI
 cp -af php_config.h.cgi-fcgi main/php_config.h
-rm -rf sapi/cgi/.libs sapi/cgi/*.lo
-%{__make} sapi/cgi/php-cgi -f Makefile.cgi-fcgi
+%{__make} -f Makefile.cgi-fcgi
 [ "$(echo '<?=php_sapi_name();' | ./sapi/cgi/php-cgi -qn)" = cgi-fcgi ] || exit 1
 
 # CLI
 cp -af php_config.h.cli main/php_config.h
-%{__make} sapi/cli/php -f Makefile.cli
+%{__make} -f Makefile.cli
 [ "$(echo '<?=php_sapi_name();' | ./sapi/cli/php -qn)" = cli ] || exit 1
 
+%if %{with fpm}
+cp -af php_config.h.fpm main/php_config.h
+%{__make} -f Makefile.fpm
+ ./sapi/fpm/php-fpm -qn -m > /dev/null
+%endif
+
 %if %{with tests}
 # Run tests, using the CLI SAPI
 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
@@ -1910,33 +1959,43 @@
 # better solution?
 sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/php/build/acinclude.m4
 
-# install CGI
+# install CGI/FCGI
 libtool --silent --mode=install install sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/php.cgi
 ln -sf php.cgi $RPM_BUILD_ROOT%{_bindir}/php.fcgi
 
+# install FCGI PM
+%if %{with fpm}
+libtool --silent --mode=install install sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_bindir}/php.fpm
+cp -a sapi/fpm/php-fpm.1 $RPM_BUILD_ROOT%{_mandir}/man1/php-fpm.1
+cp -a sapi/fpm/php_fpm.conf $RPM_BUILD_ROOT%{_sysconfdir}/fpm.conf
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/php-fpm
+install -d $RPM_BUILD_ROOT/etc/logrotate.d
+cp -a %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/php-fpm
+%endif
+
 # install CLI
 libtool --silent --mode=install install sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php.cli
 install sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php.1
 echo ".so php.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.cli.1
-
 ln -sf php.cli $RPM_BUILD_ROOT%{_bindir}/php
 
 sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
 
 install -d $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
-install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
-install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
+cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
+cp -a %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
 
 %if %{with apache1}
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
 rm -f $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.la
 %endif
 
 %if %{with apache2}
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
 rm -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.la
 %endif
 
@@ -1986,7 +2045,7 @@
 
 # tests
 install -d $RPM_BUILD_ROOT%{php_data_dir}/tests/php
-install run-tests.php $RPM_BUILD_ROOT%{php_data_dir}/tests/php/run-tests.php
+install -p run-tests.php $RPM_BUILD_ROOT%{php_data_dir}/tests/php/run-tests.php
 cp -a tests/* $RPM_BUILD_ROOT%{php_data_dir}/tests/php
 
 %clean
@@ -2012,6 +2071,16 @@
 	%service -q httpd restart
 fi
 
+%post fpm
+/sbin/chkconfig --add php-fpm
+%service php-fpm restart
+
+%preun fpm
+if [ "$1" = 0 ]; then
+	%service php-fpm stop
+	/sbin/chkconfig --del php-fpm
+fi
+
 %post	common -p /sbin/ldconfig
 %postun	common -p /sbin/ldconfig
 
@@ -2308,6 +2377,18 @@
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/php
 
+%if %{with fpm}
+%files fpm
+%defattr(644,root,root,755)
+%doc %lang(ru) sapi/fpm/readme-ru.markdown
+%doc sapi/fpm/nginx-site-conf.sample
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpm.conf
+%attr(755,root,root) %{_bindir}/php.fpm
+%{_mandir}/man1/php-fpm.1*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/php-fpm
+%attr(754,root,root) /etc/rc.d/init.d/php-fpm
+%endif
+
 %files common
 %defattr(644,root,root,755)
 %doc php.ini-*
@@ -2750,6 +2831,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.825  2009/11/26 20:44:57  glen
+- fpm patch added
+
 Revision 1.824  2009/11/26 20:41:49  glen
 - remove junk triggers introduced by zergin
 
@@ -2855,12 +2939,10 @@
    - php-cgi provides php(fcgi)
    - php-cgi obsoletes php-fcgi
    - php-cgi has symlink php.cgi -> php.fcgi
-
 - use "new ini files"
    - php.ini-production as new base config
    - full copies for sapi configs
       cofiguration isn't merged with base php.ini
-
 - package .phpt unit tests and run-tests.php script into
   new php-tests package
 
@@ -2897,25 +2979,20 @@
 - update to snap 2009.02.24 15:30 (beta2 status)
 - update zend_module_api to 20090115
 - update zend_extension_api to 220090115
-
 - remove unrecognized configure options:
    --with-apache-version, --enable-memory-limit, --with-inifile,
    --with-flatfile, --enable-gd-jus-conf, --enable-track-vars,
    --enable-trans-sid, --with-expat-dir, --without-sablot-js,
    --with-tiff-dir
-
    --enable-reflection
    --enable-fastcgi, --with-fastcgi, --enable-force-cgi-redirect
    (fastcgi and reflection are always enabled)
-
 - drop gcc2 patch (gcc2 and php 5.3? please... and it would require maintaing
   php 5.3+ branch as it doesn't apply to current sources)
 - drop hardening patch and bcond: unavailable for php 5.3 and dropped on MAIN
 - drop versioning patch and bcond: unmaintained
-
 - preserve ORACLE_HOME env var if oci8 bcond is on (from MAIN)
 - add php-use-prog_sendmail.patch (from MAIN)
-
 - still doesn't build with sybase_ct
 
 Revision 1.688.2.19  2008/12/29 19:52:27  zergin
@@ -2929,7 +3006,6 @@
 - up to snap 2008.11.08 21:30
 - Patch38 (tds) obsolete, already upstream
 - dropped mime_magic, finaly fully dropped from upstream
-
 - NfFY (Not fully Functional Yet ;-) ) - work in progress
   compiles --without ming, sybase_ct, xmlrpc
 
@@ -2961,7 +3037,6 @@
 Revision 1.688.2.13  2008/07/25 08:27:18  zergin
 - Up to snap 2008.07.26 06:30
 - remove no-metaccld patch (no longer needed)
-
 - closures now available in PHP
 
 Revision 1.688.2.12  2008/07/08 11:44:17  zergin
@@ -2971,7 +3046,6 @@
   - ncurses (moved to pecl)
   - sybase (dropped; use sybase_ct now)
 - PHP bug #45079 fixed, unquoted browscap values not required anymore.
-
 - TODO: adapt to build with freetds 0.82 (missing tds.h required by
         configure)
 
@@ -2982,7 +3056,8 @@
 - fixed missing filter package (after pcre bcond removal)
 
 Revision 1.688.2.10  2008-05-23 17:07:09  glen
-- adapter has no brains, you should have it (revert crap caused by adapter and commiter not looking what it did)
+- adapter has no brains, you should have it (revert crap caused by adapter and
+  commiter not looking what it did)
 
 Revision 1.688.2.9  2008-05-23 17:01:23  zergin
 - adapterized
@@ -2991,7 +3066,6 @@
 Revision 1.688.2.8  2008-05-23 16:36:02  zergin
 - updated to work with current snaps
 - up to snap: 200805231030
-
 - added phar extension (now enabled by default)
 - build in hash extension (can't get it to link properly when shared)
 - commented out php_sapi_name() tests: it SEGVs in build root but works
@@ -2999,7 +3073,6 @@
 - fixed building --without sqlite
 - removed obsolete patch for bug #42952
 - removed posibility to build w/o pcre (pcre must be available)
-
 - works for me on x86_64 --without apache1 fcgi ming
 
 Revision 1.688.2.7  2007-11-10 14:52:04  glen

================================================================
Index: packages/php/php-fpm-shared.patch
diff -u /dev/null packages/php/php-fpm-shared.patch:1.1
--- /dev/null	Thu Nov 26 21:45:03 2009
+++ packages/php/php-fpm-shared.patch	Thu Nov 26 21:44:57 2009
@@ -0,0 +1,11 @@
+--- php-5.3.1/sapi/fpm/ac/fpm_build.m4~	2009-11-26 18:12:06.000000000 +0200
++++ php-5.3.1/sapi/fpm/ac/fpm_build.m4	2009-11-26 21:57:28.003071130 +0200
+@@ -36,7 +36,7 @@
+         BUILD_FPM="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
+       ;;
+       *)
+-        BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
++        BUILD_FPM="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) libphp_common.la \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_FPM_PATH)"
+       ;;
+     esac
+ 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/php.spec?r1=1.824&r2=1.825&f=u



More information about the pld-cvs-commit mailing list