1 |
%define name mediawiki |
2 |
%define basever 1.16 |
3 |
%define version %{basever}.5 |
4 |
%define release %mkrel 1 |
5 |
%define _requires_exceptions pear(HTML/Template/PHPTAL.php)\\|pear(MogileFS.php)\\|pear(extensions\\|pear(PHPUnit.php |
6 |
%define sharedcodedir %{_datadir}/mediawiki |
7 |
%define moduledir %{_libdir}/mediawiki |
8 |
%define docdir %{_defaultdocdir}/%{name}-%{version} |
9 |
|
10 |
Name: %{name} |
11 |
Version: %{version} |
12 |
Release: %{release} |
13 |
Summary: A wiki engine |
14 |
License: GPLv2+ |
15 |
Group: System/Servers |
16 |
URL: http://www.mediawiki.org/wiki/MediaWiki |
17 |
Source0: http://download.wikimedia.org/mediawiki/%{basever}/%{name}-%{version}.tar.gz |
18 |
Source1: mediawiki.conf |
19 |
Source2: README.urpmi |
20 |
Source3: mw-createinstance.in |
21 |
Source4: mw-updateallinstances.in |
22 |
Source5: mediawiki-common.conf |
23 |
Patch0: mediawiki-1.16.2-commoncode.patch |
24 |
Patch1: mediawiki-1.16.2-enablesuggests.patch |
25 |
BuildRequires: ocaml >= 3.06 |
26 |
Requires: mediawiki-minimal = %{version}-%{release} |
27 |
Requires: tetex-dvips |
28 |
Requires: tetex-latex |
29 |
|
30 |
%description |
31 |
MediaWiki is the software used for Wikipedia and the other Wikimedia |
32 |
Foundation websites. Compared to other wikis, it has an excellent |
33 |
range of features and support for high-traffic websites using multiple |
34 |
servers |
35 |
|
36 |
This package supports wiki farms. Read the instructions for creating |
37 |
wiki instances under %{docdir}/README.urpmi. |
38 |
Remember to remove the config dir after completing the configuration. |
39 |
|
40 |
This package includes math rendering support for mediawiki. |
41 |
|
42 |
%package minimal |
43 |
Summary: mediawiki without texvc |
44 |
Group: System/Servers |
45 |
# to make sure the "apache" group is created before mediawiki is installed |
46 |
Requires(pre): webserver |
47 |
# for diff3: |
48 |
Requires: diffutils |
49 |
# for convert: |
50 |
Requires: imagemagick |
51 |
Requires: php-gd |
52 |
Requires: php-mysql |
53 |
Requires: php-pgsql |
54 |
Requires: php-xml |
55 |
Provides: %{name}%{basever} |
56 |
Conflicts: mediawiki < 0:1.16.5-0 |
57 |
|
58 |
%description minimal |
59 |
This subpackage contains all mediawiki parts except the ones needed to |
60 |
create inline math. This is done for minimal wiki installs that do |
61 |
not require mathematic formulas and therefore no dependencies to LaTeX |
62 |
are set up. |
63 |
|
64 |
|
65 |
%prep |
66 |
%setup -q |
67 |
%patch0 -p1 -b .commoncode |
68 |
%patch1 -p1 -b .enablesuggests |
69 |
|
70 |
%build |
71 |
cd math |
72 |
make |
73 |
|
74 |
%install |
75 |
rm -rf %{buildroot} |
76 |
|
77 |
# move away the documentation to the final folder. |
78 |
mkdir -p %{buildroot}%{docdir} |
79 |
mv -f COPYING FAQ HISTORY README RELEASE-NOTES UPGRADE CREDITS INSTALL docs \ |
80 |
%{buildroot}%{docdir}/ |
81 |
|
82 |
install -p %{SOURCE2} %{buildroot}%{docdir}/README.urpmi |
83 |
|
84 |
# now copy the rest to the buildroot. |
85 |
mkdir -p %{buildroot}%{sharedcodedir} |
86 |
cp -a * %{buildroot}%{sharedcodedir}/ |
87 |
|
88 |
# remove unneeded parts |
89 |
rm -fr %{buildroot}%{sharedcodedir}/{t,test,tests} |
90 |
rm -fr %{buildroot}%{sharedcodedir}/includes/zhtable |
91 |
find %{buildroot}%{sharedcodedir}/ \ |
92 |
\( -name .htaccess -or -name \*.cmi \) \ |
93 |
| xargs -r rm |
94 |
|
95 |
# fix permissions |
96 |
chmod +x %{buildroot}%{sharedcodedir}/bin/* |
97 |
find %{buildroot}%{sharedcodedir} -name \*.pl | xargs -r chmod +x |
98 |
|
99 |
# move arch dependent parts |
100 |
mkdir -p %{buildroot}%{moduledir}/math |
101 |
mv %{buildroot}%{sharedcodedir}/math/texvc \ |
102 |
%{buildroot}%{moduledir}/math/ |
103 |
rm -fr %{buildroot}%{sharedcodedir}/math/* |
104 |
ln -s %{moduledir}/math/texvc %{buildroot}%{sharedcodedir}/math/ |
105 |
|
106 |
# remove version control/patch files |
107 |
find %{buildroot} -name .svnignore | xargs -r rm |
108 |
find %{buildroot} -name \*.commoncode | xargs -r rm |
109 |
find %{buildroot} -name \*.enablesuggests | xargs -r rm |
110 |
|
111 |
%{__install} -d -m 755 %{buildroot}%{webappconfdir} |
112 |
install -p -m 0644 %{SOURCE1} \ |
113 |
%{buildroot}%{webappconfdir}/mediawiki.conf |
114 |
install -p -m 0644 %{SOURCE5} \ |
115 |
%{buildroot}%{webappconfdir}/mediawiki-common.conf |
116 |
|
117 |
# tools for keeping mediawiki instances current |
118 |
mkdir -p %{buildroot}%{_sbindir} |
119 |
sed -e's,@datadir@,%{_datadir},g' -e's,@sysconfdir@,%{_sysconfdir},g' \ |
120 |
< %{SOURCE3} > %{buildroot}%{_sbindir}/mediawiki-create |
121 |
sed -e's,@datadir@,%{_datadir},g' -e's,@sysconfdir@,%{_sysconfdir},g' \ |
122 |
< %{SOURCE4} > %{buildroot}%{_sbindir}/mediawiki-updateall |
123 |
chmod 0755 %{buildroot}%{_sbindir}/mediawiki-* |
124 |
mkdir %{buildroot}%{_sysconfdir}/mediawiki |
125 |
|
126 |
# placeholder for a default instance |
127 |
mkdir -p %{buildroot}/var/www/mediawiki |
128 |
|
129 |
# list of instances - initially empty |
130 |
touch %{buildroot}%{_sysconfdir}/mediawiki/instances |
131 |
|
132 |
# register default instance - not, this is only a default location |
133 |
# echo /var/www/mediawiki >> %{buildroot}%{_sysconfdir}/mediawiki/instances |
134 |
|
135 |
%clean |
136 |
rm -rf %{buildroot} |
137 |
|
138 |
%post |
139 |
%{_sbindir}/mediawiki-updateall >> /var/log/mediawiki-updates.log 2>&1 || : |
140 |
|
141 |
%files |
142 |
%defattr(-,root,root,-) |
143 |
%{sharedcodedir}/math |
144 |
%{moduledir} |
145 |
|
146 |
%files minimal |
147 |
%defattr(-,root,root,-) |
148 |
%{docdir} |
149 |
%dir %{sharedcodedir} |
150 |
%{sharedcodedir}/*.php |
151 |
%{sharedcodedir}/*.php5 |
152 |
%{sharedcodedir}/*.phtml |
153 |
%{sharedcodedir}/StartProfiler.sample |
154 |
%{sharedcodedir}/bin |
155 |
%{sharedcodedir}/cache |
156 |
%attr(-,apache,apache) %dir %{sharedcodedir}/config |
157 |
%{sharedcodedir}/config/* |
158 |
%{sharedcodedir}/extensions |
159 |
%{sharedcodedir}/images |
160 |
%{sharedcodedir}/includes |
161 |
%{sharedcodedir}/languages |
162 |
%{sharedcodedir}/maintenance |
163 |
%{sharedcodedir}/serialized |
164 |
%{sharedcodedir}/skins |
165 |
%config(noreplace) %{webappconfdir}/mediawiki.conf |
166 |
%config %{webappconfdir}/mediawiki-common.conf |
167 |
%dir %{_sysconfdir}/mediawiki |
168 |
%config(noreplace) %{_sysconfdir}/mediawiki/instances |
169 |
%{_sbindir}/mediawiki-* |
170 |
/var/www/mediawiki |