]> git.pld-linux.org Git - packages/php-pear-PEAR.git/blob - php-pear-PEAR.spec
- create %build
[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 # Conditional build:
8 %bcond_with     FHS                     # writable files in /var/lib/pear. NEEDS LOTS OF PATCHING AND CONVINCING UPSTREAM
9 #
10 # NOTE
11 # - macros needed to build this package are in SOURCES/php-pear-build-macros@DEVEL
12 %define         _class          PEAR
13 %define         _status         stable
14 %define         _pearname       %{_class}
15 #
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}
20 Version:        1.6.1
21 Release:        1
22 Epoch:          1
23 License:        PHP 3.0
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
41 Requires:       php(pcre)
42 Requires:       php(xml)
43 Requires:       php(zlib)
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
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
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)'
60 %if %{with FHS}
61 %define         _statedir               /var/lib/pear
62 %define         _registrydir    %{_statedir}/registry
63 %define         _channelsdir    %{_statedir}/.channels
64 %else
65 %define         _statedir               %{php_pear_dir}
66 %define         _registrydir    %{_statedir}/.registry
67 %define         _channelsdir    %{_statedir}/.channels
68 %endif
69
70 %description
71 The PEAR package contains:
72 - the PEAR installer, for creating, distributing and installing
73   packages
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
78   running on
79 - the System class for quick handling of common operations with files
80   and directories
81 - the PEAR base class packages
82
83 In PEAR status of this package is: %{_status}.
84
85 %description -l pl.UTF-8
86 Pakiet PEAR zawiara:
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
90   błędów,
91 - mechanizm obsługi błędów PEAR_Error,
92 - klasę OS_Guess do pozyskiwania informacji na temat systemu
93   operacyjnego,
94 - klasę System do szybkiej obsługi typowych operacji na plikach i
95   katalogach,
96 - podstawową klasy PEAR.
97
98 Ta klasa ma w PEAR status: %{_status}.
99
100 %package core
101 Summary:        PEAR core classes
102 Summary(pl.UTF-8):      Główne klasy PEAR-a
103 Group:          Development/Languages/PHP
104
105 %description core
106 This package includes PEAR core classes:
107 - PEAR class and PEAR_Error
108 - System
109 - OS_Guess
110 and classes for PHP 5:
111 - PEAR_ErrorStack and PEAR_Exception
112
113 %description core -l pl.UTF-8
114 Ten pakiet zawiera główne klasy PEAR-a:
115 - klasę PEAR i PEAR_Error
116 - System
117 - OS_Gueass
118 oraz klasy dla PHP 5:
119 - PEAR_ErrorStack i PEAR_Exception
120
121 %prep
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
125
126 %setup -q -c -n %{_pearname}-%{version} -a1 -a2
127 %pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc}
128
129 %patch0 -p1
130 %{?with_FHS:%patch5 -p1}
131
132 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
133
134 %build
135 D=$(pwd)
136 pearcmd() {
137         %{__pear} -c ${D}/pearrc "$@"
138 }
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
144
145 %install
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
150
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
158
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'
162 #!/bin/sh
163 %php_exec -dopen_basedir="" -dmemory_limit=24M %{php_pear_dir}/pearcmd.php "$@"
164 EOF
165 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
166 #!/bin/sh
167 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
168 EOF
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'
172 #!/bin/sh
173 %php_exec -dmemory_limit=24M -dsafe_mode=0 -n -dextension=pcre.so -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
174 EOF
175 # for rpm to find interpreter
176 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
177
178 %post
179 %if %{with FHS}
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}
187         fi
188         ln -s %{_registrydir} %{php_pear_dir}/.registry
189 fi
190 %endif
191
192 if [ ! -f %{php_pear_dir}/.lock ]; then
193         umask 2
194         %{_bindir}/pear list > /dev/null
195 fi
196
197 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
198         cat %{_docdir}/%{name}-%{version}/optional-packages.txt
199 fi
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204 %files
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
217
218 %{php_pear_dir}/data/*
219
220 %if %{with FHS}
221 %dir %{_statedir}
222 %dir %{_registrydir}
223 %ghost %dir %{php_pear_dir}/.registry
224 %endif
225 %dir %{_channelsdir}
226 %dir %{_channelsdir}/.alias
227
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
239
240 %files core
241 %defattr(644,root,root,755)
242 %{php_pear_dir}/PEAR.php
243 %{php_pear_dir}/System.php
244 %{php_pear_dir}/OS
245 %dir %{php_pear_dir}/PEAR
246 %{php_pear_dir}/PEAR/ErrorStack.php
247 %{php_pear_dir}/PEAR/Exception.php
This page took 0.055773 seconds and 4 git commands to generate.