]> git.pld-linux.org Git - packages/php.git/commitdiff
- fpm patch added
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 26 Nov 2009 20:44:57 +0000 (20:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php-fpm-shared.patch -> 1.1
    php.spec -> 1.825

php-fpm-shared.patch [new file with mode: 0644]
php.spec

diff --git a/php-fpm-shared.patch b/php-fpm-shared.patch
new file mode 100644 (file)
index 0000000..154ac09
--- /dev/null
@@ -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
index 42fbae2df2659fd14c336cf59d7376f388e2b173..fb29fd31e686ac2efe32806bfa9536c7cf3e5f42 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -74,7 +74,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
@@ -104,6 +104,8 @@ Source4:    %{name}-apache.ini
 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
@@ -136,6 +138,7 @@ Patch40:    %{name}-fpm.patch
 #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
@@ -209,6 +212,10 @@ BuildRequires:     apache-devel >= 2.0.52-2
 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
@@ -357,6 +364,19 @@ Package providing /usr/bin/php symlink to PHP CLI.
 %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
@@ -1643,6 +1663,7 @@ cp php.ini-production php.ini
 %patch40 -p1
 #%patch41 -p1
 #%patch42 -p1
+%patch44 -p1
 %endif
 
 %patch43 -p1
@@ -1651,6 +1672,9 @@ cp php.ini-production php.ini
 %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
 
@@ -1660,7 +1684,6 @@ rm -rf ext/sqlite3/libsqlite
 #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
@@ -1671,6 +1694,8 @@ rm -rf ext/pdo_sqlite/sqlite
 #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*
 
@@ -1694,8 +1719,10 @@ if [ $API != %{zend_extension_api} ]; then
 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.* .
@@ -1707,6 +1734,9 @@ export CPPFLAGS="-DDEBUG_FASTCGI -DHAVE_STRNDUP"
 
 sapis="
 cgi-fcgi cli
+%if %{with fpm}
+fpm
+%endif
 %if %{with apache1}
 apxs1
 %endif
@@ -1716,23 +1746,27 @@ apxs2
 "
 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
 
@@ -1767,6 +1801,15 @@ for sapi in $sapis; do
        --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
@@ -1842,6 +1885,7 @@ for sapi in $sapis; do
        --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
@@ -1863,17 +1907,22 @@ sed -i -e "s,@PHP_INSTALLED_SAPIS@,$sapis," "scripts/php-config.in"
 %{__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
@@ -1909,33 +1958,43 @@ sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_c
 # 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
 
@@ -1985,7 +2044,7 @@ cp -a ext/mbstring/libmbfl/mbfl/*.h $RPM_BUILD_ROOT%{_includedir}/php/ext/mbstri
 
 # 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
@@ -2011,6 +2070,16 @@ if [ "$1" = "0" ]; then
        %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
 
@@ -2307,6 +2376,18 @@ fi
 %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-*
This page took 0.134487 seconds and 4 git commands to generate.