]>
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 |
b04365ce | 9 | Version: 3.0.1 |
953c98d7 | 10 | Release: 0.14 |
b04365ce | 11 | License: GPL v2 |
ec33fe30 | 12 | Group: Applications/Publishing |
c674f72d | 13 | Source0: http://wordpress.org/%{name}-%{version}.tar.gz |
b04365ce | 14 | # Source0-md5: 8fa5373ed805fb9a6ee56dfd236dcb64 |
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 | |
0e9a5e64 ER |
20 | Source6: http://svn.automattic.com/wordpress-i18n/et/tags/%{version}/messages/et.po |
21 | # Source6-md5: 7ee698806091573a534a4889f88d6d97 | |
22 | Source7: http://svn.automattic.com/wordpress-i18n/pl_PL/tags/%{version}/messages/pl_PL.po | |
23 | # Source7-md5: 795864c6eeeadcc74b8ea70d45f22e9f | |
c1fcdc96 | 24 | Patch0: configpath.patch |
f7f07f8c | 25 | Patch1: multisite.patch |
c1fcdc96 | 26 | Patch2: %{name}.patch |
20f21eaf | 27 | Patch3: simplepie.patch |
6b07f5b7 ER |
28 | Patch4: pear-text-diff.patch |
29 | Patch5: atomlib.patch | |
0326e7b5 | 30 | Patch6: swfobject.patch |
953c98d7 | 31 | Patch7: phpmailer.patch |
7f9b628a ER |
32 | URL: http://www.wordpress.org/ |
33 | BuildRequires: gettext-devel | |
892232a9 | 34 | BuildRequires: rpm-php-pearprov |
7f9b628a | 35 | BuildRequires: rpmbuild(macros) >= 1.553 |
6b07f5b7 ER |
36 | Requires: js-swfobject >= 2.1 |
37 | Requires: php-atomlib >= 0.4 | |
892232a9 ER |
38 | Requires: php-common >= 4:%{php_min_version} |
39 | Requires: php-date | |
40 | Requires: php-dom | |
c674f72d | 41 | Requires: php-gettext |
892232a9 ER |
42 | Requires: php-hash |
43 | Requires: php-iconv | |
44 | Requires: php-json | |
45 | Requires: php-mbstring | |
c674f72d ER |
46 | Requires: php-mysql |
47 | Requires: php-pcre | |
6b07f5b7 | 48 | Requires: php-pear-Text_Diff |
953c98d7 | 49 | Requires: php-phpmailer >= 2.0.4 |
20f21eaf | 50 | Requires: php-simplepie >= 1.2 |
892232a9 ER |
51 | Requires: php-spl |
52 | Requires: php-tokenizer | |
c674f72d | 53 | Requires: php-xml |
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 ER |
91 | %package setup |
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} | |
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 ER |
107 | %package plugin-akismet |
108 | Summary: Wordpress Akismet Plugin | |
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 | ||
ed53548e ER |
117 | %package theme-twentyten |
118 | Summary: Wordpress MU default theme | |
119 | Group: Applications/WWW | |
120 | URL: http://wordpress.org/extend/themes/twentyten | |
121 | Requires: %{name} = %{version}-%{release} | |
122 | ||
123 | %description theme-twentyten | |
124 | The 2010 theme for WordPress is stylish, customizable, simple, and | |
125 | readable. | |
126 | ||
127 | Make it yours with a custom menu, header image, and background. Twenty | |
128 | Ten supports six widgetized areas (two in the sidebar, four in the | |
129 | footer) and featured images (thumbnails for gallery posts and custom | |
130 | header images for posts and pages). It includes stylesheets for print | |
131 | and the admin Visual Editor, special styles for posts in the "Asides" | |
132 | and "Gallery" categories, and has an optional one-column page template | |
133 | that removes the sidebar. | |
134 | ||
ec33fe30 | 135 | %prep |
7f9b628a ER |
136 | %setup -qc |
137 | mv %{name}/* . && rmdir %{name} | |
bbcdc79a | 138 | %undos -f php,js,html |
c674f72d | 139 | %patch0 -p1 |
ed53548e | 140 | %patch1 -p1 |
c1fcdc96 ER |
141 | cp -a wp-config{-sample,}.php |
142 | %patch2 -p1 | |
6b07f5b7 ER |
143 | %patch3 -p1 |
144 | %patch4 -p1 | |
145 | %patch5 -p1 | |
0326e7b5 | 146 | %patch6 -p1 |
7f9b628a | 147 | cp -a %{SOURCE3} . |
ec33fe30 | 148 | |
6b07f5b7 | 149 | rm license.txt |
7f9b628a ER |
150 | rm wp-content/themes/index.php |
151 | rm wp-content/plugins/index.php | |
152 | rm wp-content/index.php | |
153 | ||
6b07f5b7 ER |
154 | # remove *.dev js/.css |
155 | find -name *.dev.js | xargs rm -v | |
156 | find -name *.dev.css | xargs rm -v | |
157 | ||
a095fc01 ER |
158 | # sample plugin |
159 | rm wp-content/plugins/hello.php | |
160 | ||
6b07f5b7 ER |
161 | # system swfobject |
162 | rm wp-includes/js/swfobject.js | |
163 | ||
20f21eaf ER |
164 | # system simplepie |
165 | rm wp-includes/class-simplepie.php | |
7191aabf | 166 | |
6b07f5b7 ER |
167 | # system php-pear-Text_Diff |
168 | rm -r wp-includes/Text/Diff* | |
169 | rmdir wp-includes/Text | |
170 | ||
171 | # system atomlib | |
172 | rm wp-includes/atomlib.php | |
173 | ||
953c98d7 ER |
174 | # system phpmailer |
175 | rm wp-includes/class-phpmailer.php | |
176 | rm wp-includes/class-smtp.php | |
177 | ||
178 | # php 5.2 + json ext satisfies this compat | |
179 | rm wp-includes/class-json.php | |
180 | ||
7ccb4aa4 | 181 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
c674f72d | 182 | |
7f9b628a ER |
183 | %build |
184 | install -d wp-content/languages | |
185 | msgfmt --statistics %{SOURCE6} -o wp-content/languages/et.mo | |
186 | msgfmt --statistics %{SOURCE7} -o wp-content/languages/pl_PL.mo | |
187 | ||
ec33fe30 | 188 | %install |
189 | rm -rf $RPM_BUILD_ROOT | |
f7f07f8c | 190 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_bindir},%{_sysconfdir},%{_appdir}/wp-content/{languages,mu-plugins},/var/{lib,log}/%{name}} |
ec33fe30 | 191 | |
c674f72d | 192 | cp -a . $RPM_BUILD_ROOT%{_appdir} |
bbcdc79a | 193 | mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/wp-config.php |
3ab985b1 ER |
194 | rm -f $RPM_BUILD_ROOT%{_appdir}/readme.html |
195 | rm -f $RPM_BUILD_ROOT%{_appdir}/wp-setup.txt | |
c674f72d | 196 | |
7f9b628a ER |
197 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/wp-secure |
198 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/wp-setup | |
c674f72d ER |
199 | ln -s %{_bindir}/wp-setup $RPM_BUILD_ROOT%{_appdir}/wp-setup.sh |
200 | ln -s %{_bindir}/wp-secure $RPM_BUILD_ROOT%{_appdir}/wp-secure.sh | |
4b140d58 | 201 | |
7f9b628a ER |
202 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf |
203 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
204 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
20ae9c53 | 205 | |
edeb68e0 JB |
206 | %clean |
207 | rm -rf $RPM_BUILD_ROOT | |
208 | ||
ec33fe30 | 209 | %post |
c674f72d | 210 | if [ "$1" = 1 ]; then |
3ab985b1 ER |
211 | %banner -e %{name} <<-EOF |
212 | To finish your configuration DO NOT FORGET to: | |
213 | ||
214 | 1) Create some MySQL database owned by some user | |
c674f72d ER |
215 | 2) Edit the file: %{_sysconfdir}/wp-config.php |
216 | 3) Install %{name}-setup | |
217 | 4) Run a browser and visit: http://`hostname`/wordpress/wp-admin/install.php | |
3ab985b1 | 218 | EOF |
20ae9c53 | 219 | fi |
3ab985b1 | 220 | |
c674f72d ER |
221 | %post setup |
222 | chmod 660 %{_sysconfdir}/wp-config.php | |
223 | chown root:http %{_sysconfdir}/wp-config.php | |
224 | ||
225 | %postun setup | |
226 | if [ "$1" = "0" ]; then | |
227 | chmod 640 %{_sysconfdir}/wp-config.php | |
228 | chown root:http %{_sysconfdir}/wp-config.php | |
229 | fi | |
230 | ||
b973cc00 | 231 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
232 | %webapp_register apache %{_webapp} |
233 | ||
ca1cad3e RT |
234 | %triggerin -- lighttpd |
235 | %webapp_register lighttpd %{_webapp} | |
236 | ||
b973cc00 | 237 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
3ab985b1 ER |
238 | %webapp_unregister apache %{_webapp} |
239 | ||
cda44e30 | 240 | %triggerin -- apache < 2.2.0, apache-base |
3ab985b1 ER |
241 | %webapp_register httpd %{_webapp} |
242 | ||
cda44e30 | 243 | %triggerun -- apache < 2.2.0, apache-base |
3ab985b1 ER |
244 | %webapp_unregister httpd %{_webapp} |
245 | ||
ca1cad3e RT |
246 | %triggerun -- lighttpd |
247 | %webapp_unregister lighttpd %{_webapp} | |
248 | ||
ec33fe30 | 249 | %files |
843f1ee3 | 250 | %defattr(644,root,root,755) |
251 | %doc readme.html wp-setup.txt | |
3ab985b1 ER |
252 | %dir %attr(750,root,http) %{_sysconfdir} |
253 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
254 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
ca1cad3e | 255 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
c674f72d | 256 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wp-config.php |
3ab985b1 ER |
257 | |
258 | %dir %{_appdir} | |
3ab985b1 | 259 | %{_appdir}/*.php |
c674f72d | 260 | %{_appdir}/wp-includes |
c674f72d ER |
261 | %dir %{_appdir}/wp-content |
262 | %dir %{_appdir}/wp-content/languages | |
0f7aa528 ER |
263 | %lang(et) %{_appdir}/wp-content/languages/et.mo |
264 | %lang(pl) %{_appdir}/wp-content/languages/pl_PL.mo | |
c674f72d | 265 | %dir %{_appdir}/wp-content/plugins |
82c8bcde | 266 | %dir %{_appdir}/wp-content/mu-plugins |
c674f72d | 267 | %dir %{_appdir}/wp-content/themes |
c674f72d | 268 | |
20f21eaf ER |
269 | # needed for daily moderation |
270 | %{_appdir}/wp-admin | |
271 | ||
f7f07f8c ER |
272 | %attr(775,root,http) /var/lib/%{name} |
273 | %attr(775,root,http) /var/log/%{name} | |
274 | ||
c674f72d ER |
275 | %files setup |
276 | %defattr(644,root,root,755) | |
022de391 | 277 | %attr(755,root,root) %{_bindir}/wp-secure |
278 | %attr(755,root,root) %{_bindir}/wp-setup | |
c674f72d ER |
279 | %{_appdir}/wp-secure.sh |
280 | %{_appdir}/wp-setup.sh | |
ed53548e | 281 | |
a095fc01 ER |
282 | %files plugin-akismet |
283 | %defattr(644,root,root,755) | |
284 | %dir %{_appdir}/wp-content/plugins/akismet | |
285 | %doc %{_appdir}/wp-content/plugins/akismet/readme.txt | |
286 | %{_appdir}/wp-content/plugins/akismet/*.php | |
287 | %{_appdir}/wp-content/plugins/akismet/*.gif | |
288 | ||
ed53548e ER |
289 | %files theme-twentyten |
290 | %defattr(644,root,root,755) | |
291 | %{_appdir}/wp-content/themes/twentyten |