SPECS: php-pear-PEAR.spec - builds now, FHS changes moved as bcond

glen glen at pld-linux.org
Wed Nov 8 18:07:38 CET 2006


Author: glen                         Date: Wed Nov  8 17:07:38 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- builds now, FHS changes moved as bcond

---- Files affected:
SPECS:
   php-pear-PEAR.spec (1.121 -> 1.122) 

---- Diffs:

================================================================
Index: SPECS/php-pear-PEAR.spec
diff -u SPECS/php-pear-PEAR.spec:1.121 SPECS/php-pear-PEAR.spec:1.122
--- SPECS/php-pear-PEAR.spec:1.121	Wed Nov  8 00:43:41 2006
+++ SPECS/php-pear-PEAR.spec	Wed Nov  8 18:07:33 2006
@@ -1,4 +1,8 @@
 # $Revision$, $Date$
+#
+# Conditional build:
+%bcond_with	FHS			# writable files in /var/lib/pear. NEEDS LOTS OF PATCHING AND CONVINCING UPSTREAM
+#
 # NOTE
 # - macros needed to build this package are in SOURCES/php-pear-build-macros at DEVEL
 %define		_class		PEAR
@@ -52,8 +56,15 @@
 
 # PEAR_Command_Packaging is separate package
 %define		_noautoreq	'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
+%if %{with FHS}
 %define		_statedir		/var/lib/pear
-%define		pear_registry	%{_statedir}/registry
+%define		_registrydir	%{_statedir}/registry
+%define		_channelsdir	%{_statedir}/.channels
+%else
+%define		_statedir		%{php_pear_dir}
+%define		_registrydir	%{_statedir}/.registry
+%define		_channelsdir	%{_statedir}/.channels
+%endif
 
 %description
 The PEAR package contains:
@@ -113,11 +124,11 @@
 %pear_package_setup -z -a1 -n %{_pearname}-%{version}%{?_rc}
 
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+#%patch1 -p1
+#%patch2 -p1
+#%patch3 -p1
+#%patch4 -p1
+#%patch5 -p1
 
 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
 
@@ -138,11 +149,11 @@
 
 %pear_package_install
 
-install -d $RPM_BUILD_ROOT%{_statedir}/channels/.alias
-install -d $RPM_BUILD_ROOT%{pear_registry}/{.channel.{__uri,pecl.php.net},channels/.alias}
+install -d $RPM_BUILD_ROOT%{_channelsdir}/.alias
+install -d $RPM_BUILD_ROOT%{_registrydir}/{.channel.{__uri,pecl.php.net},channels/.alias}
 touch $RPM_BUILD_ROOT%{_statedir}/.depdb{,lock}
-touch $RPM_BUILD_ROOT%{_statedir}/channels/{__uri,{pear,pecl}.php.net}.reg
-touch $RPM_BUILD_ROOT%{_statedir}/channels/.alias/{pear,pecl}.txt
+touch $RPM_BUILD_ROOT%{_channelsdir}/{__uri,{pear,pecl}.php.net}.reg
+touch $RPM_BUILD_ROOT%{_channelsdir}/.alias/{pear,pecl}.txt
 touch $RPM_BUILD_ROOT%{php_pear_dir}/.filemap
 touch $RPM_BUILD_ROOT%{php_pear_dir}/.lock
 
@@ -169,21 +180,24 @@
 echo '$''Log: $' >> $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
 
 %post
+%if %{with FHS}
 if [ ! -L %{php_pear_dir}/.registry ]; then
 	if [ -d %{php_pear_dir}/.registry ]; then
-		install -d %{pear_registry}
-		mv -f %{php_pear_dir}/.registry/*.reg %{pear_registry}
+		install -d %{_registrydir}
+		mv -f %{php_pear_dir}/.registry/*.reg %{_registrydir}
 		rmdir %{php_pear_dir}/.registry/.channel.* 2>/dev/null
 		rmdir %{php_pear_dir}/.registry/* 2>/dev/null
 		rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
 	fi
-	ln -s %{pear_registry} %{php_pear_dir}/.registry
+	ln -s %{_registrydir} %{php_pear_dir}/.registry
 fi
+%endif
 
 if [ ! -f %{php_pear_dir}/.lock ]; then
 	umask 2
 	%{_bindir}/pear list > /dev/null
 fi
+
 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
 	cat %{_docdir}/%{name}-%{version}/optional-packages.txt
 fi
@@ -207,23 +221,25 @@
 
 %{php_pear_dir}/data/*
 
+%if %{with FHS}
 %dir %{_statedir}
-%dir %{_statedir}/channels
-%dir %{_statedir}/registry
-%dir %{_statedir}/channels/.alias
-
-%ghost %{_statedir}/channels/.alias/pear.txt
-%ghost %{_statedir}/channels/.alias/pecl.txt
-%ghost %{_statedir}/channels/pear.php.net.reg
-%ghost %{_statedir}/channels/pecl.php.net.reg
-%ghost %{_statedir}/channels/__uri.reg
-%ghost %{_statedir}/registry/.channel.__uri
-%ghost %{_statedir}/registry/.channel.pecl.php.net
+%dir %{_registrydir}
+%ghost %dir %{php_pear_dir}/.registry
+%endif
+%dir %{_channelsdir}
+%dir %{_channelsdir}/.alias
+
+%ghost %{_channelsdir}/.alias/pear.txt
+%ghost %{_channelsdir}/.alias/pecl.txt
+%ghost %{_channelsdir}/pear.php.net.reg
+%ghost %{_channelsdir}/pecl.php.net.reg
+%ghost %{_channelsdir}/__uri.reg
+%ghost %{_registrydir}/.channel.__uri
+%ghost %{_registrydir}/.channel.pecl.php.net
 %ghost %{_statedir}/.depdblock
 %ghost %{_statedir}/.depdb
 %ghost %{php_pear_dir}/.filemap
 %ghost %{php_pear_dir}/.lock
-%ghost %dir %{php_pear_dir}/.registry
 
 %files core
 %defattr(644,root,root,755)
@@ -240,6 +256,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.122  2006/11/08 17:07:33  glen
+- builds now, FHS changes moved as bcond
+
 Revision 1.121  2006/11/07 23:43:41  glen
 - 1.5.0a1 (not tested)
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/php-pear-PEAR.spec?r1=1.121&r2=1.122&f=u



More information about the pld-cvs-commit mailing list