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