]>
Commit | Line | Data |
---|---|---|
0f7aa528 ER |
1 | # TODO |
2 | # - gettext mo to system dir, add all possible languages? | |
7f9b628a | 3 | # - merge changes from wpmu.spec |
892232a9 | 4 | %define php_min_version 5.2.1 |
ec33fe30 | 5 | Summary: Personal publishing system |
fbfe2ed5 | 6 | Summary(pl.UTF-8): Osobisty system publikacji |
ec33fe30 | 7 | Name: wordpress |
cce583e4 | 8 | Version: 3.5.2 |
98efe338 | 9 | Release: 3 |
b04365ce | 10 | License: GPL v2 |
ec33fe30 | 11 | Group: Applications/Publishing |
c674f72d | 12 | Source0: http://wordpress.org/%{name}-%{version}.tar.gz |
cce583e4 | 13 | # Source0-md5: 90acae65199db7b33084ef36860d7f22 |
54d512d5 | 14 | Source1: wp-secure.sh |
15 | Source2: wp-setup.sh | |
16 | Source3: wp-setup.txt | |
7890ba25 ER |
17 | Source4: apache.conf |
18 | Source5: lighttpd.conf | |
3a28a4d4 ER |
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 | |
c1fcdc96 | 25 | Patch0: configpath.patch |
f7f07f8c | 26 | Patch1: multisite.patch |
c1fcdc96 | 27 | Patch2: %{name}.patch |
20f21eaf | 28 | Patch3: simplepie.patch |
6b07f5b7 | 29 | Patch4: pear-text-diff.patch |
0326e7b5 | 30 | Patch6: swfobject.patch |
953c98d7 | 31 | Patch7: phpmailer.patch |
7f9b628a | 32 | URL: http://www.wordpress.org/ |
8102095c | 33 | BuildRequires: gettext-tools |
892232a9 | 34 | BuildRequires: rpm-php-pearprov |
7f9b628a | 35 | BuildRequires: rpmbuild(macros) >= 1.553 |
3a28a4d4 | 36 | Requires: js-swfobject >= 2.2 |
5aa92314 | 37 | Requires: php(core) >= %{php_min_version} |
3a28a4d4 | 38 | Requires: php(date) |
c78a256f ER |
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) | |
6b07f5b7 | 50 | Requires: php-pear-Text_Diff |
953c98d7 | 51 | Requires: php-phpmailer >= 2.0.4 |
20f21eaf | 52 | Requires: php-simplepie >= 1.2 |
3ab985b1 | 53 | Requires: webapps |
892232a9 | 54 | Requires: webserver(php) |
edeb68e0 | 55 | BuildArch: noarch |
ec33fe30 | 56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
57 | ||
20f21eaf ER |
58 | # no pear deps |
59 | %define _noautopear pear | |
60 | ||
892232a9 | 61 | %define _noautophp php-ftp php-gd php-openssl php-simplexml |
20f21eaf ER |
62 | |
63 | # put it together for rpmbuild | |
64 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
65 | ||
3ab985b1 ER |
66 | %define _appdir %{_datadir}/%{name} |
67 | %define _webapps /etc/webapps | |
68 | %define _webapp %{name} | |
69 | %define _sysconfdir %{_webapps}/%{_webapp} | |
ec33fe30 | 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 | ||
0677b3c7 JR |
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 | |
ec33fe30 | 84 | eleganckiego, dobrze zaprojektowanego, osobistego systemu publikacji |
0677b3c7 JR |
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. | |
ec33fe30 | 89 | |
c674f72d | 90 | %package setup |
3a28a4d4 ER |
91 | Summary: WordPress setup package |
92 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji WordPress | |
c674f72d ER |
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 | ||
a095fc01 | 106 | %package plugin-akismet |
3a28a4d4 | 107 | Summary: WordPress Akismet Plugin |
a095fc01 ER |
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 | ||
3a28a4d4 ER |
116 | %package theme-twentyeleven |
117 | Summary: WordPress Twenty Eleven theme | |
ed53548e | 118 | Group: Applications/WWW |
3a28a4d4 | 119 | URL: http://wordpress.org/extend/themes/twentyeleven |
ed53548e ER |
120 | Requires: %{name} = %{version}-%{release} |
121 | ||
3a28a4d4 ER |
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. | |
ed53548e | 147 | |
3a28a4d4 ER |
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. | |
ed53548e | 152 | |
ec33fe30 | 153 | %prep |
7f9b628a ER |
154 | %setup -qc |
155 | mv %{name}/* . && rmdir %{name} | |
bbcdc79a | 156 | %undos -f php,js,html |
c674f72d | 157 | %patch0 -p1 |
ed53548e | 158 | %patch1 -p1 |
3a28a4d4 | 159 | cp -p wp-config{-sample,}.php |
c1fcdc96 | 160 | %patch2 -p1 |
6b07f5b7 ER |
161 | %patch3 -p1 |
162 | %patch4 -p1 | |
0326e7b5 | 163 | %patch6 -p1 |
408dbc69 | 164 | %patch7 -p1 |
3a28a4d4 | 165 | cp -p %{SOURCE3} . |
ec33fe30 | 166 | |
3a28a4d4 ER |
167 | %{__rm} license.txt |
168 | %{__rm} wp-content/themes/index.php | |
169 | %{__rm} wp-content/plugins/index.php | |
170 | %{__rm} wp-content/index.php | |
7f9b628a | 171 | |
3a28a4d4 ER |
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 | |
6b07f5b7 | 182 | |
a095fc01 | 183 | # sample plugin |
3a28a4d4 | 184 | %{__rm} wp-content/plugins/hello.php |
a095fc01 | 185 | |
6b07f5b7 | 186 | # system swfobject |
3a28a4d4 | 187 | %{__rm} wp-includes/js/swfobject.js |
6b07f5b7 | 188 | |
20f21eaf | 189 | # system simplepie |
3a28a4d4 | 190 | %{__rm} wp-includes/class-simplepie.php |
7191aabf | 191 | |
6b07f5b7 | 192 | # system php-pear-Text_Diff |
3a28a4d4 | 193 | %{__rm} -r wp-includes/Text/Diff* |
6b07f5b7 ER |
194 | rmdir wp-includes/Text |
195 | ||
196 | # system atomlib | |
3a28a4d4 | 197 | %{__rm} wp-includes/atomlib.php |
6b07f5b7 | 198 | |
953c98d7 | 199 | # system phpmailer |
3a28a4d4 ER |
200 | %{__rm} wp-includes/class-phpmailer.php |
201 | %{__rm} wp-includes/class-smtp.php | |
953c98d7 ER |
202 | |
203 | # php 5.2 + json ext satisfies this compat | |
3a28a4d4 ER |
204 | %{__rm} wp-includes/class-json.php |
205 | ||
206 | %{__rm} wp-content/plugins/akismet/.htaccess | |
953c98d7 | 207 | |
7ccb4aa4 | 208 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
c674f72d | 209 | |
7f9b628a ER |
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 | ||
ec33fe30 | 215 | %install |
216 | rm -rf $RPM_BUILD_ROOT | |
f7f07f8c | 217 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}} |
ec33fe30 | 218 | |
c674f72d | 219 | cp -a . $RPM_BUILD_ROOT%{_appdir} |
bbcdc79a | 220 | mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php |
3ab985b1 ER |
221 | rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html |
222 | rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt | |
c674f72d | 223 | |
7f9b628a ER |
224 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure |
225 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup | |
c674f72d ER |
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 | |
4b140d58 | 228 | |
3a28a4d4 ER |
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 | |
20ae9c53 | 232 | |
edeb68e0 JB |
233 | %clean |
234 | rm -rf $RPM_BUILD_ROOT | |
235 | ||
ec33fe30 | 236 | %post |
c674f72d | 237 | if [ "$1" = 1 ]; then |
3ab985b1 ER |
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 | |
c674f72d ER |
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 | |
3ab985b1 | 245 | EOF |
20ae9c53 | 246 | fi |
3ab985b1 | 247 | |
c674f72d ER |
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 | ||
b973cc00 | 258 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
259 | %webapp_register apache %{_webapp} |
260 | ||
ca1cad3e RT |
261 | %triggerin -- lighttpd |
262 | %webapp_register lighttpd %{_webapp} | |
263 | ||
b973cc00 | 264 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
265 | %webapp_unregister apache %{_webapp} |
266 | ||
67fdbf99 | 267 | %triggerin -- apache < 2.2.0, apache-base |
3ab985b1 ER |
268 | %webapp_register httpd %{_webapp} |
269 | ||
67fdbf99 | 270 | %triggerun -- apache < 2.2.0, apache-base |
3ab985b1 ER |
271 | %webapp_unregister httpd %{_webapp} |
272 | ||
ca1cad3e RT |
273 | %triggerun -- lighttpd |
274 | %webapp_unregister lighttpd %{_webapp} | |
275 | ||
ec33fe30 | 276 | %files |
843f1ee3 | 277 | %defattr(644,root,root,755) |
278 | %doc readme.html wp-setup.txt | |
3ab985b1 ER |
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 | |
ca1cad3e | 282 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
c674f72d | 283 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php |
3ab985b1 ER |
284 | |
285 | %dir %{_appdir} | |
3ab985b1 | 286 | %{_appdir}/*.php |
c674f72d | 287 | %{_appdir}/wp-includes |
c674f72d ER |
288 | %dir %{_appdir}/wp-content |
289 | %dir %{_appdir}/wp-content/languages | |
0f7aa528 ER |
290 | %lang(et) %{_appdir}/wp-content/languages/et.mo |
291 | %lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo | |
c674f72d | 292 | %dir %{_appdir}/wp-content/plugins |
82c8bcde | 293 | %dir %{_appdir}/wp-content/mu-plugins |
c674f72d | 294 | %dir %{_appdir}/wp-content/themes |
c674f72d | 295 | |
20f21eaf ER |
296 | # needed for daily moderation |
297 | %{_appdir}/wp-admin | |
298 | ||
f7f07f8c ER |
299 | %attr(775,root,http) /var/lib/%{name} |
300 | %attr(775,root,http) /var/log/%{name} | |
301 | ||
c674f72d ER |
302 | %files setup |
303 | %defattr(644,root,root,755) | |
022de391 | 304 | %attr(755,root,root) %{_bindir}/wp-secure |
305 | %attr(755,root,root) %{_bindir}/wp-setup | |
c674f72d ER |
306 | %{_appdir}/wp-secure.sh |
307 | %{_appdir}/wp-setup.sh | |
ed53548e | 308 | |
a095fc01 ER |
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 | |
3a28a4d4 | 313 | %{_appdir}/wp-content/plugins/akismet/*.css |
a095fc01 | 314 | %{_appdir}/wp-content/plugins/akismet/*.gif |
3a28a4d4 ER |
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 | |
a095fc01 | 321 | |
3a28a4d4 | 322 | %files theme-twentytwelve |
ed53548e | 323 | %defattr(644,root,root,755) |
3a28a4d4 | 324 | %{_appdir}/wp-content/themes/twentytwelve |