]> git.pld-linux.org Git - packages/php-pear-PEAR.git/commitdiff
- FHS fixes
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 3 Mar 2006 21:36:38 +0000 (21:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- NB! 1.4.7 is not usable for rpm packaging

Changed files:
    php-pear-PEAR.spec -> 1.103

php-pear-PEAR.spec

index cd23a9dd05b0b495a0658660713d85d17af0d908..fa3d0f113d406a6a3268197b8a82ecf1bcf0b65a 100644 (file)
@@ -1,6 +1,3 @@
-# TODO
-# - FHS fix for .channels info
-#
 %include       /usr/lib/rpm/macros.php
 %define                _class          PEAR
 %define                _status         stable
@@ -10,7 +7,7 @@ Summary:       %{_pearname} - main PHP PEAR class
 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
@@ -22,9 +19,10 @@ Patch1:              %{name}-rpmpkgname.patch
 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
@@ -47,6 +45,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # 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:
@@ -106,6 +105,7 @@ oraz klasy dla PHP 5:
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
 
@@ -127,9 +127,12 @@ cp $D/pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
 
 %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
@@ -157,6 +160,21 @@ echo '$''Log: $' >> $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
 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
@@ -177,18 +195,21 @@ rm -rf $RPM_BUILD_ROOT
 
 %{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)
This page took 0.040724 seconds and 4 git commands to generate.