3c2619d
%global peardir %{_datadir}/pear
f2c4aa5
c0116c6
%global xmlrpcver 1.5.4
9daa490
%global getoptver 1.3.1
8c9c36c
%global arctarver 1.3.7
bee08ed
%global structver 1.0.4
3c2619d
%global xmlutil   1.2.1
b5bac4b
f2c4aa5
Summary: PHP Extension and Application Repository framework
f2c4aa5
Name: php-pear
a947c82
Version: 1.9.3
40f9b86
Release: 2%{?dist}
f2c4aa5
Epoch: 1
f2efa72
# PEAR, Archive_Tar, XML_Util are BSD
f2efa72
# XML-RPC, Console_Getopt are PHP
66a2bd1
# Structures_Graph is LGPLv2+
f2efa72
License: BSD and PHP and LGPLv2+
30e6e23
Group: Development/Languages
f2c4aa5
URL: http://pear.php.net/package/PEAR
d4b666e
Source0: http://download.pear.php.net/package/PEAR-%{version}.tgz
65cf09f
# wget 'http://svn.php.net/viewvc/pear/pear-core/trunk/install-pear.php?revision=308763&view=co' -O install-pear.php
65cf09f
# see http://pear.php.net/bugs/18367 - doc_dir relocation
d4b666e
Source1: install-pear.php
f2c4aa5
Source2: relocate.php
9178c0f
Source3: strip.php
66a2bd1
Source4: LICENSE-XML_RPC
c4b9d17
Source10: pear.sh
c4b9d17
Source11: pecl.sh
c4b9d17
Source12: peardev.sh
21dfe00
Source13: macros.pear
f98fc6f
Source20: http://pear.php.net/get/XML_RPC-%{xmlrpcver}.tgz
d4b666e
Source21: http://pear.php.net/get/Archive_Tar-%{arctarver}.tgz
d4b666e
Source22: http://pear.php.net/get/Console_Getopt-%{getoptver}.tgz
d4b666e
Source23: http://pear.php.net/get/Structures_Graph-%{structver}.tgz
3c2619d
Source24: http://pear.php.net/get/XML_Util-%{xmlutil}.tgz
d4b666e
cbe20f7
BuildArch: noarch
cbe20f7
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
d4b666e
BuildRequires: php-cli >= 5.1.0-1, php-xml, gnupg
e598df7
d4b666e
Provides: php-pear(Console_Getopt) = %{getoptver}
d4b666e
Provides: php-pear(Archive_Tar) = %{arctarver}
977b82d
Provides: php-pear(PEAR) = %{version}
d4b666e
Provides: php-pear(Structures_Graph) = %{structver}
b5bac4b
Provides: php-pear(XML_RPC) = %{xmlrpcver}
3c2619d
Provides: php-pear(XML_Util) = %{xmlutil}
3c2619d
Obsoletes: php-pear-XML-Util <= %{xmlutil}
3c2619d
Provides:  php-pear-XML-Util = %{xmlutil}-%{release}
e598df7
Requires:  php-cli >= 5.1.0-1
e598df7
f2c4aa5
f2c4aa5
%description
f2c4aa5
PEAR is a framework and distribution system for reusable PHP
f2c4aa5
components.  This package contains the basic PEAR components.
f2c4aa5
f2c4aa5
%prep
d4b666e
%setup -cT
d4b666e
d4b666e
# Create a usable PEAR directory (used by install-pear.php)
3c2619d
for archive in %{SOURCE0} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24}
d4b666e
do
115cca0
    tar xzf  $archive --strip-components 1 || tar xzf  $archive --strip-path 1
