2 # - macros needed to build this package are in SOURCES/php-pear-build-macros@DEVEL
5 %define _pearname %{_class}
7 %include /usr/lib/rpm/macros.php
8 %include %{_sourcedir}/php-pear-build-macros
9 Summary: PEAR Base System
10 Summary(pl): Podstawowy system PEAR
11 Name: php-pear-%{_pearname}
16 Group: Development/Languages/PHP
17 Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
18 # Source0-md5: 1b47f9df911b149d0e9a6630fc9b7da7
19 Source1: http://pear.php.net/get/Console_Getopt-1.2.tgz
20 # Source1-md5: 8f9ec8253c04350bc01ee7ca941e24b6
21 Source2: %{name}-template.spec
22 Patch0: %{name}-sysconfdir.patch
23 Patch1: %{name}-rpmpkgname.patch
24 Patch2: %{name}-rpmvars.patch
25 Patch3: %{name}-old-api.patch
26 Patch4: %{name}-specfile.patch
27 Patch5: %{name}-FHS.patch
28 URL: http://pear.php.net/package/PEAR
29 BuildRequires: php-cli
30 BuildRequires: rpm-php-pearprov >= 4.4.2-30.1
31 BuildRequires: rpmbuild(macros) >= 1.300
32 %{!?debug:BuildRequires: package-not-usable}
33 Requires: %{name}-core = %{epoch}:%{version}-%{release}
34 Requires: /usr/bin/php
36 Requires: php-pear >= 4:1.0-14
37 Requires: php-pear-Archive_Tar >= 1.1
38 Requires: php-pear-Console_Getopt >= 1.2
41 Obsoletes: php-pear-PEAR-Command
42 Obsoletes: php-pear-PEAR-Frontend-CLI
43 Obsoletes: php-pear-PEAR-OS
44 #Suggests: php-pear-Net_FTP
45 Conflicts: php-pear-Archive_Tar = 1.3.0
46 Conflicts: php-pear-PEAR_Frontend_Gtk < 0.4.0
47 Conflicts: php-pear-PEAR_Frontend_Web < 0.5.0
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 # PEAR_Command_Packaging is separate package
52 %define _noautoreq 'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
53 %define _statedir /var/lib/pear
54 %define pear_registry %{_statedir}/registry
57 The PEAR package contains:
58 - the PEAR installer, for creating, distributing and installing
60 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
61 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
62 - the PEAR_Error error handling mechanism
63 - the OS_Guess class for retrieving info about the OS where PHP is
65 - the System class for quick handling of common operations with files
67 - the PEAR base class packages
69 In PEAR status of this package is: %{_status}.
73 - PEAR installer do tworzenia, dystrybucji i instalowania pakietów,
74 - mechanizm PEAR_Exception (w fazie alpha) do obs³ugi b³êdów PHP5,
75 - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obs³ugi
77 - mechanizm obs³ugi b³êdów PEAR_Error,
78 - klasê OS_Guess do pozyskiwania informacji na temat systemu
80 - klasê System do szybkiej obs³ugi typowych operacji na plikach i
82 - podstawow± klasy PEAR.
84 Ta klasa ma w PEAR status: %{_status}.
87 Summary: PEAR core classes
88 Summary(pl): G³ówne klasy PEAR-a
89 Group: Development/Languages/PHP
92 This package includes PEAR core classes:
93 - PEAR class and PEAR_Error
96 and classes for PHP 5:
97 - PEAR_ErrorStack and PEAR_Exception
99 %description core -l pl
100 Ten pakiet zawiera g³ówne klasy PEAR-a:
101 - klasê PEAR i PEAR_Error
104 oraz klasy dla PHP 5:
105 - PEAR_ErrorStack i PEAR_Exception
108 %define __build_dir %{_builddir}/%{_class}-%{version}
109 %define __php_include_path %{__build_dir}/%{_class}-%{version}:%{__build_dir}/%(basename %{SOURCE1} .tgz)
110 %define __pear php -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_class}-%{version}/scripts/pearcmd.php
111 %pear_package_setup -z -a1
120 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
123 rm -rf $RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{php_pear_dir},%{_bindir}}
128 %{__pear} -c ${D}/pearrc "$@"
130 pearcmd config-set doc_dir %{_docdir} || exit
131 pearcmd config-set data_dir %{php_pear_dir}/data || exit
132 pearcmd config-set php_dir %{php_pear_dir} || exit
133 pearcmd config-set test_dir %{php_pear_dir}/tests || exit
134 pearcmd config-set sig_bin %{_bindir}/gpg || exit
135 cp $D/pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
137 %pear_package_install
139 install -d $RPM_BUILD_ROOT%{_statedir}/channels/.alias
140 install -d $RPM_BUILD_ROOT%{pear_registry}/{.channel.{__uri,pecl.php.net},channels/.alias}
141 touch $RPM_BUILD_ROOT%{_statedir}/.depdb{,lock}
142 touch $RPM_BUILD_ROOT%{_statedir}/channels/{__uri,{pear,pecl}.php.net}.reg
143 touch $RPM_BUILD_ROOT%{_statedir}/channels/.alias/{pear,pecl}.txt
144 touch $RPM_BUILD_ROOT%{php_pear_dir}/.filemap
145 touch $RPM_BUILD_ROOT%{php_pear_dir}/.lock
147 # -C and -q options were for php-cgi, in php-cli they're enabled by default.
148 %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
149 cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF'
151 %php_exec -dopen_basedir="" -dmemory_limit=24M %{php_pear_dir}/pearcmd.php "$@"
153 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
155 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
157 # This -dextension=pcre.so works with php-5.1, and patched php-cli >= 4:5.0.5-18.1, php4-cli >= 3:4.4.1-6.1
158 # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries.
159 cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF'
161 %php_exec -dmemory_limit=24M -dsafe_mode=0 -n -dextension=pcre.so -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
163 # for rpm to find interpreter
164 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
166 sed -e '/^\$''Log: /,$d' %{SOURCE2} > $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
167 echo '$''Log: $' >> $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
170 if [ ! -L %{php_pear_dir}/.registry ]; then
171 if [ -d %{php_pear_dir}/.registry ]; then
172 install -d %{pear_registry}
173 mv -f %{php_pear_dir}/.registry/*.reg %{pear_registry}
174 rmdir %{php_pear_dir}/.registry/.channel.* 2>/dev/null
175 rmdir %{php_pear_dir}/.registry/* 2>/dev/null
176 rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
178 ln -s %{pear_registry} %{php_pear_dir}/.registry
181 if [ ! -f %{php_pear_dir}/.lock ]; then
183 %{_bindir}/pear list > /dev/null
185 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
186 cat %{_docdir}/%{name}-%{version}/optional-packages.txt
190 rm -rf $RPM_BUILD_ROOT
193 %defattr(644,root,root,755)
194 %doc install.log optional-packages.txt
195 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
196 %attr(755,root,root) %{_bindir}/*
197 %{php_pear_dir}/.registry/pear.reg
198 %{php_pear_dir}/pearcmd.php
199 %{php_pear_dir}/peclcmd.php
200 %{php_pear_dir}/PEAR/[!CE]*
201 %{php_pear_dir}/PEAR/ChannelFile*
202 %{php_pear_dir}/PEAR/Command*
203 %{php_pear_dir}/PEAR/Config.php
204 %{php_pear_dir}/PEAR/Common.php
206 %{php_pear_dir}/data/*
209 %dir %{_statedir}/channels
210 %dir %{_statedir}/registry
211 %dir %{_statedir}/channels/.alias
213 %ghost %{_statedir}/channels/.alias/pear.txt
214 %ghost %{_statedir}/channels/.alias/pecl.txt
215 %ghost %{_statedir}/channels/pear.php.net.reg
216 %ghost %{_statedir}/channels/pecl.php.net.reg
217 %ghost %{_statedir}/channels/__uri.reg
218 %ghost %{_statedir}/registry/.channel.__uri
219 %ghost %{_statedir}/registry/.channel.pecl.php.net
220 %ghost %{_statedir}/.depdblock
221 %ghost %{_statedir}/.depdb
222 %ghost %{php_pear_dir}/.filemap
223 %ghost %{php_pear_dir}/.lock
224 %ghost %dir %{php_pear_dir}/.registry
227 %defattr(644,root,root,755)
228 %{php_pear_dir}/PEAR.php
229 %{php_pear_dir}/System.php
231 %dir %{php_pear_dir}/PEAR
232 %{php_pear_dir}/PEAR/ErrorStack.php
233 %{php_pear_dir}/PEAR/Exception.php