2 # - bootstrap fails if /usr/share/pear/.lock doesn't exist (just create it as 644)
3 # - should understand as php extension (php-pear-Auth):
4 # pear/Auth can optionally use package "pecl/vpopmail" (version >= 0.2)
5 # pear/Auth can optionally use package "pecl/kadm5" (version >= 0.2.3)
8 %bcond_with FHS # writable files in /var/lib/pear. NEEDS LOTS OF PATCHING AND CONVINCING UPSTREAM
11 # - macros needed to build this package are in SOURCES/php-pear-build-macros@DEVEL
13 %define _status stable
14 %define _pearname %{_class}
16 %include /usr/lib/rpm/macros.php
17 Summary: PEAR Base System
18 Summary(pl.UTF-8): Podstawowy system PEAR
19 Name: php-pear-%{_pearname}
24 Group: Development/Languages/PHP
25 Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
26 # Source0-md5: 1476f0ec3917d68e3d7af1346a9a7b89
27 Source1: http://pear.php.net/get/Console_Getopt-1.2.tgz
28 # Source1-md5: 8f9ec8253c04350bc01ee7ca941e24b6
29 Source2: http://pear.php.net/get/Structures_Graph-1.0.2.tgz
30 # Source2-md5: 2664e2d024048f982e12fad4d1bfbb87
31 Patch0: %{name}-sysconfdir.patch
32 Patch5: %{name}-FHS.patch
33 URL: http://pear.php.net/package/PEAR
34 BuildRequires: /usr/bin/php
35 BuildRequires: php(pcre)
36 BuildRequires: php(xml)
37 BuildRequires: rpm-php-pearprov >= 4.4.2-30.1
38 BuildRequires: rpmbuild(macros) >= 1.375
39 Requires: %{name}-core = %{epoch}:%{version}-%{release}
40 Requires: /usr/bin/php
44 Requires: php-pear >= 4:1.0-14
45 Requires: php-pear-Archive_Tar >= 1.1
46 Requires: php-pear-Console_Getopt >= 1.2
47 Requires: php-pear-Structures_Graph >= 1.0.2
48 Obsoletes: php-pear-PEAR-Command
49 Obsoletes: php-pear-PEAR-Frontend-CLI
50 Obsoletes: php-pear-PEAR-OS
51 #Suggests: php-pear-Net_FTP
52 Conflicts: php-pear-Archive_Tar = 1.3.0
53 Conflicts: php-pear-PEAR_Frontend_Gtk < 0.4.0
54 Conflicts: php-pear-PEAR_Frontend_Web < 0.5.0
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 # PEAR_Command_Packaging is separate package
59 %define _noautoreq 'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
61 %define _statedir /var/lib/pear
62 %define _registrydir %{_statedir}/registry
63 %define _channelsdir %{_statedir}/.channels
65 %define _statedir %{php_pear_dir}
66 %define _registrydir %{_statedir}/.registry
67 %define _channelsdir %{_statedir}/.channels
71 The PEAR package contains:
72 - the PEAR installer, for creating, distributing and installing
74 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
75 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
76 - the PEAR_Error error handling mechanism
77 - the OS_Guess class for retrieving info about the OS where PHP is
79 - the System class for quick handling of common operations with files
81 - the PEAR base class packages
83 In PEAR status of this package is: %{_status}.
85 %description -l pl.UTF-8
87 - PEAR installer do tworzenia, dystrybucji i instalowania pakietów,
88 - mechanizm PEAR_Exception (w fazie alpha) do obsługi błędów PHP5,
89 - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obsługi
91 - mechanizm obsługi błędów PEAR_Error,
92 - klasę OS_Guess do pozyskiwania informacji na temat systemu
94 - klasę System do szybkiej obsługi typowych operacji na plikach i
96 - podstawową klasy PEAR.
98 Ta klasa ma w PEAR status: %{_status}.
101 Summary: PEAR core classes
102 Summary(pl.UTF-8): Główne klasy PEAR-a
103 Group: Development/Languages/PHP
106 This package includes PEAR core classes:
107 - PEAR class and PEAR_Error
110 and classes for PHP 5:
111 - PEAR_ErrorStack and PEAR_Exception
113 %description core -l pl.UTF-8
114 Ten pakiet zawiera główne klasy PEAR-a:
115 - klasę PEAR i PEAR_Error
118 oraz klasy dla PHP 5:
119 - PEAR_ErrorStack i PEAR_Exception
122 %define __build_dir %{_builddir}/%{_class}-%{version}%{?_rc}
123 %define __php_include_path %{__build_dir}/%{_class}-%{version}%{?_rc}:%{__build_dir}/%(basename %{SOURCE1} .tgz):%{__build_dir}/%(basename %{SOURCE2} .tgz)
124 %define __pear php -dmemory_limit=-1 -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_class}-%{version}%{?_rc}/scripts/pearcmd.php
126 %setup -q -c -n %{_pearname}-%{version} -a1 -a2
127 %pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc}
130 %{?with_FHS:%patch5 -p1}
132 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
137 %{__pear} -c ${D}/pearrc "$@"
139 pearcmd config-set doc_dir %{_docdir} || exit
140 pearcmd config-set data_dir %{php_pear_dir}/data || exit
141 pearcmd config-set php_dir %{php_pear_dir} || exit
142 pearcmd config-set test_dir %{php_pear_dir}/tests || exit
143 pearcmd config-set sig_bin %{_bindir}/gpg || exit
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{php_pear_dir},%{_bindir}}
148 %pear_package_install
149 cp pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
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}/*
180 if [ ! -L %{php_pear_dir}/.registry ]; then
181 if [ -d %{php_pear_dir}/.registry ]; then
182 install -d %{_registrydir}
183 mv -f %{php_pear_dir}/.registry/*.reg %{_registrydir}
184 rmdir %{php_pear_dir}/.registry/.channel.* 2>/dev/null
185 rmdir %{php_pear_dir}/.registry/* 2>/dev/null
186 rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
188 ln -s %{_registrydir} %{php_pear_dir}/.registry
192 if [ ! -f %{php_pear_dir}/.lock ]; then
194 %{_bindir}/pear list > /dev/null
197 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
198 cat %{_docdir}/%{name}-%{version}/optional-packages.txt
202 rm -rf $RPM_BUILD_ROOT
205 %defattr(644,root,root,755)
206 %doc install.log optional-packages.txt
207 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
208 %attr(755,root,root) %{_bindir}/*
209 %{php_pear_dir}/.registry/pear.reg
210 %{php_pear_dir}/pearcmd.php
211 %{php_pear_dir}/peclcmd.php
212 %{php_pear_dir}/PEAR/[!CE]*
213 %{php_pear_dir}/PEAR/ChannelFile*
214 %{php_pear_dir}/PEAR/Command*
215 %{php_pear_dir}/PEAR/Config.php
216 %{php_pear_dir}/PEAR/Common.php
218 %{php_pear_dir}/data/*
223 %ghost %dir %{php_pear_dir}/.registry
226 %dir %{_channelsdir}/.alias
228 %ghost %{_channelsdir}/.alias/pear.txt
229 %ghost %{_channelsdir}/.alias/pecl.txt
230 %ghost %{_channelsdir}/pear.php.net.reg
231 %ghost %{_channelsdir}/pecl.php.net.reg
232 %ghost %{_channelsdir}/__uri.reg
233 %ghost %{_registrydir}/.channel.__uri
234 %ghost %{_registrydir}/.channel.pecl.php.net
235 %ghost %{_statedir}/.depdblock
236 %ghost %{_statedir}/.depdb
237 %ghost %{php_pear_dir}/.filemap
238 %ghost %{php_pear_dir}/.lock
241 %defattr(644,root,root,755)
242 %{php_pear_dir}/PEAR.php
243 %{php_pear_dir}/System.php
245 %dir %{php_pear_dir}/PEAR
246 %{php_pear_dir}/PEAR/ErrorStack.php
247 %{php_pear_dir}/PEAR/Exception.php