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