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