]> git.pld-linux.org Git - packages/php-pear-PEAR.git/blob - php-pear-PEAR.spec
- up to 1.9.1
[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         _class          PEAR
8 %define         _status         stable
9 %define         _pearname       %{_class}
10
11 %define         php_min_version 5.0.0
12 %include        /usr/lib/rpm/macros.php
13 Summary:        PEAR Base System
14 Summary(pl.UTF-8):      Podstawowy system PEAR
15 Name:           php-pear-%{_pearname}
16 Version:        1.9.1
17 Release:        0.4
18 Epoch:          1
19 License:        New BSD License
20 Group:          Development/Languages/PHP
21 Source0:        http://pear.php.net/get/%{_pearname}-%{version}.tgz
22 # Source0-md5:  e301d2d81371327a96864a307b85509d
23 Source1:        http://pear.php.net/get/Console_Getopt-1.2.3.tgz
24 # Source1-md5:  d7618327f9302a7191893768982de823
25 Source2:        http://pear.php.net/get/Structures_Graph-1.0.3.tgz
26 # Source2-md5:  d2d8db74818be5cb0af7def3fc285bfc
27 Patch0:         %{name}-sysconfdir.patch
28 Patch5:         %{name}-FHS.patch
29 URL:            http://pear.php.net/package/PEAR
30 BuildRequires:  /usr/bin/php
31 BuildRequires:  php(pcre)
32 BuildRequires:  php(xml)
33 BuildRequires:  rpm-php-pearprov >= 4.4.2-30.1
34 BuildRequires:  rpmbuild(macros) >= 1.563
35 Requires:       %{name}-core = %{epoch}:%{version}-%{release}
36 Requires:       /usr/bin/php
37 Requires:       php-common >= 4:%{php_min_version}
38 Requires:       php-pcre
39 Requires:       php-pear >= 4:1.2-1
40 Requires:       php-pear-Archive_Tar >= 1.1
41 Requires:       php-pear-Console_Getopt >= 1.2
42 Requires:       php-pear-Structures_Graph >= 1.0.2
43 Requires:       php-xml
44 Requires:       php-zlib
45 Requires:       rpm-whiteout
46 Suggests:       php-pear-Net_FTP
47 Obsoletes:      php-pear-PEAR-Command
48 Obsoletes:      php-pear-PEAR-Frontend_CLI
49 Obsoletes:      php-pear-PEAR-OS
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 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)' 'pear(Net/FTP.php)' 'pear(XML/RPC.*)' 'pear(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-common >= 4:%{php_min_version}
97
98 %description core
99 This package includes PEAR core classes:
100 - PEAR class and PEAR_Error
101 - System
102 - OS_Guess
103 and classes for PHP 5:
104 - PEAR_ErrorStack and PEAR_Exception
105
106 %description core -l pl.UTF-8
107 Ten pakiet zawiera główne klasy PEAR-a:
108 - klasę PEAR i PEAR_Error
109 - System
110 - OS_Gueass
111 oraz klasy dla PHP 5:
112 - PEAR_ErrorStack i PEAR_Exception
113
114 %prep
115 %define __build_dir %{_builddir}/%{_class}-%{version}%{?_rc}
116 %define __php_include_path %{__build_dir}/%{_class}-%{version}%{?_rc}:%{__build_dir}/%(basename %{SOURCE1} .tgz):%{__build_dir}/%(basename %{SOURCE2} .tgz)
117 %define __pear php -dmemory_limit=-1 -doutput_buffering=1 -dinclude_path="%__php_include_path" %{__build_dir}/%{_class}-%{version}%{?_rc}/scripts/pearcmd.php
118
119 %setup -q -c -n %{_pearname}-%{version} -a1 -a2
120 %pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc}
121
122 %patch0 -p1
123 %{?with_FHS:%patch5 -p1}
124
125 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
126
127 %build
128 D=$(pwd)
129 pearcmd() {
130         %{__pear} -c ${D}/pearrc "$@"
131 }
132 pearcmd config-set doc_dir %{_docdir}
133 pearcmd config-set data_dir %{php_pear_dir}/data
134 pearcmd config-set php_dir %{php_pear_dir}
135 pearcmd config-set test_dir %{php_pear_dir}/tests
136 pearcmd config-set sig_bin %{_bindir}/gpg
137 pearcmd config-set cfg_dir %{_sysconfdir}/pear
138
139 %install
140 rm -rf $RPM_BUILD_ROOT
141 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/pear,%{php_pear_dir},%{_bindir}}
142 %pear_package_install
143 cp -a pearrc $RPM_BUILD_ROOT%{_sysconfdir}/pear.conf
144
145 # -C and -q options were for php-cgi, in php-cli they're enabled by default.
146 %define php_exec exec /usr/bin/php -dinclude_path=%{php_pear_dir} -doutput_buffering=1
147 cat > $RPM_BUILD_ROOT%{_bindir}/pear <<'EOF'
148 #!/bin/sh
149 %php_exec -dopen_basedir="" -dmemory_limit=64M %{php_pear_dir}/pearcmd.php "$@"
150 EOF
151 cat > $RPM_BUILD_ROOT%{_bindir}/peardev <<'EOF'
152 #!/bin/sh
153 %php_exec -dopen_basedir="" -dmemory_limit=-1 %{php_pear_dir}/pearcmd.php "$@"
154 EOF
155 # 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
156 # -n is there because devs on #pear said this avoids locking problems when replacing in use libraries.
157 cat > $RPM_BUILD_ROOT%{_bindir}/pecl <<'EOF'
158 #!/bin/sh
159 %php_exec -dmemory_limit=64M -dsafe_mode=0 -n -dextension=xml.so %{php_pear_dir}/peclcmd.php "$@"
160 EOF
161 # for rpm to find interpreter
162 chmod +x $RPM_BUILD_ROOT%{_bindir}/*
163
164 %post
165 if [ -f %{_docdir}/%{name}-%{version}/optional-packages.txt ]; then
166         cat %{_docdir}/%{name}-%{version}/optional-packages.txt
167 fi
168
169 %clean
170 rm -rf $RPM_BUILD_ROOT
171
172 %files
173 %defattr(644,root,root,755)
174 %doc install.log optional-packages.txt
175 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pear.conf
176 %dir %{_sysconfdir}/pear
177 %attr(755,root,root) %{_bindir}/pear
178 %attr(755,root,root) %{_bindir}/peardev
179 %attr(755,root,root) %{_bindir}/pecl
180 %{php_pear_dir}/.registry/pear.reg
181 %{php_pear_dir}/pearcmd.php
182 %{php_pear_dir}/peclcmd.php
183 %{php_pear_dir}/PEAR/*
184
185 # in -core subpackage
186 %exclude %{php_pear_dir}/PEAR/ErrorStack.php
187 %exclude %{php_pear_dir}/PEAR/Exception.php
188 %exclude %{php_pear_dir}/PEAR/FixPHP5PEARWarnings.php
189
190 %{php_pear_dir}/data/*
191
192 %files core
193 %defattr(644,root,root,755)
194 %{php_pear_dir}/PEAR.php
195 %{php_pear_dir}/PEAR5.php
196 %{php_pear_dir}/System.php
197 %{php_pear_dir}/OS
198 %dir %{php_pear_dir}/PEAR
199 %{php_pear_dir}/PEAR/ErrorStack.php
200 %{php_pear_dir}/PEAR/Exception.php
201 %{php_pear_dir}/PEAR/FixPHP5PEARWarnings.php
This page took 0.067157 seconds and 3 git commands to generate.