f2efa72
    file=${archive##*/}
f2efa72
    [ -f LICENSE ] && mv LICENSE LICENSE-${file%%-*}
f2efa72
    [ -f README ]  && mv README  README-${file%%-*}
d4b666e
done
3c2619d
tar xzf %{SOURCE24} package.xml
3c2619d
mv package.xml XML_Util.xml
d4b666e
6fb06dc
# apply patches on used PEAR during install
6fb06dc
# -- no patch
f2c4aa5
5215bfd
%build
5215bfd
# This is an empty build section.
5215bfd
f2c4aa5
%install
f2c4aa5
rm -rf $RPM_BUILD_ROOT
f2c4aa5
d4b666e
export PHP_PEAR_SYSCONF_DIR=%{_sysconfdir}
d4b666e
export PHP_PEAR_SIG_KEYDIR=%{_sysconfdir}/pearkeys
d4b666e
export PHP_PEAR_SIG_BIN=%{_bindir}/gpg
d4b666e
export PHP_PEAR_INSTALL_DIR=%{peardir}
7550ac1
7550ac1
# 1.4.11 tries to write to the cache directory during installation
7550ac1
# so it's not possible to set a sane default via the environment.
7550ac1
# The ${PWD} bit will be stripped via relocate.php later.
7550ac1
export PHP_PEAR_CACHE_DIR=${PWD}%{_localstatedir}/cache/php-pear
7550ac1
export PHP_PEAR_TEMP_DIR=/var/tmp
f2c4aa5
d4b666e
install -d $RPM_BUILD_ROOT%{peardir} \
f98fc6f
           $RPM_BUILD_ROOT%{_localstatedir}/cache/php-pear \
3c2619d
           $RPM_BUILD_ROOT%{_localstatedir}/www/html \
49aa7f5
           $RPM_BUILD_ROOT%{peardir}/.pkgxml \
2853f62
           $RPM_BUILD_ROOT%{_sysconfdir}/rpm \
2853f62
           $RPM_BUILD_ROOT%{_sysconfdir}/pear
f2c4aa5
d4b666e
export INSTALL_ROOT=$RPM_BUILD_ROOT
d4b666e
e05e7ea
%{_bindir}/php -n -dmemory_limit=32M -dshort_open_tag=0 -dsafe_mode=0 \
d4b666e
         -derror_reporting=E_ALL -ddetect_unicode=0 \
d4b666e
      %{SOURCE1} -d %{peardir} \
2853f62
                 -c %{_sysconfdir}/pear \
d4b666e
                 -b %{_bindir} \
3c2619d
                 -w %{_localstatedir}/www/html \
65cf09f
                 -D %{_docdir}/pear \
3c2619d
                 %{SOURCE0} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24} %{SOURCE20}
d4b666e
d4b666e
# Replace /usr/bin/* with simple scripts:
d4b666e
install -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/pear
d4b666e
install -m 755 %{SOURCE11} $RPM_BUILD_ROOT%{_bindir}/pecl
d4b666e
install -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_bindir}/peardev
f2c4aa5
9178c0f
# Sanitize the pear.conf
d4b666e
%{_bindir}/php -n %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf $RPM_BUILD_ROOT | 
7550ac1
  %{_bindir}/php -n %{SOURCE2} php://stdin $PWD > new-pear.conf
7377411
%{_bindir}/php -n %{SOURCE3} new-pear.conf ext_dir |
7377411
  %{_bindir}/php -n %{SOURCE3} php://stdin http_proxy > $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
7377411
7377411
%{_bindir}/php -r "print_r(unserialize(substr(file_get_contents('$RPM_BUILD_ROOT%{_sysconfdir}/pear.conf'),17)));"
f2c4aa5
66a2bd1
install -m 644 -c %{SOURCE4} LICENSE-XML_RPC
66a2bd1
d4b666e
install -m 644 -c %{SOURCE13} \
d4b666e
           $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.pear     
