[packages/php/PHP_5_6] attempts to build milter SAPI

glen glen at pld-linux.org
Thu Aug 21 22:56:42 CEST 2014


commit 212b9ffa8572ba3481e8ca7910c365f7c4df9e81
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Aug 21 23:56:04 2014 +0300

    attempts to build milter SAPI

 milter.patch | 28 ++++++++++++++++++++++++++++
 php.spec     | 37 +++++++++++++++++++++++++++++++++----
 2 files changed, 61 insertions(+), 4 deletions(-)
---
diff --git a/php.spec b/php.spec
index e6ef002..c62f109 100644
--- a/php.spec
+++ b/php.spec
@@ -89,6 +89,7 @@
 %bcond_without	fpm		# disable FPM
 %bcond_without	embed		# disable Embedded API
 %bcond_without	phpdbg		# disable phpdbg SAPI
+%bcond_with	milter		# disable Milter SAPI
 %bcond_with	suhosin		# with suhosin patch, has little point in PHP>=5.3, see https://github.com/stefanesser/suhosin/issues/42#issuecomment-41728178
 %bcond_with	tests		# default off; test process very often hangs on builders, approx run time 45m; perform "make test"
 %bcond_with	gcov		# Enable Code coverage reporting
@@ -110,6 +111,11 @@
 %undefine	with_mm
 %endif
 
+# milter requires ZTS
+%if %{with milter} && %{without zts}
+%undefine	with_milter
+%endif
+
 %ifnarch %{ix86} %{x8664} sparc sparcv9 alpha
 # ppc disabled (broken on th-ppc)
 %undefine	with_interbase
@@ -170,6 +176,7 @@ Patch4:		%{orgname}-libpq_fs_h_path.patch
 Patch5:		%{orgname}-filter-shared.patch
 Patch6:		%{orgname}-build_modules.patch
 Patch7:		%{orgname}-sapi-ini-file.patch
+Patch8:		milter.patch
 
 Patch10:	%{orgname}-ini.patch
 Patch11:	embed.patch
@@ -1915,6 +1922,7 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 
 %prep
 %setup -q -n %{orgname}-%{version}%{?subver}
+cp -p php.ini-production php.ini
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -1923,8 +1931,8 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
-cp -p php.ini-production php.ini
 %patch10 -p1
 %if %{with type_hints}
 %patch12 -p0
@@ -2147,7 +2155,7 @@ export EXTENSION_DIR="%{php_extensiondir}"
 # configure once (for faster debugging purposes)
 if [ ! -f _built-conf ]; then
 	# now remove Makefile copies
-	rm -f Makefile.{cgi-fcgi,fpm,cli,apxs1,apxs2,litespeed}
+	rm -f Makefile.{cgi-fcgi,fpm,cli,apxs1,apxs2,litespeed,phpdbg,milter}
 	%{__libtoolize}
 	%{__aclocal}
 	cp -f /usr/share/automake/config.* .
@@ -2175,11 +2183,14 @@ embed
 %if %{with apache1}
 apxs1
 %endif
+%if %{with apache2}
+apxs2
+%endif
 %if %{with phpdbg}
 phpdbg
 %endif
-%if %{with apache2}
-apxs2
+%if %{with milter}
+milter
 %endif
 "
 for sapi in $sapis; do
@@ -2215,6 +2226,9 @@ for sapi in $sapis; do
 	phpdbg)
 		sapi_args='--disable-cli --disable-cgi --enable-phpdbg %{?debug:--enable-phpdbg-debug}'
 	;;
+	milter)
+		sapi_args='--disable-cli --disable-cgi --with-milter'
+	;;
 	esac
 
 	%configure \
@@ -2367,6 +2381,10 @@ cp -af Makefile.cli Makefile
 	PHPDBG_EXTRA_LIBS=-lreadline
 %endif
 
+%if %{with milter}
+%{__make} -f Makefile.milter milter
+%endif
+
 # CGI/FCGI
 %if %{with cgi}
 cp -pf php_config.h.cgi-fcgi main/php_config.h
@@ -2509,6 +2527,11 @@ libtool --mode=install install -p sapi/litespeed/php $RPM_BUILD_ROOT%{_sbindir}/
 	INSTALL_ROOT=$RPM_BUILD_ROOT
 %endif
 
+%if %{with milter}
+%{__make} -f Makefile.milter install-milter \
+	INSTALL_ROOT=$RPM_BUILD_ROOT
+%endif
+
 libtool --mode=install install -p libphp_common.la $RPM_BUILD_ROOT%{_libdir}
 
 # install CGI/FCGI
@@ -2842,6 +2865,12 @@ fi
 %attr(755,root,root) %{_bindir}/phpdbg
 %endif
 
+%if %{with milter}
+%files milter
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/php-milter
+%endif
+
 %files common
 %defattr(644,root,root,755)
 %doc CREDITS EXTENSIONS LICENSE NEWS README.namespaces UPGRADING* Zend/{LICENSE.Zend,ZEND_CHANGES} php.ini-*
diff --git a/milter.patch b/milter.patch
new file mode 100644
index 0000000..5ed3573
--- /dev/null
+++ b/milter.patch
@@ -0,0 +1,28 @@
+--- php-5.6.0RC4/sapi/milter/config.m4~	2014-08-14 03:54:13.000000000 +0300
++++ php-5.6.0RC4/sapi/milter/config.m4	2014-08-21 19:57:21.584244904 +0300
+@@ -6,18 +6,13 @@
+ [  --with-milter[=DIR]       Build PHP as Milter application], no, no)
+ 
+ if test "$PHP_MILTER" != "no"; then
+-  if test "$PHP_MILTER" = "yes"; then
+-    if test -f /usr/lib/libmilter.a ; then
+-      MILTERPATH=/usr/lib
+-    else
+-      if test -f /usr/lib/libmilter/libmilter.a ; then
+-        MILTERPATH=/usr/lib/libmilter
+-      else
+-        AC_MSG_ERROR([Unable to find libmilter.a])
+-      fi
+-    fi
+-  else
+-    MILTERPATH=$PHP_MILTER
++  for i in $PHP_MILTER /usr/lib/libmilter /usr/local /usr; do
++    test -f $i/$PHP_LIBDIR/libmilter.a && MILTERPATH=$i/$PHP_LIBDIR && break
++    test -f $i/libmilter.a && MILTERPATH=$i && break
++  done
++
++  if test -z "$MILTERPATH"; then
++    AC_MSG_ERROR([Unable to find libmilter.a])
+   fi
+   
+   SAPI_MILTER_PATH=sapi/milter/php-milter
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/8b15d51cb0e6c95aaa43d886ff122e7c97ff2c24



More information about the pld-cvs-commit mailing list