SPECS: php-pear-PEAR.spec - FHS fixes - NB! 1.4.7 is not usable fo...
glen
glen at pld-linux.org
Fri Mar 3 22:36:43 CET 2006
Author: glen Date: Fri Mar 3 21:36:43 2006 GMT
Module: SPECS Tag: HEAD
---- Log message:
- FHS fixes
- NB! 1.4.7 is not usable for rpm packaging
---- Files affected:
SPECS:
php-pear-PEAR.spec (1.102 -> 1.103)
---- Diffs:
================================================================
Index: SPECS/php-pear-PEAR.spec
diff -u SPECS/php-pear-PEAR.spec:1.102 SPECS/php-pear-PEAR.spec:1.103
--- SPECS/php-pear-PEAR.spec:1.102 Wed Mar 1 11:09:01 2006
+++ SPECS/php-pear-PEAR.spec Fri Mar 3 22:36:38 2006
@@ -1,7 +1,4 @@
# $Revision$, $Date$
-# TODO
-# - FHS fix for .channels info
-#
%include /usr/lib/rpm/macros.php
%define _class PEAR
%define _status stable
@@ -11,7 +8,7 @@
Summary(pl): %{_pearname} - podstawowa klasa dla PHP PEAR
Name: php-pear-%{_pearname}
Version: 1.4.7
-Release: 1
+Release: 0.11
Epoch: 1
License: PHP 3.0
Group: Development/Languages/PHP
@@ -23,9 +20,10 @@
Patch2: %{name}-rpmvars.patch
Patch3: %{name}-old-api.patch
Patch4: %{name}-specfile.patch
+Patch5: %{name}-FHS.patch
URL: http://pear.php.net/package/PEAR
BuildRequires: php-cli
-BuildRequires: php-pear >= 4:1.0-6
+BuildRequires: php-pear >= 4:1.0-12.3
BuildRequires: rpm-php-pearprov >= 4.4.2-11
Requires: %{name}-core = %{epoch}:%{version}-%{release}
Requires: /usr/bin/php
@@ -48,6 +46,7 @@
# PEAR_Command_Packaging is separate package
%define _noautoreq 'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
+%define _statedir /var/lib/pear
%description
The PEAR package contains:
@@ -107,6 +106,7 @@
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
@@ -128,9 +128,12 @@
%pear_package_install
-cp -a ./%{php_pear_dir}/.channels $RPM_BUILD_ROOT%{php_pear_dir}/.channels
-cp -a ./%{php_pear_dir}/.registry/.channel* $RPM_BUILD_ROOT%{php_pear_dir}/.registry
-cp -a ./%{php_pear_dir}/.depdb* $RPM_BUILD_ROOT%{php_pear_dir}
+install -d $RPM_BUILD_ROOT%{_statedir}/{registry/.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%{_statedir}/.filemap
+touch $RPM_BUILD_ROOT%{_statedir}/.lock
# -C and -q options were for php-cgi, in php-cli they're enabled by default.
%define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
@@ -158,6 +161,21 @@
if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
cat %{_docdir}/%{name}-%{version}/optional-packages.txt
fi
+if [ ! -f %{_statedir}/.lock ]; then
+ umask 2
+ touch %{_statedir}/.lock
+fi
+if [ ! -e %{php_pear_dir}/.registry ]; then
+ ln -s %{_statedir}/registry %{php_pear_dir}/.registry
+fi
+
+%triggerpostun -- %{name} < 1:1.4.7-0.3
+if [ ! -L %{php_pear_dir}/.registry ]; then
+ mv -f %{php_pear_dir}/.registry/*.reg %{_statedir}/registry
+ rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
+ ln -s %{_statedir}/registry %{php_pear_dir}/.registry
+fi
+rm -f %{php_pear_dir}/.{lock,depdb*,filemap}
%clean
rm -rf $RPM_BUILD_ROOT
@@ -178,18 +196,21 @@
%{php_pear_dir}/data/*
-# FIXME: FHS
-%ghost %dir %{php_pear_dir}/.channels
-%ghost %dir %{php_pear_dir}/.channels/.alias
-%ghost %{php_pear_dir}/.channels/.alias/pear.txt
-%ghost %{php_pear_dir}/.channels/.alias/pecl.txt
-%ghost %{php_pear_dir}/.channels/pear.php.net.reg
-%ghost %{php_pear_dir}/.channels/pecl.php.net.reg
-%ghost %{php_pear_dir}/.channels/__uri.reg
-%ghost %{php_pear_dir}/.registry/.channel.__uri
-%ghost %{php_pear_dir}/.registry/.channel.pecl.php.net
-%ghost %{php_pear_dir}/.depdblock
-%ghost %{php_pear_dir}/.depdb
+%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
+%ghost %{_statedir}/.depdblock
+%ghost %{_statedir}/.depdb
+%ghost %{_statedir}/.filemap
+%ghost %{_statedir}/.lock
%files core
%defattr(644,root,root,755)
@@ -206,6 +227,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.103 2006/03/03 21:36:38 glen
+- FHS fixes
+- NB! 1.4.7 is not usable for rpm packaging
+
Revision 1.102 2006/03/01 10:09:01 glen
- -d open_basedir="" as upstream
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/php-pear-PEAR.spec?r1=1.102&r2=1.103&f=u
More information about the pld-cvs-commit
mailing list