2 # - gettext mo to system dir, add all possible languages?
3 # - merge changes from wpmu.spec
4 %include /usr/lib/rpm/macros.php
5 %define php_min_version 5.2.1
6 Summary: Personal publishing system
7 Summary(pl.UTF-8): Osobisty system publikacji
12 Group: Applications/Publishing
13 Source0: http://wordpress.org/%{name}-%{version}.tar.gz
14 # Source0-md5: 90acae65199db7b33084ef36860d7f22
19 Source5: lighttpd.conf
21 Source6: http://svn.automattic.com/wordpress-i18n/et/tags/3.5/messages/et.po
22 # Source6-md5: e6fbcf1940701ce6f1f91c0ad4ed5a99
23 # no messages under 3.5 tag
24 Source7: http://svn.automattic.com/wordpress-i18n/pl_PL/tags/3.2.1/messages/pl_PL.po
25 # Source7-md5: a0f5d65b7d4e5d53209edc595a19ff49
26 Patch0: configpath.patch
27 Patch1: multisite.patch
29 Patch3: simplepie.patch
30 Patch4: pear-text-diff.patch
31 Patch6: swfobject.patch
32 Patch7: phpmailer.patch
33 URL: http://www.wordpress.org/
34 BuildRequires: gettext-devel
35 BuildRequires: rpm-php-pearprov
36 BuildRequires: rpmbuild(macros) >= 1.553
37 Requires: js-swfobject >= 2.2
38 Requires: php(core) >= %{php_min_version}
41 Requires: php(gettext)
45 Requires: php(mbstring)
49 Requires: php(tokenizer)
51 Requires: php-pear-Text_Diff
52 Requires: php-phpmailer >= 2.0.4
53 Requires: php-simplepie >= 1.2
55 Requires: webserver(php)
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 %define _noautopear pear
62 %define _noautophp php-ftp php-gd php-openssl php-simplexml
64 # put it together for rpmbuild
65 %define _noautoreq %{?_noautophp} %{?_noautopear}
67 %define _appdir %{_datadir}/%{name}
68 %define _webapps /etc/webapps
69 %define _webapp %{name}
70 %define _sysconfdir %{_webapps}/%{_webapp}
73 WordPress is a state-of-the-art semantic personal publishing platform
74 with a focus on aesthetics, web standards, and usability. WordPress
75 was born out of a desire for an elegant, well-architectured personal
76 publishing system (also called blog or weblog) built on PHP and MySQL
77 and licensed under the GPL. It is the official successor of
78 b2/cafelog. WordPress is fresh software, but its roots and development
81 %description -l pl.UTF-8
82 WordPress jest technologicznie dopracowaną, semantyczną, osobistą
83 platformą do publikacji kładącą nacisk na standardy WWW oraz
84 użyteczność. WordPress został stworzony w wyniku potrzeby
85 eleganckiego, dobrze zaprojektowanego, osobistego systemu publikacji
86 (nazywanego również blogiem czy weblogiem). Jest to system oparty o
87 PHP i MySQL oraz na licencji GPL. Jest oficjalnym następcą b2/cafelog.
88 WordPress jest nowym oprogramowaniem, ale jego korzenie i rozwój
92 Summary: WordPress setup package
93 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji WordPress
94 Group: Applications/WWW
95 Requires: %{name} = %{version}-%{release}
98 Install this package to configure initial WordPress installation. You
99 should uninstall this package when you're done, as it considered
100 insecure to keep the setup files in place.
102 %description setup -l pl.UTF-8
103 Ten pakiet należy zainstalować w celu wstępnej konfiguracji WordPress
104 po pierwszej instalacji. Potem należy go odinstalować, jako że
105 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
107 %package plugin-akismet
108 Summary: WordPress Akismet Plugin
109 Group: Applications/WWW
110 Requires: %{name} = %{version}-%{release}
112 %description plugin-akismet
113 Akismet checks your comments against the Akismet web service to see if
114 they look like spam or not and lets you review the spam it catches
115 under your blog's "Comments" admin screen.
117 %package theme-twentyeleven
118 Summary: WordPress Twenty Eleven theme
119 Group: Applications/WWW
120 URL: http://wordpress.org/extend/themes/twentyeleven
121 Requires: %{name} = %{version}-%{release}
123 %description theme-twentyeleven
124 The 2011 theme for WordPress is sophisticated, lightweight, and
127 Make it yours with a custom menu, header image, and background -- then
128 go further with available theme options for light or dark color
129 scheme, custom link colors, and three layout choices. Twenty Eleven
130 comes equipped with a Showcase page template that transforms your
131 front page into a showcase to show off your best content, widget
132 support galore (sidebar, three footer areas, and a Showcase page
133 widget area), and a custom "Ephemera" widget to display your Aside,
134 Link, Quote, or Status posts. Included are styles for print and for
135 the admin editor, support for featured images (as custom header images
136 on posts and pages and as large images on featured "sticky" posts),
137 and special styles for six different post formats.
139 %package theme-twentytwelve
140 Summary: WordPress Twenty Twelve theme
141 Group: Applications/WWW
142 URL: http://wordpress.org/extend/themes/twentytwelve
143 Requires: %{name} = %{version}-%{release}
145 %description theme-twentytwelve
146 The 2012 theme for WordPress is a fully responsive theme that looks
149 Features include a front page template with its own widgets, an
150 optional display font, styling for post formats on both index and
151 single views, and an optional no-sidebar page template. Make it yours
152 with a custom menu, header image, and background.
156 mv %{name}/* . && rmdir %{name}
157 %undos -f php,js,html
160 cp -p wp-config{-sample,}.php
169 %{__rm} wp-content/themes/index.php
170 %{__rm} wp-content/plugins/index.php
171 %{__rm} wp-content/index.php
173 # remove .js/.css with matching minified file
174 find -name '*.min.js' | while read min; do
176 test -e $js && echo $js
179 find -name '*.min.css' | while read min; do
180 css=${min%.min.css}.css
181 test -e $css && echo $css
185 %{__rm} wp-content/plugins/hello.php
188 %{__rm} wp-includes/js/swfobject.js
191 %{__rm} wp-includes/class-simplepie.php
193 # system php-pear-Text_Diff
194 %{__rm} -r wp-includes/Text/Diff*
195 rmdir wp-includes/Text
198 %{__rm} wp-includes/atomlib.php
201 %{__rm} wp-includes/class-phpmailer.php
202 %{__rm} wp-includes/class-smtp.php
204 # php 5.2 + json ext satisfies this compat
205 %{__rm} wp-includes/class-json.php
207 %{__rm} wp-content/plugins/akismet/.htaccess
209 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
212 install -d wp-content/languages
213 msgfmt --statistics %{SOURCE6} -o wp-content/languages/et.mo
214 msgfmt --statistics %{SOURCE7} -o wp-content/languages/pl_PL.mo
217 rm -rf $RPM_BUILD_ROOT
218 install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}}
220 cp -a . $RPM_BUILD_ROOT%{_appdir}
221 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php
222 rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html
223 rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt
225 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure
226 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup
227 ln -s %{_bindir}/wp-setup $RPM_BUILD_ROOT%{_appdir}/wp-setup.sh
228 ln -s %{_bindir}/wp-secure $RPM_BUILD_ROOT%{_appdir}/wp-secure.sh
230 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
231 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
232 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
235 rm -rf $RPM_BUILD_ROOT
238 if [ "$1" = 1 ]; then
239 %banner -e %{name} <<-EOF
240 To finish your configuration DO NOT FORGET to:
242 1) Create some MySQL database owned by some user
243 2) Edit the file: %{_sysconfdir}/wp-config.php
244 3) Install %{name}-setup
245 4) Run a browser and visit: http://`hostname`/wordpress/wp-admin/install.php
250 chmod 660 %{_sysconfdir}/wp-config.php
251 chown root:http %{_sysconfdir}/wp-config.php
254 if [ "$1" = "0" ]; then
255 chmod 640 %{_sysconfdir}/wp-config.php
256 chown root:http %{_sysconfdir}/wp-config.php
259 %triggerin -- apache1 < 1.3.37-3, apache1-base
260 %webapp_register apache %{_webapp}
262 %triggerin -- lighttpd
263 %webapp_register lighttpd %{_webapp}
265 %triggerun -- apache1 < 1.3.37-3, apache1-base
266 %webapp_unregister apache %{_webapp}
268 %triggerin -- apache < 2.2.0, apache-base
269 %webapp_register httpd %{_webapp}
271 %triggerun -- apache < 2.2.0, apache-base
272 %webapp_unregister httpd %{_webapp}
274 %triggerun -- lighttpd
275 %webapp_unregister lighttpd %{_webapp}
278 %defattr(644,root,root,755)
279 %doc readme.html wp-setup.txt
280 %dir %attr(750,root,http) %{_sysconfdir}
281 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
282 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
283 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
284 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php
288 %{_appdir}/wp-includes
289 %dir %{_appdir}/wp-content
290 %dir %{_appdir}/wp-content/languages
291 %lang(et) %{_appdir}/wp-content/languages/et.mo
292 %lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo
293 %dir %{_appdir}/wp-content/plugins
294 %dir %{_appdir}/wp-content/mu-plugins
295 %dir %{_appdir}/wp-content/themes
297 # needed for daily moderation
300 %attr(775,root,http) /var/lib/%{name}
301 %attr(775,root,http) /var/log/%{name}
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_bindir}/wp-secure
306 %attr(755,root,root) %{_bindir}/wp-setup
307 %{_appdir}/wp-secure.sh
308 %{_appdir}/wp-setup.sh
310 %files plugin-akismet
311 %defattr(644,root,root,755)
312 %dir %{_appdir}/wp-content/plugins/akismet
313 %doc %{_appdir}/wp-content/plugins/akismet/readme.txt
314 %{_appdir}/wp-content/plugins/akismet/*.css
315 %{_appdir}/wp-content/plugins/akismet/*.gif
316 %{_appdir}/wp-content/plugins/akismet/*.js
317 %{_appdir}/wp-content/plugins/akismet/*.php
319 %files theme-twentyeleven
320 %defattr(644,root,root,755)
321 %{_appdir}/wp-content/themes/twentyeleven
323 %files theme-twentytwelve
324 %defattr(644,root,root,755)
325 %{_appdir}/wp-content/themes/twentytwelve