]> git.pld-linux.org Git - packages/wordpress.git/blob - wordpress.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/wordpress.git] / wordpress.spec
1 # TODO
2 # - gettext mo to system dir, add all possible languages?
3 # - merge changes from wpmu.spec
4 %define         php_min_version 5.2.1
5 Summary:        Personal publishing system
6 Summary(pl.UTF-8):      Osobisty system publikacji
7 Name:           wordpress
8 Version:        3.5.2
9 Release:        3
10 License:        GPL v2
11 Group:          Applications/Publishing
12 Source0:        http://wordpress.org/%{name}-%{version}.tar.gz
13 # Source0-md5:  90acae65199db7b33084ef36860d7f22
14 Source1:        wp-secure.sh
15 Source2:        wp-setup.sh
16 Source3:        wp-setup.txt
17 Source4:        apache.conf
18 Source5:        lighttpd.conf
19 # no 3.5.1 tag
20 Source6:        http://svn.automattic.com/wordpress-i18n/et/tags/3.5/messages/et.po
21 # Source6-md5:  e6fbcf1940701ce6f1f91c0ad4ed5a99
22 # no messages under 3.5 tag
23 Source7:        http://svn.automattic.com/wordpress-i18n/pl_PL/tags/3.2.1/messages/pl_PL.po
24 # Source7-md5:  a0f5d65b7d4e5d53209edc595a19ff49
25 Patch0:         configpath.patch
26 Patch1:         multisite.patch
27 Patch2:         %{name}.patch
28 Patch3:         simplepie.patch
29 Patch4:         pear-text-diff.patch
30 Patch6:         swfobject.patch
31 Patch7:         phpmailer.patch
32 URL:            http://www.wordpress.org/
33 BuildRequires:  gettext-tools
34 BuildRequires:  rpm-php-pearprov
35 BuildRequires:  rpmbuild(macros) >= 1.553
36 Requires:       js-swfobject >= 2.2
37 Requires:       php(core) >= %{php_min_version}
38 Requires:       php(date)
39 Requires:       php(dom)
40 Requires:       php(gettext)
41 Requires:       php(hash)
42 Requires:       php(iconv)
43 Requires:       php(json)
44 Requires:       php(mbstring)
45 Requires:       php(mysql)
46 Requires:       php(pcre)
47 Requires:       php(spl)
48 Requires:       php(tokenizer)
49 Requires:       php(xml)
50 Requires:       php-pear-Text_Diff
51 Requires:       php-phpmailer >= 2.0.4
52 Requires:       php-simplepie >= 1.2
53 Requires:       webapps
54 Requires:       webserver(php)
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 # no pear deps
59 %define         _noautopear     pear
60
61 %define         _noautophp      php-ftp php-gd php-openssl php-simplexml
62
63 # put it together for rpmbuild
64 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
65
66 %define         _appdir         %{_datadir}/%{name}
67 %define         _webapps        /etc/webapps
68 %define         _webapp         %{name}
69 %define         _sysconfdir     %{_webapps}/%{_webapp}
70
71 %description
72 WordPress is a state-of-the-art semantic personal publishing platform
73 with a focus on aesthetics, web standards, and usability. WordPress
74 was born out of a desire for an elegant, well-architectured personal
75 publishing system (also called blog or weblog) built on PHP and MySQL
76 and licensed under the GPL. It is the official successor of
77 b2/cafelog. WordPress is fresh software, but its roots and development
78 go back to 2001.
79
80 %description -l pl.UTF-8
81 WordPress jest technologicznie dopracowaną, semantyczną, osobistą
82 platformą do publikacji kładącą nacisk na standardy WWW oraz
83 użyteczność. WordPress został stworzony w wyniku potrzeby
84 eleganckiego, dobrze zaprojektowanego, osobistego systemu publikacji
85 (nazywanego również blogiem czy weblogiem). Jest to system oparty o
86 PHP i MySQL oraz na licencji GPL. Jest oficjalnym następcą b2/cafelog.
87 WordPress jest nowym oprogramowaniem, ale jego korzenie i rozwój
88 sięgają 2001 roku.
89
90 %package setup
91 Summary:        WordPress setup package
92 Summary(pl.UTF-8):      Pakiet do wstępnej konfiguracji WordPress
93 Group:          Applications/WWW
94 Requires:       %{name} = %{version}-%{release}
95
96 %description setup
97 Install this package to configure initial WordPress installation. You
98 should uninstall this package when you're done, as it considered
99 insecure to keep the setup files in place.
100
101 %description setup -l pl.UTF-8
102 Ten pakiet należy zainstalować w celu wstępnej konfiguracji WordPress
103 po pierwszej instalacji. Potem należy go odinstalować, jako że
104 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
105
106 %package plugin-akismet
107 Summary:        WordPress Akismet Plugin
108 Group:          Applications/WWW
109 Requires:       %{name} = %{version}-%{release}
110
111 %description plugin-akismet
112 Akismet checks your comments against the Akismet web service to see if
113 they look like spam or not and lets you review the spam it catches
114 under your blog's "Comments" admin screen.
115
116 %package theme-twentyeleven
117 Summary:        WordPress Twenty Eleven theme
118 Group:          Applications/WWW
119 URL:            http://wordpress.org/extend/themes/twentyeleven
120 Requires:       %{name} = %{version}-%{release}
121
122 %description theme-twentyeleven
123 The 2011 theme for WordPress is sophisticated, lightweight, and
124 adaptable.
125
126 Make it yours with a custom menu, header image, and background -- then
127 go further with available theme options for light or dark color
128 scheme, custom link colors, and three layout choices. Twenty Eleven
129 comes equipped with a Showcase page template that transforms your
130 front page into a showcase to show off your best content, widget
131 support galore (sidebar, three footer areas, and a Showcase page
132 widget area), and a custom "Ephemera" widget to display your Aside,
133 Link, Quote, or Status posts. Included are styles for print and for
134 the admin editor, support for featured images (as custom header images
135 on posts and pages and as large images on featured "sticky" posts),
136 and special styles for six different post formats.
137
138 %package theme-twentytwelve
139 Summary:        WordPress Twenty Twelve theme
140 Group:          Applications/WWW
141 URL:            http://wordpress.org/extend/themes/twentytwelve
142 Requires:       %{name} = %{version}-%{release}
143
144 %description theme-twentytwelve
145 The 2012 theme for WordPress is a fully responsive theme that looks
146 great on any device.
147
148 Features include a front page template with its own widgets, an
149 optional display font, styling for post formats on both index and
150 single views, and an optional no-sidebar page template. Make it yours
151 with a custom menu, header image, and background.
152
153 %prep
154 %setup -qc
155 mv %{name}/* . && rmdir %{name}
156 %undos -f php,js,html
157 %patch0 -p1
158 %patch1 -p1
159 cp -p wp-config{-sample,}.php
160 %patch2 -p1
161 %patch3 -p1
162 %patch4 -p1
163 %patch6 -p1
164 %patch7 -p1
165 cp -p %{SOURCE3} .
166
167 %{__rm} license.txt
168 %{__rm} wp-content/themes/index.php
169 %{__rm} wp-content/plugins/index.php
170 %{__rm} wp-content/index.php
171
172 # remove .js/.css with matching minified file
173 find -name '*.min.js' | while read min; do
174         js=${min%.min.js}.js
175         test -e $js && echo $js
176 done | xargs rm -v
177
178 find -name '*.min.css' | while read min; do
179         css=${min%.min.css}.css
180         test -e $css && echo $css
181 done | xargs rm -v
182
183 # sample plugin
184 %{__rm} wp-content/plugins/hello.php
185
186 # system swfobject
187 %{__rm} wp-includes/js/swfobject.js
188
189 # system simplepie
190 %{__rm} wp-includes/class-simplepie.php
191
192 # system php-pear-Text_Diff
193 %{__rm} -r wp-includes/Text/Diff*
194 rmdir wp-includes/Text
195
196 # system atomlib
197 %{__rm} wp-includes/atomlib.php
198
199 # system phpmailer
200 %{__rm} wp-includes/class-phpmailer.php
201 %{__rm} wp-includes/class-smtp.php
202
203 # php 5.2 + json ext satisfies this compat
204 %{__rm} wp-includes/class-json.php
205
206 %{__rm} wp-content/plugins/akismet/.htaccess
207
208 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
209
210 %build
211 install -d wp-content/languages
212 msgfmt --statistics %{SOURCE6} -o wp-content/languages/et.mo
213 msgfmt --statistics %{SOURCE7} -o wp-content/languages/pl_PL.mo
214
215 %install
216 rm -rf $RPM_BUILD_ROOT
217 install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}}
218
219 cp -a . $RPM_BUILD_ROOT%{_appdir}
220 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php
221 rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html
222 rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt
223
224 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure
225 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup
226 ln -s %{_bindir}/wp-setup $RPM_BUILD_ROOT%{_appdir}/wp-setup.sh
227 ln -s %{_bindir}/wp-secure $RPM_BUILD_ROOT%{_appdir}/wp-secure.sh
228
229 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
230 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
231 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
232
233 %clean
234 rm -rf $RPM_BUILD_ROOT
235
236 %post
237 if [ "$1" = 1 ]; then
238         %banner -e %{name} <<-EOF
239         To finish your configuration DO NOT FORGET to:
240
241         1) Create some MySQL database owned by some user
242         2) Edit the file: %{_sysconfdir}/wp-config.php
243         3) Install %{name}-setup
244         4) Run a browser and visit: http://`hostname`/wordpress/wp-admin/install.php
245 EOF
246 fi
247
248 %post setup
249 chmod 660 %{_sysconfdir}/wp-config.php
250 chown root:http %{_sysconfdir}/wp-config.php
251
252 %postun setup
253 if [ "$1" = "0" ]; then
254         chmod 640 %{_sysconfdir}/wp-config.php
255         chown root:http %{_sysconfdir}/wp-config.php
256 fi
257
258 %triggerin -- apache1 < 1.3.37-3, apache1-base
259 %webapp_register apache %{_webapp}
260
261 %triggerin -- lighttpd
262 %webapp_register lighttpd %{_webapp}
263
264 %triggerun -- apache1 < 1.3.37-3, apache1-base
265 %webapp_unregister apache %{_webapp}
266
267 %triggerin -- apache < 2.2.0, apache-base
268 %webapp_register httpd %{_webapp}
269
270 %triggerun -- apache < 2.2.0, apache-base
271 %webapp_unregister httpd %{_webapp}
272
273 %triggerun -- lighttpd
274 %webapp_unregister lighttpd %{_webapp}
275
276 %files
277 %defattr(644,root,root,755)
278 %doc readme.html wp-setup.txt
279 %dir %attr(750,root,http) %{_sysconfdir}
280 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
281 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
282 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
283 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php
284
285 %dir %{_appdir}
286 %{_appdir}/*.php
287 %{_appdir}/wp-includes
288 %dir %{_appdir}/wp-content
289 %dir %{_appdir}/wp-content/languages
290 %lang(et) %{_appdir}/wp-content/languages/et.mo
291 %lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo
292 %dir %{_appdir}/wp-content/plugins
293 %dir %{_appdir}/wp-content/mu-plugins
294 %dir %{_appdir}/wp-content/themes
295
296 # needed for daily moderation
297 %{_appdir}/wp-admin
298
299 %attr(775,root,http) /var/lib/%{name}
300 %attr(775,root,http) /var/log/%{name}
301
302 %files setup
303 %defattr(644,root,root,755)
304 %attr(755,root,root) %{_bindir}/wp-secure
305 %attr(755,root,root) %{_bindir}/wp-setup
306 %{_appdir}/wp-secure.sh
307 %{_appdir}/wp-setup.sh
308
309 %files plugin-akismet
310 %defattr(644,root,root,755)
311 %dir %{_appdir}/wp-content/plugins/akismet
312 %doc %{_appdir}/wp-content/plugins/akismet/readme.txt
313 %{_appdir}/wp-content/plugins/akismet/*.css
314 %{_appdir}/wp-content/plugins/akismet/*.gif
315 %{_appdir}/wp-content/plugins/akismet/*.js
316 %{_appdir}/wp-content/plugins/akismet/*.php
317
318 %files theme-twentyeleven
319 %defattr(644,root,root,755)
320 %{_appdir}/wp-content/themes/twentyeleven
321
322 %files theme-twentytwelve
323 %defattr(644,root,root,755)
324 %{_appdir}/wp-content/themes/twentytwelve
This page took 0.090637 seconds and 4 git commands to generate.