]> git.pld-linux.org Git - packages/mediawiki.git/blob - mediawiki.spec
- release 4
[packages/mediawiki.git] / mediawiki.spec
1 # TODO
2 # - secure webpages and dirs (separate htdocs and includes)
3 #
4 # Conditional build:
5 %bcond_with     apidocs # with apidocs
6 #
7 Summary:        MediaWiki - the collaborative editing software that runs Wikipedia
8 Summary(pl):    MediaWiki - oprogramowanie do wspólnej edycji, na którym dzia³a Wikipedia
9 Name:           mediawiki
10 Version:        1.5.3
11 Release:        4
12 License:        GPL
13 Group:          Applications/WWW
14 Source0:        http://dl.sourceforge.net/wikipedia/%{name}-%{version}.tar.gz
15 # Source0-md5:  fc697787f04208d1842a2c646deca626
16 Source1:        %{name}.conf
17 Patch0:         %{name}-mysqlroot.patch
18 Patch1:         %{name}-confdir2.patch
19 URL:            http://wikipedia.sourceforge.net/
20 BuildRequires:  sed >= 4.0
21 %if %{with apidocs}
22 BuildRequires:  php-cli
23 BuildRequires:  php-pear-PhpDocumentor
24 %endif
25 BuildRequires:  rpmbuild(macros) >= 1.268
26 Requires:       php-mysql
27 Requires:       php-pcre
28 Requires:       php-xml
29 # includes/UserMailer.php:
30 #Requires:      php-pear-Mail
31 # Optional
32 #Requires:      ImageMagick or php-gd for thumbnails
33 #Requires:      php-zlib
34 #Requires:      turck-mmcache
35 Requires:       webapps
36 Requires:       webserver = apache
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         _appdir         %{_datadir}/%{name}
40 %define         _webapps        /etc/webapps
41 %define         _webapp         %{name}
42 %define         _sysconfdir     %{_webapps}/%{_webapp}
43
44 %description
45 MediaWiki is the collaborative editing software that runs Wikipedia,
46 for a list of features please consult:
47 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
48
49 %description -l pl
50 MediaWiki to oprogramowanie do wspólnej edycji, na którym dzia³a
51 Wikipedia. Listê mo¿liwo¶ci mo¿na znale¼æ pod adresem:
52 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
53
54 %package setup
55 Summary:        MediaWiki setup package
56 Summary(pl):    Pakiet do wstêpnej konfiguracji MediaWiki
57 Group:          Applications/WWW
58 Requires:       %{name} = %{epoch}:%{version}-%{release}
59
60 %description setup
61 Install this package to configure initial MediaWiki installation. You
62 should uninstall this package when you're done, as it considered
63 insecure to keep the setup files in place.
64
65 %description setup -l pl
66 Ten pakiet nale¿y zainstalowaæ w celu wstêpnej konfiguracji MediaWiki
67 po pierwszej instalacji. Potem nale¿y go odinstalowaæ, jako ¿e
68 pozostawienie plików instalacyjnych mog³oby byæ niebezpieczne.
69
70 %prep
71 %setup -q
72 %patch0 -p1
73 %patch1 -p1
74
75 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
80
81 cp -a config extensions images includes languages maintenance math skins $RPM_BUILD_ROOT%{_appdir}
82 cp -a AdminSettings.sample $RPM_BUILD_ROOT%{_sysconfdir}/AdminSettings.php
83
84 cp *.php install-utils.inc $RPM_BUILD_ROOT%{_appdir}
85
86 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
87 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %post setup
93 chmod 770 %{_sysconfdir}
94
95 %postun setup
96 if [ "$1" = "0" ]; then
97         chmod 750 %{_sysconfdir}
98         if [ -f %{_sysconfdir}/LocalSettings.php ]; then
99                 chown root:http %{_sysconfdir}/LocalSettings.php
100                 chmod 640 %{_sysconfdir}/LocalSettings.php
101         fi
102 fi
103
104 %triggerin -- apache1
105 %webapp_register apache %{_webapp}
106
107 %triggerun -- apache1
108 %webapp_unregister apache %{_webapp}
109
110 %triggerin -- apache < 2.2.0, apache-base
111 %webapp_register httpd %{_webapp}
112
113 %triggerun -- apache < 2.2.0, apache-base
114 %webapp_unregister httpd %{_webapp}
115
116 %triggerpostun -- %{name} < 1.5.3-0.2
117 # nuke very-old config location (this mostly for Ra)
118 if [ -f /etc/httpd/httpd.conf ]; then
119         sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
120         /usr/sbin/webapp register httpd %{_webapp}
121         httpd_reload=1
122 fi
123
124 # migrate from httpd (apache2) config dir
125 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
126         cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
127         mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
128         /usr/sbin/webapp register httpd %{_webapp}
129         httpd_reload=1
130 fi
131
132 # migrate from apache-config macros
133 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
134         if [ -d /etc/apache/webapps.d ]; then
135                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
136                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
137         fi
138
139         if [ -d /etc/httpd/webapps.d ]; then
140                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
141                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
142         fi
143         rm -f /etc/%{name}/apache.conf.rpmsave
144 fi
145
146 # migrating from earlier apache-config?
147 if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
148         if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
149                 rm -f /etc/apache/conf.d/99_%{name}.conf
150                 /usr/sbin/webapp register apache %{_webapp}
151                 apache_reload=1
152         fi
153         if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
154                 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
155                 /usr/sbin/webapp register httpd %{_webapp}
156                 httpd_reload=1
157         fi
158 else
159         # no earlier registration. assume migration from Ra
160         if [ -d /etc/apache/webapps.d ]; then
161                 /usr/sbin/webapp register apache %{_webapp}
162                 apache_reload=1
163         fi
164         if [ -d /etc/httpd/webapps.d ]; then
165                 /usr/sbin/webapp register httpd %{_webapp}
166                 httpd_reload=1
167         fi
168 fi
169
170 if [ "$httpd_reload" ]; then
171         %service httpd reload
172 fi
173 if [ "$apache_reload" ]; then
174         %service apache reload
175 fi
176
177 %files
178 %defattr(644,root,root,755)
179 %doc docs FAQ HISTORY INSTALL README RELEASE-NOTES UPGRADE *.sample tests
180 %dir %attr(750,root,http) %{_sysconfdir}
181 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
182 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
183 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/AdminSettings.php
184
185 %dir %{_appdir}
186 %{_appdir}/*.php
187 %{_appdir}/languages
188 %{_appdir}/math
189 %{_appdir}/images
190 %{_appdir}/extensions
191 %{_appdir}/skins
192 %{_appdir}/includes
193 %{_appdir}/maintenance
194
195 %files setup
196 %defattr(644,root,root,755)
197 %dir %attr(775,root,http) %{_appdir}/config
198 %{_appdir}/install-utils.inc
199 %{_appdir}/config/index.php
This page took 0.431035 seconds and 3 git commands to generate.