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