1 %include /usr/lib/rpm/macros.php
4 %define _pearname %{_class}
6 Summary: PEAR Base System
7 Summary(pl): %{_pearname} - podstawowa klasa dla PHP PEAR
8 Name: php-pear-%{_pearname}
13 Group: Development/Languages/PHP
14 Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
15 # Source0-md5: 4d29453e1926f11e05b7cfbf4ab085e7
16 Source1: %{name}-template.spec
17 Patch0: %{name}-sysconfdir.patch
18 Patch1: %{name}-rpmpkgname.patch
19 Patch2: %{name}-rpmvars.patch
20 Patch3: %{name}-old-api.patch
21 Patch4: %{name}-specfile.patch
22 Patch5: %{name}-FHS.patch
23 URL: http://pear.php.net/package/PEAR
24 BuildRequires: php-cli
25 BuildRequires: php-pear >= 4:1.0-12.3
26 BuildRequires: rpm-php-pearprov >= 4.4.2-11
27 Requires: %{name}-core = %{epoch}:%{version}-%{release}
28 Requires: /usr/bin/php
30 Requires: php-pear >= 4:1.0-5.5
31 Requires: php-pear-Archive_Tar >= 1.1
32 Requires: php-pear-Console_Getopt >= 1.2
33 Requires: php-pear-XML_RPC >= 1.4.0
36 Obsoletes: php-pear-PEAR-Command
37 Obsoletes: php-pear-PEAR-Frontend-CLI
38 Obsoletes: php-pear-PEAR-OS
39 #Suggests: php-pear-Net_FTP
40 Conflicts: php-pear-Archive_Tar = 1.3.0
41 Conflicts: php-pear-PEAR_Frontend_Gtk < 0.4.0
42 Conflicts: php-pear-PEAR_Frontend_Web < 0.5.0
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 # PEAR_Command_Packaging is separate package
47 %define _noautoreq 'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
48 %define _statedir /var/lib/pear
51 The PEAR package contains:
52 - the PEAR installer, for creating, distributing and installing
54 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
55 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
56 - the PEAR_Error error handling mechanism
57 - the OS_Guess class for retrieving info about the OS where PHP is
59 - the System class for quick handling of common operations with files
61 - the PEAR base class packages
63 In PEAR status of this package is: %{_status}.
67 - PEAR installer do tworzenia, dystrybucji i instalowania pakietów,
68 - mechanizm PEAR_Exception (w fazie alpha) do obs³ugi b³êdów PHP5,
69 - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obs³ugi
71 - mechanizm obs³ugi b³êdów PEAR_Error,
72 - klasê OS_Guess do pozyskiwania informacji na temat systemu
74 - klasê System do szybkiej obs³ugi typowych operacji na plikach i
76 - podstawow± klasy PEAR.
78 Ta klasa ma w PEAR status: %{_status}.
81 Summary: PEAR core classes
82 Summary(pl): G³ówne klasy PEAR-a
83 Group: Development/Languages/PHP
86 This package includes PEAR core classes:
87 - PEAR class and PEAR_Error
90 and classes for PHP 5:
91 - PEAR_ErrorStack and PEAR_Exception
93 %description core -l pl
94 Ten pakiet zawiera g³ówne klasy PEAR-a:
95 - klasê PEAR i PEAR_Error
99 - PEAR_ErrorStack i PEAR_Exception
110 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
113 rm -rf $RPM_BUILD_ROOT
115 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{php_pear_dir},%{_bindir}}
119 php -doutput_buffering=1 -dinclude_path=".:${D}%{php_pear_dir}" ${D}%{php_pear_dir}/pearcmd.php -c ${D}/pearrc "$@"
121 pearcmd config-set doc_dir %{_docdir} || exit
122 pearcmd config-set data_dir %{php_pear_dir}/data || exit
123 pearcmd config-set php_dir %{php_pear_dir} || exit
124 pearcmd config-set test_dir %{php_pear_dir}/tests || exit
125 pearcmd config-set sig_bin %{_bindir}/gpg || exit
126 cp $D/pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
128 %pear_package_install
130 install -d $RPM_BUILD_ROOT%{_statedir}/{registry/.channel.{__uri,pecl.php.net},channels/.alias}
131 touch $RPM_BUILD_ROOT%{_statedir}/.depdb{,lock}
132 touch $RPM_BUILD_ROOT%{_statedir}/channels/{__uri,{pear,pecl}.php.net}.reg
133 touch $RPM_BUILD_ROOT%{_statedir}/channels/.alias/{pear,pecl}.txt
134 touch $RPM_BUILD_ROOT%{_statedir}/.filemap
135 touch $RPM_BUILD_ROOT%{_statedir}/.lock
137 # -C and -q options were for php-cgi, in php-cli they're enabled by default.
138 %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
139 cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF'
141 %php_exec -dopen_basedir="" -dmemory_limit=24M %{php_pear_dir}/pearcmd.php "$@"
143 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
145 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
147 # 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
148 # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries.
149 cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF'
151 %php_exec -dmemory_limit=24M -dsafe_mode=0 -n -dextension=pcre.so -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
153 # for rpm to find interpreter
154 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
156 sed -e '/^\$''Log: /,$d' %{SOURCE1} > $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
157 echo '$''Log: $' >> $RPM_BUILD_ROOT%{php_pear_dir}/data/%{_class}/template.spec
160 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
161 cat %{_docdir}/%{name}-%{version}/optional-packages.txt
163 if [ ! -f %{_statedir}/.lock ]; then
165 touch %{_statedir}/.lock
167 if [ ! -e %{php_pear_dir}/.registry ]; then
168 ln -s %{_statedir}/registry %{php_pear_dir}/.registry
171 %triggerpostun -- %{name} < 1:1.4.7-0.3
172 if [ ! -L %{php_pear_dir}/.registry ]; then
173 mv -f %{php_pear_dir}/.registry/*.reg %{_statedir}/registry
174 rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
175 ln -s %{_statedir}/registry %{php_pear_dir}/.registry
177 rm -f %{php_pear_dir}/.{lock,depdb*,filemap}
180 rm -rf $RPM_BUILD_ROOT
183 %defattr(644,root,root,755)
184 %doc install.log optional-packages.txt
185 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
186 %attr(755,root,root) %{_bindir}/*
187 %{php_pear_dir}/.registry/*.reg
188 %{php_pear_dir}/pearcmd.php
189 %{php_pear_dir}/peclcmd.php
190 %{php_pear_dir}/PEAR/[!CE]*
191 %{php_pear_dir}/PEAR/ChannelFile*
192 %{php_pear_dir}/PEAR/Command*
193 %{php_pear_dir}/PEAR/Config.php
194 %{php_pear_dir}/PEAR/Common.php
196 %{php_pear_dir}/data/*
198 %dir %{_statedir}/channels
199 %dir %{_statedir}/registry
200 %dir %{_statedir}/channels/.alias
202 %ghost %{_statedir}/channels/.alias/pear.txt
203 %ghost %{_statedir}/channels/.alias/pecl.txt
204 %ghost %{_statedir}/channels/pear.php.net.reg
205 %ghost %{_statedir}/channels/pecl.php.net.reg
206 %ghost %{_statedir}/channels/__uri.reg
207 %ghost %{_statedir}/registry/.channel.__uri
208 %ghost %{_statedir}/registry/.channel.pecl.php.net
209 %ghost %{_statedir}/.depdblock
210 %ghost %{_statedir}/.depdb
211 %ghost %{_statedir}/.filemap
212 %ghost %{_statedir}/.lock
215 %defattr(644,root,root,755)
216 %{php_pear_dir}/PEAR.php
217 %{php_pear_dir}/System.php
219 %dir %{php_pear_dir}/PEAR
220 %{php_pear_dir}/PEAR/ErrorStack.php
221 %{php_pear_dir}/PEAR/Exception.php