SPECS: cups.spec - finished php module register

glen glen at pld-linux.org
Thu May 4 21:27:37 CEST 2006


Author: glen                         Date: Thu May  4 19:27:37 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- finished php module register

---- Files affected:
SPECS:
   cups.spec (1.129 -> 1.130) 

---- Diffs:

================================================================
Index: SPECS/cups.spec
diff -u SPECS/cups.spec:1.129 SPECS/cups.spec:1.130
--- SPECS/cups.spec:1.129	Thu May  4 21:15:45 2006
+++ SPECS/cups.spec	Thu May  4 21:27:32 2006
@@ -5,7 +5,6 @@
 %bcond_without	perl	# don't build Perl extension
 #
 # TODO:
-# - register php module
 # - build/install java ext ?
 # - perl BRs
 %include	/usr/lib/rpm/macros.perl
@@ -48,7 +47,7 @@
 BuildRequires:	openslp-devel
 BuildRequires:	openssl-devel >= 0.9.7d
 BuildRequires:	pam-devel
-%{?with_php:BuildRequires:	php-devel}
+%{?with_php:BuildRequires:	php-devel >= 4:5.0.0}
 BuildRequires:	pkgconfig
 BuildRequires:	rpm-perlprov
 BuildRequires:	rpmbuild(macros) >= 1.268
@@ -63,6 +62,11 @@
 
 %define		_ulibdir	%{_prefix}/lib
 
+%if %{with php}
+%define		_php_configdir /etc/php
+%define		_php_extensiondir %(php-config --extension-dir)
+%endif
+
 %description
 CUPS provides a portable printing layer for UNIX-based operating
 systems. It has been developed by Easy Software Products to promote a
@@ -186,6 +190,7 @@
 Summary(pl):	Moduł PHP CUPS
 Group:		Development/Languages/PHP
 Requires:	%{name}-lib = %{epoch}:%{version}-%{release}
+Requires:	php-common >= 4:5.0.0
 
 %description -n php-cups
 PHP module for Common Unix Printing System.
@@ -292,8 +297,13 @@
 fi
 
 %if %{with php}
+install -d $RPM_BUILD_ROOT%{_php_configdir}/conf.d
 %{__make} -C scripting/php install \
-	PHPDIR="$RPM_BUILD_ROOT`php-config --extension-dir`"
+	PHPDIR="$RPM_BUILD_ROOT%{_php_extensiondir}"
+cat <<'EOF' > $RPM_BUILD_ROOT%{_php_configdir}/conf.d/cups.ini
+; Enable cups extension module
+extension=phpcups.so
+EOF
 %endif
 
 %if %{with perl}
@@ -345,6 +355,16 @@
 %post	image-lib -p /sbin/ldconfig
 %postun	image-lib -p /sbin/ldconfig
 
+%post -n php-cups
+[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+
+%postun -n php-cups
+if [ "$1" = 0 ]; then
+	[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
+	[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+fi
+
 %files
 %defattr(644,root,root,755)
 #%doc *.gz doc/*.html doc/*.css doc/images
@@ -490,7 +510,8 @@
 %if %{with php}
 %files -n php-cups
 %defattr(644,root,root,755)
-%attr(755,root,root) %(php-config --extension-dir)/*
+%config(noreplace) %verify(not md5 mtime size) %{_php_configdir}/conf.d/cups.ini
+%attr(755,root,root) %{_php_extensiondir}/*.so
 %endif
 
 %files backend-usb
@@ -511,6 +532,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.130  2006/05/04 19:27:32  glen
+- finished php module register
+
 Revision 1.129  2006/05/04 19:15:45  glen
 - add drivers dir for win32 drivers
 - build and check-files cleanups
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/cups.spec?r1=1.129&r2=1.130&f=u



More information about the pld-cvs-commit mailing list