packages: php-pear/php-pear.spec - package firephp channel dir - strict che...

glen glen at pld-linux.org
Wed Mar 10 14:42:04 CET 2010


Author: glen                         Date: Wed Mar 10 13:42:04 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- package firephp channel dir
- strict check for channel dirs packaging; rel 2

---- Files affected:
packages/php-pear:
   php-pear.spec (1.51 -> 1.52) 

---- Diffs:

================================================================
Index: packages/php-pear/php-pear.spec
diff -u packages/php-pear/php-pear.spec:1.51 packages/php-pear/php-pear.spec:1.52
--- packages/php-pear/php-pear.spec:1.51	Wed Mar 10 14:11:01 2010
+++ packages/php-pear/php-pear.spec	Wed Mar 10 14:41:58 2010
@@ -3,7 +3,7 @@
 Summary(pl.UTF-8):	PEAR - rozszerzenie PHP i repozytorium aplikacji
 Name:		php-pear
 Version:	1.2
-Release:	1
+Release:	2
 Epoch:		4
 License:	Public Domain
 Group:		Development/Languages/PHP
@@ -20,14 +20,16 @@
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_registrydir	%{php_pear_dir}/.registry
-
 %define		__reg_provides	php %{SOURCE10}
 
+# find channel provides
 %define		_use_internal_dependency_generator 0
 %define		__find_provides %{__reg_provides}
 %define		__find_requires %{nil}
 
+# avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
+%define		__spec_clean_body	%{nil}
+
 %description
 PEAR - PHP Extension and Application Repository.
 
@@ -59,18 +61,6 @@
 pear -c pearrc channel-add %{SOURCE2}
 pear -c pearrc channel-add %{SOURCE3}
 
-# install PEAR registry files
-install -d $RPM_BUILD_ROOT%{php_pear_dir}/.channels/.alias
-install -d $RPM_BUILD_ROOT%{_registrydir}/{.channel.{__uri,pecl.php.net},channels/.alias}
-touch $RPM_BUILD_ROOT%{php_pear_dir}/.depdb{,lock}
-touch $RPM_BUILD_ROOT%{php_pear_dir}/.channels/{__uri,{pear,pecl}.php.net}.reg
-touch $RPM_BUILD_ROOT%{php_pear_dir}/.channels/.alias/{pear,pecl}.txt
-touch $RPM_BUILD_ROOT%{php_pear_dir}/.filemap
-touch $RPM_BUILD_ROOT%{php_pear_dir}/.lock
-
-# TODO:
-install -d $RPM_BUILD_ROOT%{_registrydir}/.channel.pear.phpdb.org
-
 while read dir; do
 	install -d $RPM_BUILD_ROOT$dir
 done <<EOF
@@ -117,12 +107,24 @@
 %{php_pear_dir}/XML
 EOF
 
-%if 0
-do
-%endif
-
 %clean
-rm -rf $RPM_BUILD_ROOT
+cd $RPM_BUILD_ROOT%{php_pear_dir}
+
+check_channel_dirs() {
+	RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
+	TMPFILE=$(mktemp)
+	find .channels .registry -type d | LC_ALL=C sort > $TMPFILE
+
+	# find finds also '.', so use option -B for diff
+	if rpm -qplv %{_rpmdir}/$RPMFILE | sed -ne '/^d/s,^.*%{php_pear_dir}/\.,.,p' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
+		rm -rf $RPM_BUILD_ROOT
+	else
+		echo -e "\nNot so good, some channel directories are not included in package\n"
+		exit 1
+	fi
+	rm -f $TMPFILE
+}
+check_channel_dirs
 
 %files
 %defattr(644,root,root,755)
@@ -145,7 +147,6 @@
 %{php_pear_dir}/.channels/pear.php.net.reg
 
 %{php_pear_dir}/.channels/.alias/pecl.txt
-
 %{php_pear_dir}/.channels/pecl.php.net.reg
 %{php_pear_dir}/.registry/.channel.pecl.php.net
 
@@ -163,6 +164,7 @@
 
 %{php_pear_dir}/.channels/.alias/firephp.txt
 %{php_pear_dir}/.channels/pear.firephp.org.reg
+%{php_pear_dir}/.registry/.channel.pear.firephp.org
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -170,6 +172,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.52  2010/03/10 13:41:58  glen
+- package firephp channel dir
+- strict check for channel dirs packaging; rel 2
+
 Revision 1.51  2010/03/10 13:11:01  glen
 - move php.net channels also here
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pear/php-pear.spec?r1=1.51&r2=1.52&f=u



More information about the pld-cvs-commit mailing list