]>
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 ER |
4 | %include /usr/lib/rpm/macros.php |
5 | %define php_min_version 5.2.1 | |
ec33fe30 | 6 | Summary: Personal publishing system |
fbfe2ed5 | 7 | Summary(pl.UTF-8): Osobisty system publikacji |
ec33fe30 | 8 | Name: wordpress |
cce583e4 | 9 | Version: 3.5.2 |
134ce8ee | 10 | Release: 2 |
b04365ce | 11 | License: GPL v2 |
ec33fe30 | 12 | Group: Applications/Publishing |
c674f72d | 13 | Source0: http://wordpress.org/%{name}-%{version}.tar.gz |
cce583e4 | 14 | # Source0-md5: 90acae65199db7b33084ef36860d7f22 |
54d512d5 | 15 | Source1: wp-secure.sh |
16 | Source2: wp-setup.sh | |
17 | Source3: wp-setup.txt | |
7890ba25 ER |
18 | Source4: apache.conf |
19 | Source5: lighttpd.conf | |
3a28a4d4 ER |
20 | # no 3.5.1 tag |
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 | |
c1fcdc96 | 26 | Patch0: configpath.patch |
f7f07f8c | 27 | Patch1: multisite.patch |
c1fcdc96 | 28 | Patch2: %{name}.patch |
20f21eaf | 29 | Patch3: simplepie.patch |
6b07f5b7 | 30 | Patch4: pear-text-diff.patch |
0326e7b5 | 31 | Patch6: swfobject.patch |
953c98d7 | 32 | Patch7: phpmailer.patch |
7f9b628a ER |
33 | URL: http://www.wordpress.org/ |
34 | BuildRequires: gettext-devel | |
892232a9 | 35 | BuildRequires: rpm-php-pearprov |
7f9b628a | 36 | BuildRequires: rpmbuild(macros) >= 1.553 |
3a28a4d4 | 37 | Requires: js-swfobject >= 2.2 |
5aa92314 | 38 | Requires: php(core) >= %{php_min_version} |
3a28a4d4 | 39 | Requires: php(date) |
c78a256f ER |
40 | Requires: php(dom) |
41 | Requires: php(gettext) | |
42 | Requires: php(hash) | |
43 | Requires: php(iconv) | |
44 | Requires: php(json) | |
45 | Requires: php(mbstring) | |
46 | Requires: php(mysql) | |
47 | Requires: php(pcre) | |
48 | Requires: php(spl) | |
49 | Requires: php(tokenizer) | |
50 | Requires: php(xml) | |
6b07f5b7 | 51 | Requires: php-pear-Text_Diff |
953c98d7 | 52 | Requires: php-phpmailer >= 2.0.4 |
20f21eaf | 53 | Requires: php-simplepie >= 1.2 |
3ab985b1 | 54 | Requires: webapps |
892232a9 | 55 | Requires: webserver(php) |
edeb68e0 | 56 | BuildArch: noarch |
ec33fe30 | 57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
58 | ||
20f21eaf ER |
59 | # no pear deps |
60 | %define _noautopear pear | |
61 | ||
892232a9 | 62 | %define _noautophp php-ftp php-gd php-openssl php-simplexml |
20f21eaf ER |
63 | |
64 | # put it together for rpmbuild | |
65 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
66 | ||
3ab985b1 ER |
67 | %define _appdir %{_datadir}/%{name} |
68 | %define _webapps /etc/webapps | |
69 | %define _webapp %{name} | |
70 | %define _sysconfdir %{_webapps}/%{_webapp} | |
ec33fe30 | 71 | |
72 | %description | |
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 | |
79 | go back to 2001. | |
80 | ||
0677b3c7 JR |
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 | |
ec33fe30 | 85 | eleganckiego, dobrze zaprojektowanego, osobistego systemu publikacji |
0677b3c7 JR |
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 | |
89 | sięgają 2001 roku. | |
ec33fe30 | 90 | |
c674f72d | 91 | %package setup |
3a28a4d4 ER |
92 | Summary: WordPress setup package |
93 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji WordPress | |
c674f72d ER |
94 | Group: Applications/WWW |
95 | Requires: %{name} = %{version}-%{release} | |
96 | ||
97 | %description setup | |
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. | |
101 | ||
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. | |
106 | ||
a095fc01 | 107 | %package plugin-akismet |
3a28a4d4 | 108 | Summary: WordPress Akismet Plugin |
a095fc01 ER |
109 | Group: Applications/WWW |
110 | Requires: %{name} = %{version}-%{release} | |
111 | ||
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. | |
116 | ||
3a28a4d4 ER |
117 | %package theme-twentyeleven |
118 | Summary: WordPress Twenty Eleven theme | |
ed53548e | 119 | Group: Applications/WWW |
3a28a4d4 | 120 | URL: http://wordpress.org/extend/themes/twentyeleven |
ed53548e ER |
121 | Requires: %{name} = %{version}-%{release} |
122 | ||
3a28a4d4 ER |
123 | %description theme-twentyeleven |
124 | The 2011 theme for WordPress is sophisticated, lightweight, and | |
125 | adaptable. | |
126 | ||
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. | |
138 | ||
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} | |
144 | ||
145 | %description theme-twentytwelve | |
146 | The 2012 theme for WordPress is a fully responsive theme that looks | |
147 | great on any device. | |
ed53548e | 148 | |
3a28a4d4 ER |
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. | |
ed53548e | 153 | |
ec33fe30 | 154 | %prep |
7f9b628a ER |
155 | %setup -qc |
156 | mv %{name}/* . && rmdir %{name} | |
bbcdc79a | 157 | %undos -f php,js,html |
c674f72d | 158 | %patch0 -p1 |
ed53548e | 159 | %patch1 -p1 |
3a28a4d4 | 160 | cp -p wp-config{-sample,}.php |
c1fcdc96 | 161 | %patch2 -p1 |
6b07f5b7 ER |
162 | %patch3 -p1 |
163 | %patch4 -p1 | |
0326e7b5 | 164 | %patch6 -p1 |
408dbc69 | 165 | %patch7 -p1 |
3a28a4d4 | 166 | cp -p %{SOURCE3} . |
ec33fe30 | 167 | |
3a28a4d4 ER |
168 | %{__rm} license.txt |
169 | %{__rm} wp-content/themes/index.php | |
170 | %{__rm} wp-content/plugins/index.php | |
171 | %{__rm} wp-content/index.php | |
7f9b628a | 172 | |
3a28a4d4 ER |
173 | # remove .js/.css with matching minified file |
174 | find -name '*.min.js' | while read min; do | |
175 | js=${min%.min.js}.js | |
176 | test -e $js && echo $js | |
177 | done | xargs rm -v | |
178 | ||
179 | find -name '*.min.css' | while read min; do | |
180 | css=${min%.min.css}.css | |
181 | test -e $css && echo $css | |
182 | done | xargs rm -v | |
6b07f5b7 | 183 | |
a095fc01 | 184 | # sample plugin |
3a28a4d4 | 185 | %{__rm} wp-content/plugins/hello.php |
a095fc01 | 186 | |
6b07f5b7 | 187 | # system swfobject |
3a28a4d4 | 188 | %{__rm} wp-includes/js/swfobject.js |
6b07f5b7 | 189 | |
20f21eaf | 190 | # system simplepie |
3a28a4d4 | 191 | %{__rm} wp-includes/class-simplepie.php |
7191aabf | 192 | |
6b07f5b7 | 193 | # system php-pear-Text_Diff |
3a28a4d4 | 194 | %{__rm} -r wp-includes/Text/Diff* |
6b07f5b7 ER |
195 | rmdir wp-includes/Text |
196 | ||
197 | # system atomlib | |
3a28a4d4 | 198 | %{__rm} wp-includes/atomlib.php |
6b07f5b7 | 199 | |
953c98d7 | 200 | # system phpmailer |
3a28a4d4 ER |
201 | %{__rm} wp-includes/class-phpmailer.php |
202 | %{__rm} wp-includes/class-smtp.php | |
953c98d7 ER |
203 | |
204 | # php 5.2 + json ext satisfies this compat | |
3a28a4d4 ER |
205 | %{__rm} wp-includes/class-json.php |
206 | ||
207 | %{__rm} wp-content/plugins/akismet/.htaccess | |
953c98d7 | 208 | |
7ccb4aa4 | 209 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
c674f72d | 210 | |
7f9b628a ER |
211 | %build |
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 | |
215 | ||
ec33fe30 | 216 | %install |
217 | rm -rf $RPM_BUILD_ROOT | |
f7f07f8c | 218 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}} |
ec33fe30 | 219 | |
c674f72d | 220 | cp -a . $RPM_BUILD_ROOT%{_appdir} |
bbcdc79a | 221 | mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php |
3ab985b1 ER |
222 | rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html |
223 | rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt | |
c674f72d | 224 | |
7f9b628a ER |
225 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure |
226 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup | |
c674f72d ER |
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 | |
4b140d58 | 229 | |
3a28a4d4 ER |
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 | |
20ae9c53 | 233 | |
edeb68e0 JB |
234 | %clean |
235 | rm -rf $RPM_BUILD_ROOT | |
236 | ||
ec33fe30 | 237 | %post |
c674f72d | 238 | if [ "$1" = 1 ]; then |
3ab985b1 ER |
239 | %banner -e %{name} <<-EOF |
240 | To finish your configuration DO NOT FORGET to: | |
241 | ||
242 | 1) Create some MySQL database owned by some user | |
c674f72d ER |
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 | |
3ab985b1 | 246 | EOF |
20ae9c53 | 247 | fi |
3ab985b1 | 248 | |
c674f72d ER |
249 | %post setup |
250 | chmod 660 %{_sysconfdir}/wp-config.php | |
251 | chown root:http %{_sysconfdir}/wp-config.php | |
252 | ||
253 | %postun setup | |
254 | if [ "$1" = "0" ]; then | |
255 | chmod 640 %{_sysconfdir}/wp-config.php | |
256 | chown root:http %{_sysconfdir}/wp-config.php | |
257 | fi | |
258 | ||
b973cc00 | 259 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
260 | %webapp_register apache %{_webapp} |
261 | ||
ca1cad3e RT |
262 | %triggerin -- lighttpd |
263 | %webapp_register lighttpd %{_webapp} | |
264 | ||
b973cc00 | 265 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
266 | %webapp_unregister apache %{_webapp} |
267 | ||
67fdbf99 | 268 | %triggerin -- apache < 2.2.0, apache-base |
3ab985b1 ER |
269 | %webapp_register httpd %{_webapp} |
270 | ||
67fdbf99 | 271 | %triggerun -- apache < 2.2.0, apache-base |
3ab985b1 ER |
272 | %webapp_unregister httpd %{_webapp} |
273 | ||
ca1cad3e RT |
274 | %triggerun -- lighttpd |
275 | %webapp_unregister lighttpd %{_webapp} | |
276 | ||
ec33fe30 | 277 | %files |
843f1ee3 | 278 | %defattr(644,root,root,755) |
279 | %doc readme.html wp-setup.txt | |
3ab985b1 ER |
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 | |
ca1cad3e | 283 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
c674f72d | 284 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php |
3ab985b1 ER |
285 | |
286 | %dir %{_appdir} | |
3ab985b1 | 287 | %{_appdir}/*.php |
c674f72d | 288 | %{_appdir}/wp-includes |
c674f72d ER |
289 | %dir %{_appdir}/wp-content |
290 | %dir %{_appdir}/wp-content/languages | |
0f7aa528 ER |
291 | %lang(et) %{_appdir}/wp-content/languages/et.mo |
292 | %lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo | |
c674f72d | 293 | %dir %{_appdir}/wp-content/plugins |
82c8bcde | 294 | %dir %{_appdir}/wp-content/mu-plugins |
c674f72d | 295 | %dir %{_appdir}/wp-content/themes |
c674f72d | 296 | |
20f21eaf ER |
297 | # needed for daily moderation |
298 | %{_appdir}/wp-admin | |
299 | ||
f7f07f8c ER |
300 | %attr(775,root,http) /var/lib/%{name} |
301 | %attr(775,root,http) /var/log/%{name} | |
302 | ||
c674f72d ER |
303 | %files setup |
304 | %defattr(644,root,root,755) | |
022de391 | 305 | %attr(755,root,root) %{_bindir}/wp-secure |
306 | %attr(755,root,root) %{_bindir}/wp-setup | |
c674f72d ER |
307 | %{_appdir}/wp-secure.sh |
308 | %{_appdir}/wp-setup.sh | |
ed53548e | 309 | |
a095fc01 ER |
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 | |
3a28a4d4 | 314 | %{_appdir}/wp-content/plugins/akismet/*.css |
a095fc01 | 315 | %{_appdir}/wp-content/plugins/akismet/*.gif |
3a28a4d4 ER |
316 | %{_appdir}/wp-content/plugins/akismet/*.js |
317 | %{_appdir}/wp-content/plugins/akismet/*.php | |
318 | ||
319 | %files theme-twentyeleven | |
320 | %defattr(644,root,root,755) | |
321 | %{_appdir}/wp-content/themes/twentyeleven | |
a095fc01 | 322 | |
3a28a4d4 | 323 | %files theme-twentytwelve |
ed53548e | 324 | %defattr(644,root,root,755) |
3a28a4d4 | 325 | %{_appdir}/wp-content/themes/twentytwelve |