]>
Commit | Line | Data |
---|---|---|
d2be5e21 ER |
1 | # TODO |
2 | # - bootstrap fails if /usr/share/pear/.lock doesn't exist (just create it as 644) | |
40ea15bc ER |
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) | |
a3444bda | 6 | # |
ea6d0610 | 7 | %define _pearname PEAR |
4fa4231a | 8 | %define _status stable |
4754372c | 9 | %define php_name php%{?php_suffix} |
0806614e | 10 | %define php_min_version 5.4.0 |
cddf0b34 | 11 | %include /usr/lib/rpm/macros.php |
67b60318 | 12 | Summary: PEAR Base System |
1ad7de51 | 13 | Summary(pl.UTF-8): Podstawowy system PEAR |
3b2ff42f | 14 | Name: php-pear-%{_pearname} |
c2fb08c5 ER |
15 | Version: 1.10.7 |
16 | Release: 1 | |
427db215 | 17 | Epoch: 1 |
27a20faa | 18 | License: New BSD License |
3b2ff42f | 19 | Group: Development/Languages/PHP |
c2fb08c5 ER |
20 | Source0: https://pear.php.net/get/%{_pearname}-%{version}.tgz |
21 | # Source0-md5: 4ba803c2abb6eb5fa7cc8463afd633f4 | |
22 | Source1: https://pear.php.net/get/Console_Getopt-1.4.1.tgz | |
810752ac | 23 | # Source1-md5: a95c86528f910562772274eefb90ca2c |
c2fb08c5 | 24 | Source2: https://pear.php.net/get/Structures_Graph-1.1.1.tgz |
810752ac | 25 | # Source2-md5: f1be7827074c4f51eb1af245f0f7c5c4 |
75ff35d4 | 26 | Patch0: %{name}-sysconfdir.patch |
4cf8a2f7 ER |
27 | Patch1: ext-check.patch |
28 | Patch2: %{name}-FHS.patch | |
c2fb08c5 | 29 | URL: https://pear.php.net/package/PEAR |
4754372c ER |
30 | BuildRequires: %{php_name}-pcre |
31 | BuildRequires: %{php_name}-xml | |
a6ec7179 | 32 | BuildRequires: /usr/bin/php |
cddf0b34 | 33 | BuildRequires: rpm-php-pearprov >= 4.4.2-30.1 |
7a135330 | 34 | BuildRequires: rpmbuild(macros) >= 1.654 |
75ff35d4 ER |
35 | Requires: %{name}-core = %{epoch}:%{version}-%{release} |
36 | Requires: /usr/bin/php | |
9f4cd0ec | 37 | Requires: php(core) >= %{php_min_version} |
6cb5cae5 ER |
38 | Requires: php(pcre) |
39 | Requires: php(xml) | |
40 | Requires: php(zlib) | |
8066c125 | 41 | Requires: php-pear >= 4:1.2-1 |
c2fb08c5 ER |
42 | Requires: php-pear-Archive_Tar >= 1.4.0 |
43 | Requires: php-pear-Console_Getopt >= 1.4.1 | |
44 | Requires: php-pear-Structures_Graph >= 1.1.0 | |
45 | Requires: php-pear-XML_Util >= 1.3.0 | |
3c98fb18 ER |
46 | Requires: rpm-whiteout |
47 | Suggests: php-pear-Net_FTP | |
c3a3fed3 | 48 | Obsoletes: php-pear-PEAR-Command |
a086a0f4 | 49 | Obsoletes: php-pear-PEAR-Frontend_CLI |
c3a3fed3 | 50 | Obsoletes: php-pear-PEAR-OS |
ac20d0e7 | 51 | Conflicts: php-pear-PEAR_Frontend_Gtk < 0.4.0 |
0aec2823 | 52 | Conflicts: php-pear-PEAR_Frontend_Web < 0.5.0 |
3c98fb18 | 53 | Conflicts: rpm-whiteout < 1.1 |
27a20faa | 54 | Conflicts: rpmbuild(macros) < 1.563 |
3b2ff42f PG |
55 | BuildArch: noarch |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
0aec2823 | 58 | # PEAR_Command_Packaging is separate package |
8066c125 | 59 | # PEAR_FTP is optional |
7a135330 | 60 | %define _noautoreq_pear PEAR/FTP.php Net/FTP.php XML/RPC.* PEAR/Command/Packaging.php |
4d20e935 | 61 | |
3b2ff42f PG |
62 | %description |
63 | The PEAR package contains: | |
bfbd02ce ER |
64 | - the PEAR installer, for creating, distributing and installing |
65 | packages | |
c3a3fed3 AG |
66 | - the alpha-quality PEAR_Exception PHP5 error handling mechanism |
67 | - the beta-quality PEAR_ErrorStack advanced error handling mechanism | |
3b2ff42f | 68 | - the PEAR_Error error handling mechanism |
bfbd02ce ER |
69 | - the OS_Guess class for retrieving info about the OS where PHP is |
70 | running on | |
71 | - the System class for quick handling of common operations with files | |
72 | and directories | |
c3a3fed3 | 73 | - the PEAR base class packages |
3b2ff42f | 74 | |
6eedbf81 | 75 | In PEAR status of this package is: %{_status}. |
427db215 | 76 | |
438522cd | 77 | %description -l pl.UTF-8 |
3b2ff42f | 78 | Pakiet PEAR zawiara: |
438522cd JR |
79 | - PEAR installer do tworzenia, dystrybucji i instalowania pakietów, |
80 | - mechanizm PEAR_Exception (w fazie alpha) do obsługi błędów PHP5, | |
81 | - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obsługi | |
82 | błędów, | |
83 | - mechanizm obsługi błędów PEAR_Error, | |
84 | - klasę OS_Guess do pozyskiwania informacji na temat systemu | |
bfbd02ce | 85 | operacyjnego, |
438522cd | 86 | - klasę System do szybkiej obsługi typowych operacji na plikach i |
c3a3fed3 | 87 | katalogach, |
438522cd | 88 | - podstawową klasy PEAR. |
e87db111 | 89 | |
85f9c327 | 90 | Ta klasa ma w PEAR status: %{_status}. |
427db215 | 91 | |
7bfdcd27 ER |
92 | %package core |
93 | Summary: PEAR core classes | |
1ad7de51 | 94 | Summary(pl.UTF-8): Główne klasy PEAR-a |
7bfdcd27 | 95 | Group: Development/Languages/PHP |
9f4cd0ec | 96 | Requires: php(core) >= %{php_min_version} |
7bfdcd27 ER |
97 | |
98 | %description core | |
6a2638f3 | 99 | This package includes PEAR core classes: |
7bfdcd27 | 100 | - PEAR class and PEAR_Error |
7bfdcd27 ER |
101 | and classes for PHP 5: |
102 | - PEAR_ErrorStack and PEAR_Exception | |
103 | ||
438522cd JR |
104 | %description core -l pl.UTF-8 |
105 | Ten pakiet zawiera główne klasy PEAR-a: | |
106 | - klasę PEAR i PEAR_Error | |
6a2638f3 JB |
107 | - System |
108 | - OS_Gueass | |
109 | oraz klasy dla PHP 5: | |
110 | - PEAR_ErrorStack i PEAR_Exception | |
111 | ||
3b2ff42f | 112 | %prep |
ea6d0610 ER |
113 | %define __build_dir %{_builddir}/%{_pearname}-%{version}%{?_rc} |
114 | %define __php_include_path %{__build_dir}/%{_pearname}-%{version}%{?_rc}:%{__build_dir}/%(basename %{SOURCE1} .tgz):%{__build_dir}/%(basename %{SOURCE2} .tgz) | |
115 | %define __pear php -dmemory_limit=-1 -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_pearname}-%{version}%{?_rc}/scripts/pearcmd.php | |
4fa4231a ER |
116 | |
117 | %setup -q -c -n %{_pearname}-%{version} -a1 -a2 | |
118 | %pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc} | |
4d20e935 | 119 | |
75ff35d4 | 120 | %patch0 -p1 |
4cf8a2f7 ER |
121 | %patch1 -p1 |
122 | %{?with_FHS:%patch2 -p1} | |
3b2ff42f | 123 | |
f52a0a99 | 124 | find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v |
9d4417cf | 125 | |
208f09df | 126 | %build |
f52a0a99 ER |
127 | D=$(pwd) |
128 | pearcmd() { | |
cddf0b34 | 129 | %{__pear} -c ${D}/pearrc "$@" |
f52a0a99 | 130 | } |
fa703ae4 ER |
131 | pearcmd config-set doc_dir %{_docdir} |
132 | pearcmd config-set data_dir %{php_pear_dir}/data | |
133 | pearcmd config-set php_dir %{php_pear_dir} | |
134 | pearcmd config-set test_dir %{php_pear_dir}/tests | |
135 | pearcmd config-set sig_bin %{_bindir}/gpg | |
136 | pearcmd config-set cfg_dir %{_sysconfdir}/pear | |
f52a0a99 | 137 | |
208f09df ER |
138 | %install |
139 | rm -rf $RPM_BUILD_ROOT | |
fa703ae4 | 140 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/pear,%{php_pear_dir},%{_bindir}} |
f52a0a99 | 141 | %pear_package_install |
8066c125 | 142 | cp -a pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf |
0aec2823 | 143 | |
75ff35d4 ER |
144 | # -C and -q options were for php-cgi, in php-cli they're enabled by default. |
145 | %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1 | |
146 | cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF' | |
147 | #!/bin/sh | |
c5a0a3b8 | 148 | %php_exec -dopen_basedir="" -dmemory_limit=128M %{php_pear_dir}/pearcmd.php "$@" |
75ff35d4 ER |
149 | EOF |
150 | cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF' | |
151 | #!/bin/sh | |
630131db | 152 | %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@" |
75ff35d4 ER |
153 | EOF |
154 | # 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 | |
155 | # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries. | |
156 | cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF' | |
157 | #!/bin/sh | |
3bb4eaaa | 158 | %php_exec -dmemory_limit=64M -dsafe_mode=0 -n -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@" |
75ff35d4 | 159 | EOF |
2540642d ER |
160 | # for rpm to find interpreter |
161 | chmod +x $RPM_BUILD_ROOT%{_bindir}/* | |
f52a0a99 | 162 | |
fae83f8c | 163 | %post |
19860897 ER |
164 | if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then |
165 | cat %{_docdir}/%{name}-%{version}/optional-packages.txt | |
166 | fi | |
e4ed2b0a | 167 | |
d95a135e ER |
168 | # need to bootstrap for non-root user |
169 | if [ ! -f %{php_pear_dir}/.lock ]; then | |
170 | umask 2 | |
171 | %{_bindir}/pear list > /dev/null | |
172 | fi | |
173 | ||
3b2ff42f PG |
174 | %clean |
175 | rm -rf $RPM_BUILD_ROOT | |
176 | ||
177 | %files | |
178 | %defattr(644,root,root,755) | |
fae83f8c | 179 | %doc install.log optional-packages.txt |
f52a0a99 | 180 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf |
fa703ae4 | 181 | %dir %{_sysconfdir}/pear |
939cbf7e ER |
182 | %attr(755,root,root) %{_bindir}/pear |
183 | %attr(755,root,root) %{_bindir}/peardev | |
184 | %attr(755,root,root) %{_bindir}/pecl | |
6de589f7 | 185 | %{php_pear_dir}/.registry/pear.reg |
7bfdcd27 ER |
186 | %{php_pear_dir}/pearcmd.php |
187 | %{php_pear_dir}/peclcmd.php | |
1ac819d0 | 188 | %{php_pear_dir}/PEAR/* |
be336a7a ER |
189 | %{php_pear_dir}/OS |
190 | %{php_pear_dir}/System.php | |
8066c125 | 191 | |
1ac819d0 ER |
192 | # in -core subpackage |
193 | %exclude %{php_pear_dir}/PEAR/ErrorStack.php | |
194 | %exclude %{php_pear_dir}/PEAR/Exception.php | |
26c1f23f ER |
195 | |
196 | %{php_pear_dir}/data/* | |
7bfdcd27 ER |
197 | |
198 | %files core | |
199 | %defattr(644,root,root,755) | |
200 | %{php_pear_dir}/PEAR.php | |
7bfdcd27 ER |
201 | %dir %{php_pear_dir}/PEAR |
202 | %{php_pear_dir}/PEAR/ErrorStack.php | |
203 | %{php_pear_dir}/PEAR/Exception.php |