]> TLD Linux GIT Repositories - packages/php-pear-PEAR.git/blob - php-pear-PEAR.spec
- merged 1.10.9 from PLD
[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        php72
10 %define         php_min_version 5.6.0
11 %include        /usr/lib/rpm/macros.php
12 Summary:        PEAR Base System
13 Summary(pl.UTF-8):      Podstawowy system PEAR
14 Name:           php-pear-%{_pearname}
15 Version:        1.10.9
16 Release:        1
17 Epoch:          1
18 License:        New BSD License
19 Group:          Development/Languages/PHP
20 Source0:        https://pear.php.net/get/%{_pearname}-%{version}.tgz
21 # Source0-md5:  5015d15753c5b44ac694a6906a5d8c15
22 Source1:        https://pear.php.net/get/Console_Getopt-1.4.1.tgz
23 # Source1-md5:  a95c86528f910562772274eefb90ca2c
24 Source2:        https://pear.php.net/get/Structures_Graph-1.1.1.tgz
25 # Source2-md5:  f1be7827074c4f51eb1af245f0f7c5c4
26 Patch0:         %{name}-sysconfdir.patch
27 Patch1:         ext-check.patch
28 Patch2:         %{name}-FHS.patch
29 URL:            https://pear.php.net/package/PEAR
30 BuildRequires:  php72-pcre
31 BuildRequires:  php72-xml
32 BuildRequires:  /usr/bin/php72
33 BuildRequires:  rpm-php-pearprov >= 4.4.2-30.1
34 BuildRequires:  rpmbuild(macros) >= 1.654
35 Requires:       %{name}-core = %{epoch}:%{version}-%{release}
36 Requires:       /usr/bin/php
37 Requires:       php(core) >= %{php_min_version}
38 Requires:       php(pcre)
39 Requires:       php(xml)
40 Requires:       php(zlib)
41 Requires:       php-pear >= 4:1.2-1
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
46 Requires:       rpm-whiteout
47 Suggests:       php-pear-Net_FTP
48 Obsoletes:      php-pear-PEAR-Command
49 Obsoletes:      php-pear-PEAR-Frontend_CLI
50 Obsoletes:      php-pear-PEAR-OS
51 Conflicts:      php-pear-PEAR_Frontend_Gtk < 0.4.0
52 Conflicts:      php-pear-PEAR_Frontend_Web < 0.5.0
53 Conflicts:      rpm-whiteout < 1.1
54 Conflicts:      rpmbuild(macros) < 1.563
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 # PEAR_Command_Packaging is separate package
59 # PEAR_FTP is optional
60 %define         _noautoreq_pear PEAR/FTP.php Net/FTP.php XML/RPC.* PEAR/Command/Packaging.php
61
62 %description
63 The PEAR package contains:
64 - the PEAR installer, for creating, distributing and installing
65   packages
66 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
67 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
68 - the PEAR_Error error handling mechanism
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
73 - the PEAR base class packages
74
75 In PEAR status of this package is: %{_status}.
76
77 %description -l pl.UTF-8
78 Pakiet PEAR zawiara:
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
85   operacyjnego,
86 - klasę System do szybkiej obsługi typowych operacji na plikach i
87   katalogach,
88 - podstawową klasy PEAR.
89
90 Ta klasa ma w PEAR status: %{_status}.
91
92 %package core
93 Summary:        PEAR core classes
94 Summary(pl.UTF-8):      Główne klasy PEAR-a
95 Group:          Development/Languages/PHP
96 Requires:       php(core) >= %{php_min_version}
97
98 %description core
99 This package includes PEAR core classes:
100 - PEAR class and PEAR_Error
101 and classes for PHP 5:
102 - PEAR_ErrorStack and PEAR_Exception
103
104 %description core -l pl.UTF-8
105 Ten pakiet zawiera główne klasy PEAR-a:
106 - klasę PEAR i PEAR_Error
107 - System
108 - OS_Gueass
109 oraz klasy dla PHP 5:
110 - PEAR_ErrorStack i PEAR_Exception
111
112 %prep
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
116
117 %setup -q -c -n %{_pearname}-%{version} -a1 -a2
118 %pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc}
119
120 %patch0 -p1
121 %patch1 -p1
122 %{?with_FHS:%patch2 -p1}
123
124 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
125
126 %build
127 D=$(pwd)
128 pearcmd() {
129         %{__pear} -c ${D}/pearrc "$@"
130 }
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
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/pear,%{php_pear_dir},%{_bindir}}
141 %pear_package_install
142 cp -a pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
143
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
148 %php_exec -dopen_basedir="" -dmemory_limit=128M %{php_pear_dir}/pearcmd.php "$@"
149 EOF
150 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
151 #!/bin/sh
152 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
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
158 %php_exec -dmemory_limit=64M -dsafe_mode=0 -n -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
159 EOF
160 # for rpm to find interpreter
161 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
162
163 %post
164 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
165         cat %{_docdir}/%{name}-%{version}/optional-packages.txt
166 fi
167
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
174 %clean
175 rm -rf $RPM_BUILD_ROOT
176
177 %files
178 %defattr(644,root,root,755)
179 %doc install.log optional-packages.txt
180 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
181 %dir %{_sysconfdir}/pear
182 %attr(755,root,root) %{_bindir}/pear
183 %attr(755,root,root) %{_bindir}/peardev
184 %attr(755,root,root) %{_bindir}/pecl
185 %{php_pear_dir}/.registry/pear.reg
186 %{php_pear_dir}/pearcmd.php
187 %{php_pear_dir}/peclcmd.php
188 %{php_pear_dir}/PEAR/*
189 %{php_pear_dir}/OS
190 %{php_pear_dir}/System.php
191
192 # in -core subpackage
193 %exclude %{php_pear_dir}/PEAR/ErrorStack.php
194 %exclude %{php_pear_dir}/PEAR/Exception.php
195
196 %{php_pear_dir}/data/*
197
198 %files core
199 %defattr(644,root,root,755)
200 %{php_pear_dir}/PEAR.php
201 %dir %{php_pear_dir}/PEAR
202 %{php_pear_dir}/PEAR/ErrorStack.php
203 %{php_pear_dir}/PEAR/Exception.php