3 %bcond_with FHS # writable files in /var/lib/pear. NEEDS LOTS OF PATCHING AND CONVINCING UPSTREAM
6 # - macros needed to build this package are in SOURCES/php-pear-build-macros@DEVEL
9 %define _pearname %{_class}
12 %include /usr/lib/rpm/macros.php
13 %include %{_sourcedir}/php-pear-build-macros
14 Summary: PEAR Base System
15 Summary(pl): Podstawowy system PEAR
16 Name: php-pear-%{_pearname}
21 Group: Development/Languages/PHP
22 Source0: http://pear.php.net/get/%{_pearname}-%{version}%{_rc}.tgz
23 # Source0-md5: 8f0699f4cf138ac9c6c98a9a9d09133d
24 Source1: http://pear.php.net/get/Console_Getopt-1.2.tgz
25 # Source1-md5: 8f9ec8253c04350bc01ee7ca941e24b6
26 Source2: %{name}-template.spec
27 Patch0: %{name}-sysconfdir.patch
28 Patch1: %{name}-rpmpkgname.patch
29 Patch2: %{name}-rpmvars.patch
30 Patch3: %{name}-old-api.patch
31 Patch4: %{name}-specfile.patch
32 Patch5: %{name}-FHS.patch
33 URL: http://pear.php.net/package/PEAR
34 BuildRequires: php-cli
35 BuildRequires: rpm-php-pearprov >= 4.4.2-30.1
36 BuildRequires: rpmbuild(macros) >= 1.300
37 %{!?debug:BuildRequires: package-not-usable}
38 Requires: %{name}-core = %{epoch}:%{version}-%{release}
39 Requires: /usr/bin/php
41 Requires: php-pear >= 4:1.0-14
42 Requires: php-pear-Archive_Tar >= 1.1
43 Requires: php-pear-Console_Getopt >= 1.2
46 Obsoletes: php-pear-PEAR-Command
47 Obsoletes: php-pear-PEAR-Frontend-CLI
48 Obsoletes: php-pear-PEAR-OS
49 #Suggests: php-pear-Net_FTP
50 Conflicts: php-pear-Archive_Tar = 1.3.0
51 Conflicts: php-pear-PEAR_Frontend_Gtk < 0.4.0
52 Conflicts: php-pear-PEAR_Frontend_Web < 0.5.0
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 # PEAR_Command_Packaging is separate package
57 %define _noautoreq 'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
59 %define _statedir /var/lib/pear
60 %define _registrydir %{_statedir}/registry
61 %define _channelsdir %{_statedir}/.channels
63 %define _statedir %{php_pear_dir}
64 %define _registrydir %{_statedir}/.registry
65 %define _channelsdir %{_statedir}/.channels
69 The PEAR package contains:
70 - the PEAR installer, for creating, distributing and installing
72 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
73 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
74 - the PEAR_Error error handling mechanism
75 - the OS_Guess class for retrieving info about the OS where PHP is
77 - the System class for quick handling of common operations with files
79 - the PEAR base class packages
81 In PEAR status of this package is: %{_status}.
85 - PEAR installer do tworzenia, dystrybucji i instalowania pakietów,
86 - mechanizm PEAR_Exception (w fazie alpha) do obs³ugi b³êdów PHP5,
87 - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obs³ugi
89 - mechanizm obs³ugi b³êdów PEAR_Error,
90 - klasê OS_Guess do pozyskiwania informacji na temat systemu
92 - klasê System do szybkiej obs³ugi typowych operacji na plikach i
94 - podstawow± klasy PEAR.
96 Ta klasa ma w PEAR status: %{_status}.
99 Summary: PEAR core classes
100 Summary(pl): G³ówne klasy PEAR-a
101 Group: Development/Languages/PHP
104 This package includes PEAR core classes:
105 - PEAR class and PEAR_Error
108 and classes for PHP 5:
109 - PEAR_ErrorStack and PEAR_Exception
111 %description core -l pl
112 Ten pakiet zawiera g³ówne klasy PEAR-a:
113 - klasê PEAR i PEAR_Error
116 oraz klasy dla PHP 5:
117 - PEAR_ErrorStack i PEAR_Exception
120 %define __build_dir %{_builddir}/%{_class}-%{version}%{?_rc}
121 %define __php_include_path %{__build_dir}/%{_class}-%{version}%{?_rc}:%{__build_dir}/%(basename %{SOURCE1} .tgz)
122 %define __pear php -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_class}-%{version}%{?_rc}/scripts/pearcmd.php
123 %pear_package_setup -z -a1 -n %{_pearname}-%{version}%{?_rc}
132 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{php_pear_dir},%{_bindir}}
140 %{__pear} -c ${D}/pearrc "$@"
142 pearcmd config-set doc_dir %{_docdir} || exit
143 pearcmd config-set data_dir %{php_pear_dir}/data || exit
144 pearcmd config-set php_dir %{php_pear_dir} || exit
145 pearcmd config-set test_dir %{php_pear_dir}/tests || exit
146 pearcmd config-set sig_bin %{_bindir}/gpg || exit
147 cp $D/pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
149 %pear_package_install
151 install -d $RPM_BUILD_ROOT%{_channelsdir}/.alias
152 install -d $RPM_BUILD_ROOT%{_registrydir}/{.channel.{__uri,pecl.php.net},channels/.alias}
153 touch $RPM_BUILD_ROOT%{_statedir}/.depdb{,lock}
154 touch $RPM_BUILD_ROOT%{_channelsdir}/{__uri,{pear,pecl}.php.net}.reg
155 touch $RPM_BUILD_ROOT%{_channelsdir}/.alias/{pear,pecl}.txt
156 touch $RPM_BUILD_ROOT%{php_pear_dir}/.filemap
157 touch $RPM_BUILD_ROOT%{php_pear_dir}/.lock
159 # -C and -q options were for php-cgi, in php-cli they're enabled by default.
160 %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
161 cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF'
163 %php_exec -dopen_basedir="" -dmemory_limit=24M %{php_pear_dir}/pearcmd.php "$@"
165 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
167 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
169 # 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
170 # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries.
171 cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF'
173 %php_exec -dmemory_limit=24M -dsafe_mode=0 -n -dextension=pcre.so -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
175 # for rpm to find interpreter
176 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
178 sed -e '/^\$''Log: /,$d' %{SOURCE2} > $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
179 echo '$''Log: $' >> $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
183 if [ ! -L %{php_pear_dir}/.registry ]; then
184 if [ -d %{php_pear_dir}/.registry ]; then
185 install -d %{_registrydir}
186 mv -f %{php_pear_dir}/.registry/*.reg %{_registrydir}
187 rmdir %{php_pear_dir}/.registry/.channel.* 2>/dev/null
188 rmdir %{php_pear_dir}/.registry/* 2>/dev/null
189 rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
191 ln -s %{_registrydir} %{php_pear_dir}/.registry
195 if [ ! -f %{php_pear_dir}/.lock ]; then
197 %{_bindir}/pear list > /dev/null
200 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
201 cat %{_docdir}/%{name}-%{version}/optional-packages.txt
205 rm -rf $RPM_BUILD_ROOT
208 %defattr(644,root,root,755)
209 %doc install.log optional-packages.txt
210 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
211 %attr(755,root,root) %{_bindir}/*
212 %{php_pear_dir}/.registry/pear.reg
213 %{php_pear_dir}/pearcmd.php
214 %{php_pear_dir}/peclcmd.php
215 %{php_pear_dir}/PEAR/[!CE]*
216 %{php_pear_dir}/PEAR/ChannelFile*
217 %{php_pear_dir}/PEAR/Command*
218 %{php_pear_dir}/PEAR/Config.php
219 %{php_pear_dir}/PEAR/Common.php
221 %{php_pear_dir}/data/*
226 %ghost %dir %{php_pear_dir}/.registry
229 %dir %{_channelsdir}/.alias
231 %ghost %{_channelsdir}/.alias/pear.txt
232 %ghost %{_channelsdir}/.alias/pecl.txt
233 %ghost %{_channelsdir}/pear.php.net.reg
234 %ghost %{_channelsdir}/pecl.php.net.reg
235 %ghost %{_channelsdir}/__uri.reg
236 %ghost %{_registrydir}/.channel.__uri
237 %ghost %{_registrydir}/.channel.pecl.php.net
238 %ghost %{_statedir}/.depdblock
239 %ghost %{_statedir}/.depdb
240 %ghost %{php_pear_dir}/.filemap
241 %ghost %{php_pear_dir}/.lock
244 %defattr(644,root,root,755)
245 %{php_pear_dir}/PEAR.php
246 %{php_pear_dir}/System.php
248 %dir %{php_pear_dir}/PEAR
249 %{php_pear_dir}/PEAR/ErrorStack.php
250 %{php_pear_dir}/PEAR/Exception.php