]>
Commit | Line | Data |
---|---|---|
5c34000d ER |
1 | # TODO |
2 | # - writable dirs: Ensure that the directories app/etc, var, and media are writable by the web server | |
65e6045a ER |
3 | # |
4 | # Conditional build: | |
5 | %bcond_with system_zf # use system ZF, unfinished | |
6 | ||
0827f4e2 | 7 | %include /usr/lib/rpm/macros.php |
5c34000d | 8 | %define php_min_version 5.2.0 |
be38579b ER |
9 | Summary: An open-source eCommerce platform focused on flexibility and control |
10 | Name: magento | |
abcfbc5a | 11 | Version: 1.4.1.1 |
65e6045a | 12 | Release: 0.13 |
5c34000d | 13 | License: Open Software License (OSL 3.0) |
be38579b | 14 | Group: Applications/WWW |
be38579b | 15 | Source0: http://www.magentocommerce.com/downloads/assets/%{version}/%{name}-%{version}.tar.bz2 |
abcfbc5a | 16 | # Source0-md5: 319882ad9eaef8b7312071ba48a8045a |
c37abe4f | 17 | Source1: apache.conf |
65e6045a ER |
18 | Source2: crontab |
19 | Source3: cron_disabled.php | |
20 | Source4: cron_import.php | |
21 | Source5: cron_export.php | |
22 | Patch0: php43.patch | |
23 | Patch1: categories_id.patch | |
24 | Patch2: cron_export_fix_lang.patch | |
25 | Patch3: homelist_random.patch | |
cb64d730 ER |
26 | Patch4: pld-mysql-root.patch |
27 | Patch5: amcustomerattr-optional.patch | |
873d951b | 28 | Patch6: local.xml-empty.patch |
dfa08ade | 29 | URL: http://www.magentocommerce.com/ |
b90a3ba0 | 30 | BuildRequires: rpm-php-pearprov |
31 | BuildRequires: rpm-pythonprov | |
5c34000d | 32 | BuildRequires: rpmbuild(macros) >= 1.553 |
dfa08ade ER |
33 | Requires: php(core) >= %{php_min_version} |
34 | Requires: php(ctype) | |
35 | Requires: php(curl) | |
36 | Requires: php(dom) | |
37 | Requires: php(gd) | |
38 | Requires: php(hash) | |
39 | Requires: php(iconv) | |
40 | Requires: php(mcrypt) | |
41 | Requires: php(pdo-mysql) | |
42 | Requires: php(simplexml) | |
5c34000d | 43 | Requires: php-mhash |
cb64d730 | 44 | Requires: php-mhash |
cb64d730 ER |
45 | Requires: webapps |
46 | Requires: webserver(access) | |
47 | Requires: webserver(alias) | |
48 | Requires: webserver(indexfile) | |
49 | Requires: webserver(php) | |
50 | Requires: webserver(rewrite) | |
5c34000d | 51 | Suggests: php-pecl-APC |
be38579b ER |
52 | BuildArch: noarch |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %define _webapps /etc/webapps | |
56 | %define _webapp %{name} | |
57 | %define _sysconfdir %{_webapps}/%{_webapp} | |
58 | %define _appdir %{_datadir}/%{_webapp} | |
59 | ||
0827f4e2 ER |
60 | # lib/3Dsecure |
61 | %define libs_3dsecure pear(XMLParser.php) | |
62 | %define libs_mage pear(3Dsecure/CentinelClient.php) pear(CentinelErrors.php) pear(CreateController.php) pear(ProfileController.php) pear(Rijndael.php) pear(Varien.*.php) pear(abstract.php) pear(Mage.*.php) pear(Maged/.*.php) pear(app/Mage.php) pear(google.*.php) pear(lib/Varien/.*.php) pear(phpseclib/Crypt/.*) pear(phpseclib/Math/.*) pear(phpseclib/Net/.*) pear(processor.php) pear(xml-processing/.*.php) | |
63 | %define libs_pear pear(Crypt/DES.php) pear(Crypt/Hash.php) pear(Crypt/Random.php) pear(Crypt/TripleDES.php) pear(Math/BigInteger.php) pear(Crypt/RSA.php) | |
64 | %define _noautopear %{libs_mage} %{libs_pear} %{libs_3dsecure} | |
65 | ||
66 | # exclude optional php dependencies | |
67 | %define _noautophp %{nil} | |
68 | ||
69 | # put it together for rpmbuild | |
70 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
71 | ||
be38579b ER |
72 | %description |
73 | An open-source eCommerce platform focused on flexibility and control. | |
74 | ||
cb64d730 ER |
75 | %package setup |
76 | Summary: Magento setup package | |
77 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Magento | |
78 | Group: Applications/WWW | |
79 | Requires: %{name} = %{version}-%{release} | |
80 | ||
81 | %description setup | |
82 | Install this package to configure initial Magento installation. You | |
83 | should uninstall this package when you're done, as it considered | |
84 | insecure to keep the setup files in place. | |
85 | ||
86 | %description setup -l pl.UTF-8 | |
87 | Ten pakiet należy zainstalować w celu wstępnej konfiguracji Magento po | |
88 | pierwszej instalacji. Potem należy go odinstalować, jako że | |
89 | pozostawienie plików instalacyjnych mogłoby być niebezpieczne. | |
90 | ||
b2103559 ER |
91 | %package downloader |
92 | Summary: Magento downloader | |
93 | Group: Applications/WWW | |
94 | Requires: %{name} = %{version}-%{release} | |
95 | ||
96 | %description downloader | |
97 | Downloader for Magento. | |
98 | ||
be38579b | 99 | %prep |
a2a459fc ER |
100 | %setup -qc |
101 | mv %{name}/{.??*,*} . && rmdir %{name} | |
abcfbc5a ER |
102 | |
103 | # use system Zend, magento has bundled ZF somewhere between versions 1.9.6 and 1.9.7 | |
65e6045a | 104 | %if %{with system_zf} |
0827f4e2 | 105 | rm -r lib/Zend |
65e6045a | 106 | %endif |
0827f4e2 ER |
107 | |
108 | # php-pear-PEAR 1.7.2 | |
109 | rm lib/PEAR/PEAR.php | |
110 | rm -r lib/PEAR/PEAR | |
111 | ||
112 | # php-pear-HTTP 1.4.1 | |
113 | rm lib/PEAR/HTTP/HTTP.php | |
114 | ||
115 | # php-pear-HTTP_Request 1.4.4 | |
116 | rm lib/PEAR/HTTP/Request.php | |
117 | rm -r lib/PEAR/HTTP/Request | |
118 | ||
119 | # php-pear-Mail_Mime 1.5.2 | |
120 | rm lib/PEAR/Mail/mime.php | |
121 | rm lib/PEAR/Mail/mimePart.php | |
122 | rm lib/PEAR/Mail/xmail.{dtd,xsl} | |
123 | ||
124 | # php-pear-Mail_mimeDecode 1.5.0 | |
125 | rm lib/PEAR/Mail/mimeDecode.php | |
126 | ||
127 | # php-pear-Net_URL 1.0.15 | |
128 | rm lib/PEAR/Net/URL.php | |
129 | ||
130 | # php-pear-Net_Socket 1.0.9 | |
131 | rm lib/PEAR/Net/Socket.php | |
132 | ||
133 | # php-pear-SOAP-0.12.0-1.noarch | |
134 | rm -r lib/PEAR/SOAP | |
135 | ||
136 | # php-pear-XML_Parser 1.3.2 | |
137 | rm lib/PEAR/XML/Parser.php | |
138 | rm lib/PEAR/XML/Parser/Simple.php | |
139 | rmdir lib/PEAR/XML/Parser | |
140 | ||
141 | # php-pear-XML_Serializer 0.19.2 | |
142 | rm lib/PEAR/XML/Serializer.php | |
143 | rm lib/PEAR/XML/Unserializer.php | |
144 | ||
145 | rmdir lib/PEAR/{HTTP,Mail,Net} | |
abcfbc5a | 146 | |
cb64d730 | 147 | %undos -f php,phtml |
be38579b ER |
148 | #%patch0 -p1 |
149 | %patch1 -p1 | |
150 | %patch2 -p1 | |
151 | %patch3 -p1 | |
cb64d730 ER |
152 | %patch4 -p1 |
153 | %patch5 -p1 | |
873d951b | 154 | %patch6 -p1 |
a2a459fc ER |
155 | |
156 | # cleanup backups after patching | |
157 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
158 | ||
873d951b ER |
159 | # include default config in package files (empty so it can be treated as missing) |
160 | > app/etc/local.xml | |
e4a640ec | 161 | |
a2a459fc | 162 | # make docs to pack |
cb64d730 | 163 | install -d doc |
a2a459fc | 164 | mv RELEASE_NOTES.txt doc |
cb64d730 ER |
165 | mv LICENSE*.txt doc |
166 | mv *sample doc | |
a2a459fc | 167 | mv .htaccess.sample doc/htaccess.sample |
be38579b | 168 | |
5c34000d ER |
169 | # contents included in apache.conf |
170 | find -name .htaccess | xargs rm | |
171 | ||
be38579b ER |
172 | %install |
173 | rm -rf $RPM_BUILD_ROOT | |
174 | install -d $RPM_BUILD_ROOT%{_appdir} | |
175 | cp -a . $RPM_BUILD_ROOT%{_appdir} | |
a2a459fc | 176 | rm -rf $RPM_BUILD_ROOT%{_appdir}/doc |
0827f4e2 | 177 | rm -f $RPM_BUILD_ROOT%{_appdir}/debug*.list |
be38579b ER |
178 | |
179 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
c37abe4f ER |
180 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
181 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
be38579b ER |
182 | |
183 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_appdir}/crontab | |
184 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_appdir}/cron_disabled.php | |
185 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_appdir}/cron_import.php | |
186 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/cron_export.php | |
187 | ||
188 | %clean | |
189 | rm -rf $RPM_BUILD_ROOT | |
190 | ||
191 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
192 | %webapp_register apache %{_webapp} | |
193 | ||
194 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
195 | %webapp_unregister apache %{_webapp} | |
196 | ||
197 | %triggerin -- apache < 2.2.0, apache-base | |
198 | %webapp_register httpd %{_webapp} | |
199 | ||
200 | %triggerun -- apache < 2.2.0, apache-base | |
201 | %webapp_unregister httpd %{_webapp} | |
202 | ||
203 | %files | |
204 | %defattr(644,root,root,755) | |
a2a459fc | 205 | %doc doc/* |
be38579b ER |
206 | %dir %attr(750,root,http) %{_sysconfdir} |
207 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
208 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
209 | %dir %{_appdir} | |
210 | %{_appdir}/errors | |
211 | %dir %{_appdir}/app | |
5c34000d | 212 | %dir %{_appdir}/app/code |
be38579b | 213 | %{_appdir}/app/code/* |
5c34000d | 214 | %dir %{_appdir}/app/design |
be38579b | 215 | %{_appdir}/app/design/* |
cb64d730 ER |
216 | %dir %attr(775,root,http) %{_appdir}/app/etc |
217 | %dir %attr(775,root,http) %{_appdir}/app/etc/modules | |
e4a640ec | 218 | %attr(664,root,http) %config(noreplace) %verify(not md5 mtime size) %{_appdir}/app/etc/config.xml |
cb64d730 ER |
219 | %attr(664,root,http) %config(noreplace) %verify(not md5 mtime size) %{_appdir}/app/etc/local.xml* |
220 | %attr(664,root,http) %config(noreplace) %verify(not md5 mtime size) %{_appdir}/app/etc/modules/*.xml | |
5c34000d | 221 | %dir %{_appdir}/app/locale |
be38579b ER |
222 | %{_appdir}/app/locale/* |
223 | %{_appdir}/app/Mage.php | |
5c34000d | 224 | %dir %{_appdir}/includes |
be38579b | 225 | %{_appdir}/includes/config.php |
be38579b ER |
226 | #%dir %{_appdir}/report |
227 | #%{_appdir}/report/* | |
5c34000d | 228 | %dir %{_appdir}/shell |
be38579b ER |
229 | %{_appdir}/shell/*.php |
230 | %dir %{_appdir}/skin | |
231 | %{_appdir}/skin/* | |
232 | %dir %{_appdir}/js | |
233 | %{_appdir}/js/* | |
be38579b | 234 | %dir %{_appdir}/lib |
cb64d730 ER |
235 | %{_appdir}/lib/3Dsecure |
236 | %{_appdir}/lib/flex | |
237 | %{_appdir}/lib/googlecheckout | |
238 | %{_appdir}/lib/LinLibertineFont | |
239 | %{_appdir}/lib/PEAR | |
240 | %{_appdir}/lib/phpseclib | |
241 | %{_appdir}/lib/Varien | |
65e6045a ER |
242 | %if %{without system_zf} |
243 | %{_appdir}/lib/Zend | |
244 | %endif | |
be38579b ER |
245 | %attr(775,root,http) %dir %{_appdir}/media |
246 | %attr(775,root,http) %dir %{_appdir}/var | |
be38579b ER |
247 | %{_appdir}/favicon.ico |
248 | %{_appdir}/cron.php | |
249 | %{_appdir}/cron.sh | |
250 | %{_appdir}/crontab | |
251 | %{_appdir}/cron_disabled.php | |
252 | %{_appdir}/cron_import.php | |
253 | %{_appdir}/cron_export.php | |
254 | %{_appdir}/index.php | |
be38579b | 255 | #%{_appdir}/STATUS.txt |
cb64d730 | 256 | |
b2103559 ER |
257 | %exclude %{_appdir}/lib/Varien/Pear |
258 | %exclude %{_appdir}/lib/Varien/Pear.php | |
259 | %exclude %{_appdir}/app/code/core/Mage/Install | |
260 | %exclude %{_appdir}/app/design/install/default/default/template/install | |
261 | ||
cb64d730 ER |
262 | %files setup |
263 | %defattr(644,root,root,755) | |
264 | %{_appdir}/LICENSE.html | |
0827f4e2 ER |
265 | %attr(755,root,root) %{_appdir}/pear |
266 | %dir %{_appdir}/install.php | |
0827f4e2 ER |
267 | %dir %{_appdir}/pkginfo |
268 | %{_appdir}/pkginfo/* | |
b2103559 ER |
269 | |
270 | %{_appdir}/lib/Varien/Pear | |
271 | %{_appdir}/lib/Varien/Pear.php | |
272 | ||
273 | %{_appdir}/app/code/core/Mage/Install | |
274 | %{_appdir}/app/design/install/default/default/template/install | |
275 | ||
276 | %files downloader | |
65e6045a | 277 | %defattr(644,root,root,755) |
b2103559 ER |
278 | %dir %{_appdir}/downloader |
279 | %{_appdir}/downloader/* |