f2c4aa5
6fb06dc
# apply patches on installed PEAR tree
3c2619d
pushd $RPM_BUILD_ROOT%{peardir} 
6fb06dc
# -- no patch
3c2619d
popd
f98fc6f
d4b666e
# Why this file here ?
d4b666e
rm -rf $RPM_BUILD_ROOT/.depdb* $RPM_BUILD_ROOT/.lock $RPM_BUILD_ROOT/.channels $RPM_BUILD_ROOT/.filemap
21dfe00
3c2619d
# Need for re-registrying XML_Util
3c2619d
install -m 644 XML_Util.xml $RPM_BUILD_ROOT%{peardir}/.pkgxml/
3c2619d
3c2619d
f2c4aa5
%check
cbe20f7
# Check that no bogus paths are left in the configuration, or in
cbe20f7
# the generated registry files.
f2c4aa5
grep $RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
9178c0f
grep %{_libdir} $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
7550ac1
grep '"/tmp"' $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
cbe20f7
grep /usr/local $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf && exit 1
cbe20f7
grep -rl $RPM_BUILD_ROOT $RPM_BUILD_ROOT && exit 1
f2c4aa5
3c2619d
f2c4aa5
%clean
f2c4aa5
rm -rf $RPM_BUILD_ROOT
d4b666e
rm new-pear.conf
f2c4aa5
3c2619d
3c2619d
%triggerpostun -- php-pear-XML-Util
3c2619d
# re-register extension unregistered during postun of obsoleted php-pear-XML-Util
3c2619d
%{_bindir}/pear install --nodeps --soft --force --register-only %{pear_xmldir}/XML_Util.xml >/dev/null || :
3c2619d
3c2619d
f2c4aa5
%files
f2c4aa5
%defattr(-,root,root,-)
f2c4aa5
%{peardir}
f2c4aa5
%{_bindir}/*
30e6e23
%config(noreplace) %{_sysconfdir}/pear.conf
7aebec6
%config %{_sysconfdir}/rpm/macros.pear
49ab520
%dir %{_localstatedir}/cache/php-pear
3c2619d
%dir %{_localstatedir}/www/html
2853f62
%dir %{_sysconfdir}/pear
f2efa72
%doc README* LICENSE*
65cf09f
%dir %{_docdir}/pear
65cf09f
%doc %{_docdir}/pear/*
f2c4aa5
3c2619d
f2c4aa5
%changelog
40f9b86
* Fri Jun 10 2011 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.3-2
40f9b86
- fix pecl launcher
40f9b86
a947c82
* Fri Jun 10 2011 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.3-1
a947c82
- update to 1.9.3
a947c82
- sync options in launcher (pecl, pear, peardev) with upstream
a947c82
65cf09f
* Wed Mar 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.2-3
65cf09f
- move %%{pear_docdir} to %%{_docdir}/pear
65cf09f
  https://fedorahosted.org/fpc/ticket/69
65cf09f
9daa490
* Tue Mar  8 2011 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.2-2
9daa490
- update Console_Getopt to 1.3.1 (no change)
9daa490
c036b89
* Mon Feb 28 2011 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.2-1
c036b89
- update to 1.9.2 (bug + security fix)
c036b89
  http://pear.php.net/advisory-20110228.txt
c036b89
c86d307
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.9.1-7
c86d307
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c86d307
e598df7
* Sun Dec 12 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.1-6
e598df7
- update Console_Getopt to 1.3.0
e598df7
- don't require php-devel (#657812)
e598df7
- update install-pear.php
e598df7
bee08ed
* Tue Oct 26 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.1-5
bee08ed
- update Structures_Graph to 1.0.4
bee08ed
66a2bd1
* Fri Sep 10 2010 Joe Orton <jorton@redhat.com> - 1:1.9.1-4
66a2bd1
- ship LICENSE file for XML_RPC
66a2bd1
7d74d03
* Fri Sep 10 2010 Joe Orton <jorton@redhat.com> - 1:1.9.1-3
7d74d03
- require php-devel (without which pecl doesn't work)
7d74d03
c0116c6
* Mon Jul 05 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.1-2
c0116c6
- update to XML_RPC-1.5.4
c0116c6
e673091
* Thu May 27 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.1-1
e673091
- update to 1.9.1
e673091
8c9c36c
* Thu Apr 29 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.0-5
8c9c36c
- update to Archive_Tar-1.3.7 (only metadata fix)
8c9c36c
43f73ef
* Tue Mar 09 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.0-4
43f73ef
- update to Archive_Tar-1.3.6
43f73ef
5d3e81f
* Sat Jan 16 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.0-3
f2efa72
- update to XML_RPC-1.5.3
f2efa72
- fix licenses (multiple)
f2efa72
- provide bundled LICENSE files
f2efa72
17e6e44
* Fri Jan 01 2010 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.0-2
17e6e44
- update to Archive_Tar-1.3.5, Structures_Graph-1.0.3
17e6e44
5a315a6
* Sat Sep 05 2009 Remi Collet <Fedora@FamilleCollet.com> 1:1.9.0-1
5a315a6
- update to PEAR 1.9.0, XML_RPC 1.5.2
5a315a6
9b06c4f
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.8.1-2
9b06c4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
9b06c4f
3c2619d
* Sat May 30 2009 Remi Collet <Fedora@FamilleCollet.com> 1:1.8.1-1
3c2619d
- update to 1.8.1
3c2619d
- Update install-pear.php script (1.39)
3c2619d
- add XML_Util
3c2619d
5bc3a2e
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:1.7.2-3
5bc3a2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
5bc3a2e
b750e1c
* Sun May 18 2008 Remi Collet <Fedora@FamilleCollet.com> 1:1.7.2-2
b750e1c
- revert to install-pear.php script 1.31 (for cfg_dir)
b750e1c
eea87a2
* Sun May 18 2008 Remi Collet <Fedora@FamilleCollet.com> 1:1.7.2-1
eea87a2
- update to 1.7.2
eea87a2
- Update install-pear.php script (1.32)
eea87a2
2853f62
* Tue Mar 11 2008 Tim Jackson <rpm@timj.co.uk> 1:1.7.1-2
3c2619d
- Set cfg_dir to be %%{_sysconfdir}/pear (and own it)
2853f62
- Update install-pear.php script
2853f62
- Add %%pear_cfgdir and %%pear_wwwdir macros
2853f62
115cca0
* Sun Feb  3 2008 Remi Collet <Fedora@FamilleCollet.com> 1:1.7.1-1
115cca0
- update to 1.7.1
115cca0
7377411
* Fri Feb  1 2008 Remi Collet <Fedora@FamilleCollet.com> 1:1.7.0-1
7377411
- update to 1.7.0
7377411
932b842
* Thu Oct  4 2007 Joe Orton <jorton@redhat.com> 1:1.6.2-2
932b842
- require php-cli not php
932b842
6fb06dc
* Sun Sep  9 2007 Remi Collet <Fedora@FamilleCollet.com> 1:1.6.2-1
6fb06dc
- update to 1.6.2
6fb06dc
- remove patches merged upstream
6fb06dc
- Fix : "pear install" hangs on non default channel (#283401)
6fb06dc
e05e7ea
* Tue Aug 21 2007 Joe Orton <jorton@redhat.com> 1:1.6.1-2
e05e7ea
- fix License
e05e7ea
d4b666e
* Thu Jul 19 2007 Remi Collet <Fedora@FamilleCollet.com> 1:1.6.1-1
d4b666e
- update to PEAR-1.6.1 and Console_Getopt-1.2.3
d4b666e
d4b666e
* Thu Jul 19 2007 Remi Collet <Fedora@FamilleCollet.com> 1:1.5.4-5
d4b666e
- new SPEC using install-pear.php instead of install-pear-nozlib-1.5.4.phar
d4b666e
3ed1b7d
* Mon Jul 16 2007 Remi Collet <Fedora@FamilleCollet.com> 1:1.5.4-4
3ed1b7d
- update macros.pear (without define)
3ed1b7d
5bb29ca
* Mon Jul 16 2007 Joe Orton <jorton@redhat.com> 1:1.5.4-3
5bb29ca
- add pecl_{un,}install macros to macros.pear (from Remi)
5bb29ca
582fcef
* Fri May 11 2007 Joe Orton <jorton@redhat.com> 1:1.5.4-2
582fcef
- update to 1.5.4
582fcef
5215bfd
* Tue Mar  6 2007 Joe Orton <jorton@redhat.com> 1:1.5.0-3
5215bfd
- add redundant build section (#226295)
5215bfd
- BR php-cli not php (#226295)
5215bfd
780e0ef
* Mon Feb 19 2007 Joe Orton <jorton@redhat.com> 1:1.5.0-2
780e0ef
- update builtin module provides (Remi Collet, #226295)
780e0ef
- drop patch 0
780e0ef
fa2f675
* Thu Feb 15 2007 Joe Orton <jorton@redhat.com> 1:1.5.0-1
fa2f675
- update to 1.5.0
fa2f675
30e6e23
* Mon Feb  5 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-4
30e6e23
- fix Group, mark pear.conf noreplace (#226295)
30e6e23
cbe20f7
* Mon Feb  5 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-3
cbe20f7
- use BuildArch not BuildArchitectures (#226925)
cbe20f7
- fix to use preferred BuildRoot (#226925)
cbe20f7
- strip more buildroot-relative paths from *.reg
9894d03
- force correct gpg path in default pear.conf
cbe20f7
7550ac1
* Thu Jan  4 2007 Joe Orton <jorton@redhat.com> 1:1.4.11-2
7550ac1
- update to 1.4.11
7550ac1
7aebec6
* Fri Jul 14 2006 Joe Orton <jorton@redhat.com> 1:1.4.9-4
7aebec6
- update to XML_RPC-1.5.0
7aebec6
- really package macros.pear
7aebec6
21dfe00
* Thu Jul 13 2006 Joe Orton <jorton@redhat.com> 1:1.4.9-3
21dfe00
- require php-cli
21dfe00
- add /etc/rpm/macros.pear (Christopher Stone)
21dfe00
2f9a8bc
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1:1.4.9-2.1
2f9a8bc
- rebuild
2f9a8bc
f98fc6f
* Mon May  8 2006 Joe Orton <jorton@redhat.com> 1:1.4.9-2
f98fc6f
- update to 1.4.9 (thanks to Remi Collet, #183359)
f98fc6f
- package /usr/share/pear/.pkgxml (#190252)
f98fc6f
- update to XML_RPC-1.4.8
f98fc6f
- bundle the v3.0 LICENSE file
f98fc6f
49ab520
* Tue Feb 28 2006 Joe Orton <jorton@redhat.com> 1:1.4.6-2
49ab520
- set cache_dir directory, own /var/cache/php-pear
49ab520
cc0d744
* Mon Jan 30 2006 Joe Orton <jorton@redhat.com> 1:1.4.6-1
cc0d744
- update to 1.4.6
cc0d744
- require php >= 5.1.0 (#178821)
cc0d744
83fab8f
* Fri Dec 30 2005 Tim Jackson <tim@timj.co.uk> 1:1.4.5-6
83fab8f
- Patches to fix "pear makerpm"
83fab8f
9178c0f
* Wed Dec 14 2005 Joe Orton <jorton@redhat.com> 1:1.4.5-5
9178c0f
- set default sig_keydir to /etc/pearkeys
9178c0f
- remove ext_dir setting from /etc/pear.conf (#175673)
9178c0f
d58f42d
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
d58f42d
- rebuilt
d58f42d
977b82d
* Tue Dec  6 2005 Joe Orton <jorton@redhat.com> 1:1.4.5-4
977b82d
- fix virtual provide for PEAR package (#175074)
977b82d
c4b9d17
* Sun Dec  4 2005 Joe Orton <jorton@redhat.com> 1:1.4.5-3
c4b9d17
- fix /usr/bin/{pecl,peardev} (#174882)
c4b9d17
b5bac4b
* Thu Dec  1 2005 Joe Orton <jorton@redhat.com> 1:1.4.5-2
b5bac4b
- add virtual provides (#173806) 
b5bac4b
f2c4aa5
* Wed Nov 23 2005 Joe Orton <jorton@redhat.com> 1.4.5-1
f2c4aa5
- initial build (Epoch: 1 to allow upgrade from php-pear-5.x)