]> git.pld-linux.org Git - packages/php-pear-PEAR.git/blob - php-pear-PEAR.spec
- rel 3
[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 #
4 # Conditional build:
5 %bcond_with     FHS                     # writable files in /var/lib/pear. NEEDS LOTS OF PATCHING AND CONVINCING UPSTREAM
6 #
7 # NOTE
8 # - macros needed to build this package are in SOURCES/php-pear-build-macros@DEVEL
9 %define         _class          PEAR
10 %define         _status         alpha
11 %define         _pearname       %{_class}
12 %define         _rc                     a1
13 #
14 %include        /usr/lib/rpm/macros.php
15 %define         _rel    3
16 Summary:        PEAR Base System
17 Summary(pl):    Podstawowy system PEAR
18 Name:           php-pear-%{_pearname}
19 Version:        1.5.0
20 Release:        1.%{_rc}.%{_rel}
21 Epoch:          1
22 License:        PHP 3.0
23 Group:          Development/Languages/PHP
24 Source0:        http://pear.php.net/get/%{_pearname}-%{version}%{_rc}.tgz
25 # Source0-md5:  8f0699f4cf138ac9c6c98a9a9d09133d
26 Source1:        http://pear.php.net/get/Console_Getopt-1.2.tgz
27 # Source1-md5:  8f9ec8253c04350bc01ee7ca941e24b6
28 Patch0:         %{name}-sysconfdir.patch
29 Patch5:         %{name}-FHS.patch
30 URL:            http://pear.php.net/package/PEAR
31 BuildRequires:  /usr/bin/php
32 BuildRequires:  php(pcre)
33 BuildRequires:  php(xml)
34 BuildRequires:  rpm-php-pearprov >= 4.4.2-30.1
35 BuildRequires:  rpmbuild(macros) >= 1.324
36 Requires:       %{name}-core = %{epoch}:%{version}-%{release}
37 Requires:       /usr/bin/php
38 Requires:       php(pcre)
39 Requires:       php(xml)
40 Requires:       php(zlib)
41 Requires:       php-pear >= 4:1.0-14
42 Requires:       php-pear-Archive_Tar >= 1.1
43 Requires:       php-pear-Console_Getopt >= 1.2
44 Obsoletes:      php-pear-PEAR-Command
45 Obsoletes:      php-pear-PEAR-Frontend-CLI
46 Obsoletes:      php-pear-PEAR-OS
47 #Suggests:      php-pear-Net_FTP
48 Conflicts:      php-pear-Archive_Tar = 1.3.0
49 Conflicts:      php-pear-PEAR_Frontend_Gtk < 0.4.0
50 Conflicts:      php-pear-PEAR_Frontend_Web < 0.5.0
51 BuildArch:      noarch
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 # PEAR_Command_Packaging is separate package
55 %define         _noautoreq      'pear(PEAR/FTP.php)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(PEAR/Command/Packaging.php)'
56 %if %{with FHS}
57 %define         _statedir               /var/lib/pear
58 %define         _registrydir    %{_statedir}/registry
59 %define         _channelsdir    %{_statedir}/.channels
60 %else
61 %define         _statedir               %{php_pear_dir}
62 %define         _registrydir    %{_statedir}/.registry
63 %define         _channelsdir    %{_statedir}/.channels
64 %endif
65
66 %description
67 The PEAR package contains:
68 - the PEAR installer, for creating, distributing and installing
69   packages
70 - the alpha-quality PEAR_Exception PHP5 error handling mechanism
71 - the beta-quality PEAR_ErrorStack advanced error handling mechanism
72 - the PEAR_Error error handling mechanism
73 - the OS_Guess class for retrieving info about the OS where PHP is
74   running on
75 - the System class for quick handling of common operations with files
76   and directories
77 - the PEAR base class packages
78
79 In PEAR status of this package is: %{_status}.
80
81 %description -l pl
82 Pakiet PEAR zawiara:
83 - PEAR installer do tworzenia, dystrybucji i instalowania pakietów,
84 - mechanizm PEAR_Exception (w fazie alpha) do obs³ugi b³êdów PHP5,
85 - zaawansowany mechanizm PEAR_ErrorStack (w fazie beta) do obs³ugi
86   b³êdów,
87 - mechanizm obs³ugi b³êdów PEAR_Error,
88 - klasê OS_Guess do pozyskiwania informacji na temat systemu
89   operacyjnego,
90 - klasê System do szybkiej obs³ugi typowych operacji na plikach i
91   katalogach,
92 - podstawow± klasy PEAR.
93
94 Ta klasa ma w PEAR status: %{_status}.
95
96 %package core
97 Summary:        PEAR core classes
98 Summary(pl):    G³ówne klasy PEAR-a
99 Group:          Development/Languages/PHP
100
101 %description core
102 This package includes PEAR core classes:
103 - PEAR class and PEAR_Error
104 - System
105 - OS_Guess
106 and classes for PHP 5:
107 - PEAR_ErrorStack and PEAR_Exception
108
109 %description core -l pl
110 Ten pakiet zawiera g³ówne klasy PEAR-a:
111 - klasê PEAR i PEAR_Error
112 - System
113 - OS_Gueass
114 oraz klasy dla PHP 5:
115 - PEAR_ErrorStack i PEAR_Exception
116
117 %prep
118 %define __build_dir %{_builddir}/%{_class}-%{version}%{?_rc}
119 %define __php_include_path %{__build_dir}/%{_class}-%{version}%{?_rc}:%{__build_dir}/%(basename %{SOURCE1} .tgz)
120 %define __pear php -dmemory_limit=-1 -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_class}-%{version}%{?_rc}/scripts/pearcmd.php
121 %pear_package_setup -z -a1 -n %{_pearname}-%{version}%{?_rc}
122
123 %patch0 -p1
124 %{?with_FHS:%patch5 -p1}
125
126 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{php_pear_dir},%{_bindir}}
131
132 D=$(pwd)
133 pearcmd() {
134         %{__pear} -c ${D}/pearrc "$@"
135 }
136 pearcmd config-set doc_dir %{_docdir} || exit
137 pearcmd config-set data_dir %{php_pear_dir}/data || exit
138 pearcmd config-set php_dir %{php_pear_dir} || exit
139 pearcmd config-set test_dir %{php_pear_dir}/tests || exit
140 pearcmd config-set sig_bin %{_bindir}/gpg || exit
141 cp $D/pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
142
143 %pear_package_install
144
145 install -d $RPM_BUILD_ROOT%{_channelsdir}/.alias
146 install -d $RPM_BUILD_ROOT%{_registrydir}/{.channel.{__uri,pecl.php.net},channels/.alias}
147 touch $RPM_BUILD_ROOT%{_statedir}/.depdb{,lock}
148 touch $RPM_BUILD_ROOT%{_channelsdir}/{__uri,{pear,pecl}.php.net}.reg
149 touch $RPM_BUILD_ROOT%{_channelsdir}/.alias/{pear,pecl}.txt
150 touch $RPM_BUILD_ROOT%{php_pear_dir}/.filemap
151 touch $RPM_BUILD_ROOT%{php_pear_dir}/.lock
152
153 # -C and -q options were for php-cgi, in php-cli they're enabled by default.
154 %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
155 cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF'
156 #!/bin/sh
157 %php_exec -dopen_basedir="" -dmemory_limit=24M %{php_pear_dir}/pearcmd.php "$@"
158 EOF
159 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
160 #!/bin/sh
161 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
162 EOF
163 # 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
164 # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries.
165 cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF'
166 #!/bin/sh
167 %php_exec -dmemory_limit=24M -dsafe_mode=0 -n -dextension=pcre.so -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
168 EOF
169 # for rpm to find interpreter
170 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
171
172 %post
173 %if %{with FHS}
174 if [ ! -L %{php_pear_dir}/.registry ]; then
175         if [ -d %{php_pear_dir}/.registry ]; then
176                 install -d %{_registrydir}
177                 mv -f %{php_pear_dir}/.registry/*.reg %{_registrydir}
178                 rmdir %{php_pear_dir}/.registry/.channel.* 2>/dev/null
179                 rmdir %{php_pear_dir}/.registry/* 2>/dev/null
180                 rmdir %{php_pear_dir}/.registry 2>/dev/null || mv -v %{php_pear_dir}/.registry{,.rpmsave}
181         fi
182         ln -s %{_registrydir} %{php_pear_dir}/.registry
183 fi
184 %endif
185
186 if [ ! -f %{php_pear_dir}/.lock ]; then
187         umask 2
188         %{_bindir}/pear list > /dev/null
189 fi
190
191 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
192         cat %{_docdir}/%{name}-%{version}/optional-packages.txt
193 fi
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %files
199 %defattr(644,root,root,755)
200 %doc install.log optional-packages.txt
201 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
202 %attr(755,root,root) %{_bindir}/*
203 %{php_pear_dir}/.registry/pear.reg
204 %{php_pear_dir}/pearcmd.php
205 %{php_pear_dir}/peclcmd.php
206 %{php_pear_dir}/PEAR/[!CE]*
207 %{php_pear_dir}/PEAR/ChannelFile*
208 %{php_pear_dir}/PEAR/Command*
209 %{php_pear_dir}/PEAR/Config.php
210 %{php_pear_dir}/PEAR/Common.php
211
212 %{php_pear_dir}/data/*
213
214 %if %{with FHS}
215 %dir %{_statedir}
216 %dir %{_registrydir}
217 %ghost %dir %{php_pear_dir}/.registry
218 %endif
219 %dir %{_channelsdir}
220 %dir %{_channelsdir}/.alias
221
222 %ghost %{_channelsdir}/.alias/pear.txt
223 %ghost %{_channelsdir}/.alias/pecl.txt
224 %ghost %{_channelsdir}/pear.php.net.reg
225 %ghost %{_channelsdir}/pecl.php.net.reg
226 %ghost %{_channelsdir}/__uri.reg
227 %ghost %{_registrydir}/.channel.__uri
228 %ghost %{_registrydir}/.channel.pecl.php.net
229 %ghost %{_statedir}/.depdblock
230 %ghost %{_statedir}/.depdb
231 %ghost %{php_pear_dir}/.filemap
232 %ghost %{php_pear_dir}/.lock
233
234 %files core
235 %defattr(644,root,root,755)
236 %{php_pear_dir}/PEAR.php
237 %{php_pear_dir}/System.php
238 %{php_pear_dir}/OS
239 %dir %{php_pear_dir}/PEAR
240 %{php_pear_dir}/PEAR/ErrorStack.php
241 %{php_pear_dir}/PEAR/Exception.php
This page took 0.054566 seconds and 4 git commands to generate.