]> git.pld-linux.org Git - SPECS.git/blob - mantis.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / mantis.spec
1 # TIP:
2 # - After upgrade from version <= 0.18.x mysql database requires upgrade!
3 # TODO:
4 # - update mantis-setup pl doc (default user/password)
5 Summary:        The Mantis bug tracker
6 Summary(hu.UTF-8):      The Mantis hibakövető
7 Summary(pl.UTF-8):      Mantis - system kontroli błędów
8 Name:           mantis
9 Version:        1.2.6
10 Release:        2
11 License:        GPL
12 Group:          Development/Tools
13 Source0:        http://downloads.sourceforge.net/project/mantisbt/mantis-stable/%{version}/%{name}bt-%{version}.tar.gz
14 # Source0-md5:  decb8df9b6695d20162faaa0823849fc
15 Source1:        %{name}-doc-PLD.tar.gz
16 # Source1-md5:  eaed8c123d8cef118aca7158ec83fed4
17 Source2:        %{name}.conf
18 Patch0:         %{name}-config.patch
19 Patch1:         %{name}-doc.patch
20 URL:            http://mantisbt.sourceforge.net/
21 BuildRequires:  rpmbuild(macros) >= 1.268
22 BuildRequires:  sed >= 4.0
23 Requires(triggerpostun):        sed >= 4.0
24 Requires:       apache(mod_dir)
25 Requires:       php(mysql)
26 Requires:       php(pcre)
27 Requires:       webapps
28 Requires:       webserver = apache
29 Requires:       webserver(php) >= 4.3.1-4
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _appdir         %{_datadir}/%{name}
34 %define         _webapps        /etc/webapps
35 %define         _webapp         %{name}
36 %define         _sysconfdir     %{_webapps}/%{_webapp}
37
38 %description
39 Mantis is a PHP/MySQL/web based bugtracking system.
40
41 %description  -l hu.UTF-8
42 Mantis egy PHP/MySQL/web alapú hibakövető rendszer.
43
44 %description -l pl.UTF-8
45 Mantis jest systemem kontroli błędów opartym na interfejsie WWW, bazie
46 MySQL oraz PHP.
47
48 %package setup
49 Summary:        Mantis setup package
50 Summary(pl.UTF-8):      Pakiet do wstępnej konfiguracji Mantisa
51 Group:          Applications/WWW
52 Requires:       %{name} = %{epoch}:%{version}-%{release}
53
54 %description setup
55 Install this package to configure initial Mantis installation. You
56 should uninstall this package when you're done, as it considered
57 insecure to keep the setup files in place. Default username/password
58 after installation: administrator/root
59
60 %description setup -l hu.UTF-8
61 Ezen csomag telepítése bekonfigurálja a kezdeti Mantis telepítést. A
62 csomagot el kell távolítanod, ha kész vagy, mert nem biztonságos
63 fájlok maradnak utána. Alapértelmezett username/password telepítés
64 után: administrator/root
65
66 %description setup -l pl.UTF-8
67 Ten pakiet należy zainstalować w celu wstępnej konfiguracji Mantisa po
68 pierwszej instalacji. Potem należy go odinstalować, jako że
69 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
70
71 %prep
72 %setup -q -a1 -n %{name}bt-%{version}
73 %patch0 -p1
74 %patch1 -p1
75 find . -type d -name CVS | xargs rm -rf
76 find . -type f -name .cvsignore | xargs rm -rf
77 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT{%{_appdir}/doc,%{_sysconfdir}}
82
83 cp -af {*.php,admin,api,core,css,images,javascript,lang,library,plugins} $RPM_BUILD_ROOT%{_appdir}
84 cp -a config_inc.php.sample $RPM_BUILD_ROOT%{_sysconfdir}/config.php
85 ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config_inc.php
86
87 mv $RPM_BUILD_ROOT{%{_appdir}/config_defaults_inc.php,%{_sysconfdir}/config_defaults.php}
88 ln -s %{_sysconfdir}/config_defaults.php $RPM_BUILD_ROOT%{_appdir}/config_defaults_inc.php
89
90 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
91 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %post
97 if [ "$1" = 1 ]; then
98 %banner -e %{name} <<EOF
99 Install %{name}-setup if you need to setup initial Mantis
100 configuration or configure mantis.
101 EOF
102 fi
103
104 %post setup
105 %banner -e %{name}-setup <<EOF
106 After first install the correct user/password:
107 administrator/root
108 You should change or delete this!
109 After install you should uninstall %{name}-setup!
110 EOF
111
112 %triggerin -- apache1 < 1.3.37-3, apache1-base
113 %webapp_register apache %{_webapp}
114
115 %triggerun -- apache1 < 1.3.37-3, apache1-base
116 %webapp_unregister apache %{_webapp}
117
118 %triggerin -- apache < 2.2.0, apache-base
119 %webapp_register httpd %{_webapp}
120
121 %triggerun -- apache < 2.2.0, apache-base
122 %webapp_unregister httpd %{_webapp}
123
124 %triggerpostun -- %{name} < 0.19.3-2.1
125 # rescue app configs.
126 for i in config.php config_defaults.php; do
127         if [ -f /etc/%{name}/$i.rpmsave ]; then
128                 mv -f %{_sysconfdir}/$i{,.rpmnew}
129                 mv -f /etc/%{name}/$i.rpmsave %{_sysconfdir}/$i
130         fi
131 done
132
133 # nuke very-old config location (this mostly for Ra)
134 if [ -f /etc/httpd/httpd.conf ]; then
135         sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
136         /usr/sbin/webapp register httpd %{_webapp}
137         httpd_reload=1
138 fi
139
140 # migrate from httpd (apache2) config dir
141 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
142         cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
143         mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
144         /usr/sbin/webapp register httpd %{_webapp}
145         httpd_reload=1
146 fi
147
148 # migrate from apache-config macros
149 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
150         if [ -d /etc/apache/webapps.d ]; then
151                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
152                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
153         fi
154
155         if [ -d /etc/httpd/webapps.d ]; then
156                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
157                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
158         fi
159         rm -f /etc/%{name}/apache.conf.rpmsave
160 fi
161
162 # migrating from earlier apache-config?
163 if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
164         if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
165                 rm -f /etc/apache/conf.d/99_%{name}.conf
166                 /usr/sbin/webapp register apache %{_webapp}
167                 apache_reload=1
168         fi
169         if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
170                 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
171                 /usr/sbin/webapp register httpd %{_webapp}
172                 httpd_reload=1
173         fi
174 else
175         # no earlier registration. assume migration from Ra
176         if [ -d /etc/apache/webapps.d ]; then
177                 /usr/sbin/webapp register apache %{_webapp}
178                 apache_reload=1
179         fi
180         if [ -d /etc/httpd/webapps.d ]; then
181                 /usr/sbin/webapp register httpd %{_webapp}
182                 httpd_reload=1
183         fi
184 fi
185
186 if [ "$httpd_reload" ]; then
187         %service httpd reload
188 fi
189 if [ "$apache_reload" ]; then
190         %service apache reload
191 fi
192
193 %files
194 %defattr(644,root,root,755)
195 %doc doc/{CREDITS,CUSTOMIZATION,INSTALL,RELEASE} doc/en/*.txt
196 %dir %attr(750,root,http) %{_sysconfdir}
197 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
198 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
199 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
200 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config_defaults.php
201 %dir %{_appdir}
202 %{_appdir}/api
203 %{_appdir}/billing*.php
204 %{_appdir}/browser_search_plugin.php
205 %{_appdir}/config_defaults_inc.php
206 %{_appdir}/config_filter_defaults_inc.php
207 %{_appdir}/config_inc.php
208 %{_appdir}/excel_xml_export.php
209 %{_appdir}/issues_rss.php
210 %{_appdir}/return_dynamic_filters.php
211 %{_appdir}/core
212 %{_appdir}/css
213 %{_appdir}/images
214 %{_appdir}/javascript
215 %{_appdir}/lang
216 %{_appdir}/doc
217 %{_appdir}/adm_*
218 %{_appdir}/account*
219 %{_appdir}/bug*
220 %{_appdir}/changelog_page*
221 %{_appdir}/core.*
222 %{_appdir}/csv*
223 %{_appdir}/file*
224 %{_appdir}/history*
225 %{_appdir}/index*
226 %{_appdir}/jump*
227 %{_appdir}/library
228 %{_appdir}/lo*
229 %{_appdir}/ma*
230 %{_appdir}/me*
231 %{_appdir}/my*
232 %{_appdir}/news*
233 %{_appdir}/permalink_page.php
234 %{_appdir}/plugin.php
235 %{_appdir}/plugin_file.php
236 %{_appdir}/plugins
237 %{_appdir}/print*
238 %{_appdir}/proj*
239 %{_appdir}/query*
240 %{_appdir}/roadmap_page.php
241 %{_appdir}/search.php
242 %{_appdir}/set*
243 %{_appdir}/sig*
244 %{_appdir}/sum*
245 %{_appdir}/tag_*.php
246 %{_appdir}/veri*
247 %{_appdir}/view*
248 %{_appdir}/wiki.php
249 %{_appdir}/xmlhttprequest.php
250
251 %files setup
252 %defattr(644,root,root,755)
253 %{_appdir}/admin
This page took 1.040101 seconds and 3 git commands to generate.