packages: php/fix-test-run.patch, php/php.spec - fix test building - add cg...

glen glen at pld-linux.org
Sat Jul 24 18:16:50 CEST 2010


Author: glen                         Date: Sat Jul 24 16:16:50 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fix test building
- add cgi bcond

---- Files affected:
packages/php:
   fix-test-run.patch (1.6 -> 1.7) , php.spec (1.876 -> 1.877) 

---- Diffs:

================================================================
Index: packages/php/fix-test-run.patch
diff -u packages/php/fix-test-run.patch:1.6 packages/php/fix-test-run.patch:1.7
--- packages/php/fix-test-run.patch:1.6	Mon Jun  7 21:36:29 2010
+++ packages/php/fix-test-run.patch	Sat Jul 24 18:16:45 2010
@@ -49,3 +49,43 @@
  	else \
  		echo "ERROR: Cannot run tests without CLI sapi."; \
  	fi
+--- php-5.3.2/Makefile.global	2010-03-16 16:31:36.972576955 +0200
++++ php-5.3.2/Makefile.global	2010-03-16 16:31:36.972576955 +0200
+@@ -296,7 +296,7 @@
+ 	fi
+ 
+ PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d 'safe_mode=0'
+-PHP_TEST_SHARED_SYSTEM_EXTENSIONS = pcre
++PHP_TEST_SHARED_SYSTEM_EXTENSIONS =
+ PHP_TEST_SHARED_EXTENSIONS =  ` \
+ 	if test "x$(PHP_MODULES)" != "x"; then \
+ 		for i in $(PHP_MODULES)""; do \
+--- php-5.3.2/Makefile.gcov	2010-03-16 16:31:36.972576955 +0200
++++ php-5.3.2/Makefile.gcov	2010-03-16 16:31:36.972576955 +0200
+@@ -376,11 +376,25 @@
+ 	@echo "Running test suite"
+ 	@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
+ 	- at if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
++		INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
++		if test "$$INI_FILE"; then \
++			$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
++		else \
++			echo > $(top_builddir)/tmp-php.ini; \
++		fi; \
++		INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
++		if test "$$INI_SCANNED_PATH"; then \
++			INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
++			$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
++		fi; \
+ 		NO_INTERACTION=1 \
+ 		TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
+ 		TEST_PHP_SRCDIR=$(top_srcdir) \
+ 		CC="$(CC)" \
+-			$(PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php -d 'extension_dir=modules/' -d `( . $(PHP_MODULES) ; echo extension=$$dlname)` tests/; \
++			$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini \
++			-d extension_dir=$(top_builddir)/modules/ -d 'extension=$(EXTENSION_DIR)/pcre.$(SHLIB_DL_SUFFIX_NAME)' \
++			$(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini \
++			-d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(RUN_TESTS_SETTINGS) $(TESTS); \
+ 	elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
+ 		NO_INTERACTION=1 \
+ 		TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \

================================================================
Index: packages/php/php.spec
diff -u packages/php/php.spec:1.876 packages/php/php.spec:1.877
--- packages/php/php.spec:1.876	Mon Jun 14 11:38:05 2010
+++ packages/php/php.spec	Sat Jul 24 18:16:45 2010
@@ -56,9 +56,10 @@
 %bcond_without	tidy		# without Tidy extension module
 %bcond_without	wddx		# without WDDX extension module
 %bcond_without	xmlrpc		# without XML-RPC extension module
-%bcond_without	apache1		# disable building Apache 1.3.x module
-%bcond_without	apache2		# disable building Apache 2.x module
+%bcond_without	apache1		# disable building Apache 1.3.x SAPI
+%bcond_without	apache2		# disable building Apache 2.x SAPI
 %bcond_without	zts		# disable Zend Thread Safety
+%bcond_without	cgi			# disable CGI/FCGI SAPI
 %bcond_without	fpm		# fpm patches from http://www.php-fpm.org/
 %bcond_without	suhosin		# with suhosin patch
 %bcond_with	tests		# default off; test process very often hangs on builders, approx run time 45m; perform "make test"
@@ -68,6 +69,14 @@
 %define apxs1		/usr/sbin/apxs1
 %define	apxs2		/usr/sbin/apxs
 
+# disable all sapis
+%if %{with gcov}
+%undefine	with_apache1
+%undefine	with_apache2
+%undefine	with_cgi
+%undefine	with_litespeed
+%endif
+
 # mm is not thread safe
 %if %{with zts}
 %undefine	with_mm
@@ -83,9 +92,11 @@
 %undefine	with_fpm
 %endif
 
+%if 0
 %if %{without apache1} && %{without apache2}
 ERROR: You need to select at least one Apache SAPI to build shared modules.
 %endif
+%endif
 
 # filter depends on pcre
 %if %{without pcre}
@@ -168,6 +179,7 @@
 Patch52:	pcre-shared.patch
 Patch53:	fix-test-run.patch
 Patch54:	mysqlnd-shared.patch
+Patch55:	bug-52078-fileinode.patch
 URL:		http://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -215,6 +227,7 @@
 %endif
 %{?with_gcov:BuildRequires:	lcov}
 %{?with_snmp:BuildRequires:	net-snmp-devel >= 5.0.7}
+%{?with_snmp:%{?with_tests:mibs-net-snmp}}
 BuildRequires:	pam-devel
 %{?with_pcre:BuildRequires:	pcre-devel >= 6.6}
 BuildRequires:	pkgconfig
@@ -1815,6 +1828,7 @@
 %patch52 -p1
 %patch53 -p1
 %patch54 -p1
+%patch55 -p1
 
 %if "%{pld_release}" != "ac"
 sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
@@ -1831,6 +1845,7 @@
 rm -rf ext/sqlite3/libsqlite
 #rm -rf ext/bcmath/libbcmath
 #rm -rf ext/date/lib
+#rm -rf ext/fileinfo/libmagic
 #rm -rf ext/dba/libcdb
 #rm -rf ext/dba/libflatfile
 #rm -rf ext/dba/libinifile
@@ -1838,9 +1853,10 @@
 #rm -rf ext/mbstring/libmbfl
 #rm -rf ext/mbstring/oniguruma
 rm -rf ext/pcre/pcrelib
-rm -rf ext/pdo_sqlite/sqlite
+rm -rf ext/pdo_sqlite/libsqlite
 #rm -rf ext/soap/interop
 rm -r ext/xmlrpc/libxmlrpc
+#rm -rf ext/zip/lib
 
 cp -af Zend/LICENSE{,.Zend}
 install -p %{SOURCE13} dep-tests.sh
@@ -1889,7 +1905,10 @@
 	-I%{_includedir}/xmlrpc-epi"
 
 sapis="
-cgi-fcgi cli
+cli
+%if %{with cgi}
+cgi-fcgi
+%endif
 %if %{with fpm}
 fpm
 %endif
@@ -2076,9 +2095,11 @@
 %endif
 
 # CGI/FCGI
+%if %{with cgi}
 cp -af php_config.h.cgi-fcgi main/php_config.h
 %{__make} -f Makefile.cgi-fcgi
 [ "$(echo '<?=php_sapi_name();' | ./sapi/cgi/php-cgi -qn)" = cgi-fcgi ] || exit 1
+%endif
 
 # PHP FPM
 %if %{with fpm}
@@ -2126,15 +2147,31 @@
 	exit 1
 fi
 
+%if %{with gcov}
+# Use CLI SAPI
+cp -af php_config.h.cli main/php_config.h
+cp -af Makefile.cli Makefile
+%{__make} lcov
+# you really don't want to package result of gcov build
+exit 1
+%endif
 
 %if %{with tests}
 # Run tests, using the CLI SAPI
 cp -af php_config.h.cli main/php_config.h
 cp -af Makefile.cli Makefile
+
+cat <<'EOF' > run-tests.sh
+#!/bin/sh
 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
 unset TZ LANG LC_ALL || :
-%{__make} test RUN_TESTS_SETTINGS="-s test.log" PHP_TEST_SHARED_SYSTEM_EXTENSIONS=
-unset NO_INTERACTION REPORT_EXIT_STATUS MALLOC_CHECK_
+%{__make} test \
+	EXTENSION_DIR=. \
+	PHP_TEST_SHARED_SYSTEM_EXTENSIONS= \
+	RUN_TESTS_SETTINGS="-q $*"
+EOF
+chmod +x run-tests.sh
+./run-tests.sh -w failed.log -s test.log
 
 # collect failed tests into cleanup script used in prep.
 sed -ne '/FAILED TEST SUMMARY/,/^===/p' test.log | sed -e '1,/^---/d;/^===/,$d' > tests-failed.log
@@ -2180,8 +2217,11 @@
 sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/php/build/acinclude.m4
 
 # install CGI/FCGI
+%if %{with cgi}
 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
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
+%endif
 
 # install FCGI PM
 %if %{with fpm}
@@ -2202,9 +2242,7 @@
 
 sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
 
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
 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}
@@ -2588,12 +2626,14 @@
 %attr(755,root,root) %{_sbindir}/php.litespeed
 %endif
 
+%if %{with cgi}
 %files cgi
 %defattr(644,root,root,755)
 %dir %{_sysconfdir}/cgi-fcgi.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cgi-fcgi.ini
 %attr(755,root,root) %{_bindir}/php.cgi
 %attr(755,root,root) %{_bindir}/php.fcgi
+%endif
 
 %files cli
 %defattr(644,root,root,755)
@@ -3088,6 +3128,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.877  2010/07/24 16:16:45  glen
+- fix test building
+- add cgi bcond
+
 Revision 1.876  2010/06/14 09:38:05  glen
 - mm conflicts with zts, not apache2
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/fix-test-run.patch?r1=1.6&r2=1.7&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php/php.spec?r1=1.876&r2=1.877&f=u



More information about the pld-cvs-commit mailing list