]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with order # with experimental order patch | |
4 | ||
5 | %define rel 1 | |
6 | #define subver 187 | |
7 | #define githash acd7038 | |
8 | %define php_min_version 5.3.7 | |
9 | %include /usr/lib/rpm/macros.php | |
10 | Summary: Eventum Issue / Bug tracking system | |
11 | Summary(pl.UTF-8): Eventum - system śledzenia spraw/błędów | |
12 | Name: eventum | |
13 | Version: 3.0.10 | |
14 | Release: %{?subver:1.%{subver}.%{?githash:g%{githash}.}}%{rel} | |
15 | License: GPL v2+ | |
16 | Group: Applications/WWW | |
17 | Source0: https://github.com/eventum/eventum/releases/download/v%{version}/%{name}-%{version}.tar.gz | |
18 | # Source0-md5: a82c8e741892b09679722fc72a9f25bd | |
19 | #Source0: %{name}-%{version}-%{subver}-g%{githash}.tar.gz | |
20 | Source1: %{name}-apache.conf | |
21 | Source2: %{name}-mail-queue.cron | |
22 | Source3: %{name}-mail-download.cron | |
23 | Source4: %{name}-reminder.cron | |
24 | Source5: %{name}-monitor.cron | |
25 | Source6: %{name}-cvs.php | |
26 | Source8: %{name}-irc.init | |
27 | Source9: %{name}-irc.sysconfig | |
28 | Source10: sphinx.crontab | |
29 | Source13: %{name}-router-postfix.sh | |
30 | Source14: %{name}.logrotate | |
31 | Source15: %{name}-lighttpd.conf | |
32 | Source16: http://www.isocra.com/images/updown2.gif | |
33 | # Source16-md5: deb6eeb2552ba757d3a949ed10c4107d | |
34 | Source17: %{name}.tmpfiles | |
35 | Patch2: %{name}-order.patch | |
36 | #Patch3: group-users.patch | |
37 | #Patch4: https://github.com/glensc/eventum/compare/cf_escape.patch | |
38 | # packaging patches that probably never go upstream | |
39 | Patch100: %{name}-paths.patch | |
40 | Patch101: %{name}-cvs-config.patch | |
41 | Patch107: %{name}-gettext.patch | |
42 | Patch108: autoload.patch | |
43 | # some tests | |
44 | Patch200: %{name}-fixed-nav.patch | |
45 | URL: http://eventum.mysql.org/ | |
46 | BuildRequires: /usr/bin/php | |
47 | BuildRequires: gettext-devel | |
48 | BuildRequires: php(core) >= %{php_min_version} | |
49 | BuildRequires: rpm-php-pearprov >= 4.0.2-98 | |
50 | BuildRequires: rpmbuild(macros) >= 1.654 | |
51 | BuildRequires: sed >= 4.0 | |
52 | Requires(postun): /usr/sbin/groupdel | |
53 | Requires(postun): /usr/sbin/userdel | |
54 | Requires(pre): /bin/id | |
55 | Requires(pre): /usr/bin/getgid | |
56 | Requires(pre): /usr/sbin/groupadd | |
57 | Requires(pre): /usr/sbin/useradd | |
58 | Requires: fonts-TTF-RedHat-liberation | |
59 | Requires: php(core) >= %{php_min_version} | |
60 | Requires: php(filter) | |
61 | Requires: php(iconv) | |
62 | Requires: php(imap) | |
63 | Requires: php(json) | |
64 | Requires: php(mbstring) | |
65 | Requires: php(mysqli) | |
66 | Requires: php(pcre) | |
67 | Requires: php(session) | |
68 | Requires: php-Smarty >= 3.1 | |
69 | Requires: php-Smarty-plugin-gettext | |
70 | Requires: php-ZendFramework-Config >= 2.4 | |
71 | Requires: php-monolog >= 1.17.2 | |
72 | Requires: php-pear-DB | |
73 | Requires: php-pear-Mail | |
74 | Requires: php-pear-Mail_Mime | |
75 | Requires: php-pear-Mail_mimeDecode | |
76 | Requires: php-pear-Math_Stats | |
77 | Requires: php-pear-Net_SMTP | |
78 | Requires: php-pear-Net_Socket | |
79 | Requires: php-pear-Net_URL | |
80 | Requires: php-pear-PEAR-core | |
81 | Requires: php-pear-Text_Diff | |
82 | Requires: php-pear-XML_RPC | |
83 | Requires: php-psr-Log >= 1.0.0-2 | |
84 | Requires: php-symfony2-HttpFoundation >= 2.7.7 | |
85 | Requires: phplot >= 5.8.0 | |
86 | Requires: webapps | |
87 | Requires: webserver(access) | |
88 | Requires: webserver(alias) | |
89 | Requires: webserver(indexfile) | |
90 | Requires: webserver(php) >= 4.2.0 | |
91 | Suggests: localedb | |
92 | Suggests: php(mcrypt) | |
93 | Suggests: php(openssl) | |
94 | Suggests: php-pear-Net_LDAP2 | |
95 | Suggests: php-pear-Net_POP3 | |
96 | Suggests: webserver(setenv) | |
97 | Provides: group(eventum) | |
98 | Provides: user(eventum) | |
99 | Obsoletes: eventum-base < 3.0.3-1.305 | |
100 | Obsoletes: eventum-route-drafts < 3.0.8-1.1 | |
101 | Obsoletes: eventum-route-emails < 3.0.8-1.1 | |
102 | Obsoletes: eventum-route-notes < 3.0.8-1.1 | |
103 | Conflicts: logrotate < 3.8.0 | |
104 | BuildArch: noarch | |
105 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
106 | ||
107 | %define _noautoreq_pear ../init.php ../../init.php init.php /usr/share/eventum/init.php /etc/webapps/.* %{_appdir}/.* .*Smarty.class.php Services/JSON.php class.date_helper.php sphinxapi.php Net/LDAP2.* Auth/SASL.* Util.php smarty_internal.* | |
108 | ||
109 | # exclude optional php dependencies | |
110 | %define _noautophp php-gnupg php-hash php-pecl-http php-tk | |
111 | ||
112 | %define _noautoreq %{_noautophp} | |
113 | ||
114 | %define _libdir %{_prefix}/lib/%{name} | |
115 | %define _appdir %{_datadir}/%{name} | |
116 | %define _smartydir %{php_data_dir}/Smarty | |
117 | %define _webapps /etc/webapps | |
118 | %define _webapp %{name} | |
119 | %define _webappdir %{_webapps}/%{_webapp} | |
120 | %define _sysconfdir /etc/%{name} | |
121 | ||
122 | %description | |
123 | Eventum is a user-friendly and flexible issue tracking system that can | |
124 | be used by a support department to track incoming technical support | |
125 | requests, or by a software development team to quickly organize tasks | |
126 | and bugs. Eventum is used by the MySQL AB Technical Support team, and | |
127 | has allowed us to dramatically improve our response times. | |
128 | ||
129 | %description -l pl.UTF-8 | |
130 | Eventum to przyjazny dla użytkownika system śledzenia spraw, który | |
131 | może być używany przez dział obsługi do śledzenia przychodzących żądań | |
132 | obsługi technicznej albo przez zespół tworzący oprogramowanie do | |
133 | szybkiej organizacji zadań i błędów. Eventum jest używany przez zespół | |
134 | Technical Support MySQL AB i umożliwił im znacząco poprawić czasy | |
135 | reakcji. | |
136 | ||
137 | %package setup | |
138 | Summary: Eventum setup package | |
139 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Eventum | |
140 | Group: Applications/WWW | |
141 | Requires: %{name} = %{version}-%{release} | |
142 | ||
143 | %description setup | |
144 | Install this package to configure initial Eventum installation. You | |
145 | should uninstall this package when you're done, as it considered | |
146 | insecure to keep the setup files in place. | |
147 | ||
148 | %description setup -l pl.UTF-8 | |
149 | Ten pakiet należy zainstalować w celu wstępnej konfiguracji Eventum po | |
150 | pierwszej instalacji. Potem należy go odinstalować, jako że | |
151 | pozostawienie plików instalacyjnych mogłoby być niebezpieczne. | |
152 | ||
153 | %package doc | |
154 | Summary: Eventum documentation and Wiki | |
155 | Group: Documentation | |
156 | ||
157 | %description doc | |
158 | Eventum documentation and copy of Wiki. | |
159 | ||
160 | %package mail-queue | |
161 | Summary: Eventum mail queue process | |
162 | Summary(pl.UTF-8): Przetwarzanie kolejki poczty Eventum | |
163 | Group: Applications/WWW | |
164 | Requires: %{name} = %{version}-%{release} | |
165 | Requires: crondaemon | |
166 | ||
167 | %description mail-queue | |
168 | Beginning with the first release of Eventum, emails are not directly | |
169 | sent out from the various scripts, but rather added to a mail queue | |
170 | table that is processed by a cron job. If an email cannot be sent, it | |
171 | will be marked as such in the mail queue log, and the cron job script | |
172 | will re-try to send it again the next time it runs. | |
173 | ||
174 | This package contains the cron job. | |
175 | ||
176 | %description mail-queue -l pl.UTF-8 | |
177 | Od pierwszego wydania Eventum poczta nie jest wysyłana bezpośrednio z | |
178 | różnych skryptów, lecz dodawana do kolejki przetwarzanej z crona. | |
179 | Jeśli poczta nie może być wysłana, będzie odpowiednio oznaczona w logu | |
180 | kolejki poczty, a skrypt z crona będzie próbował wysłać ją ponownie | |
181 | następnym razem. | |
182 | ||
183 | Ten pakiet zawiera zadanie dla crona. | |
184 | ||
185 | %package mail-download | |
186 | Summary: Eventum email download | |
187 | Summary(pl.UTF-8): Ściąganie poczty Eventum | |
188 | Group: Applications/WWW | |
189 | Requires: %{name} = %{version}-%{release} | |
190 | Requires: crondaemon | |
191 | ||
192 | %description mail-download | |
193 | In order for Eventum's email integration feature to work, you need to | |
194 | setup a cron job to run the script every so often. | |
195 | ||
196 | This package contains the cron job. | |
197 | ||
198 | %description mail-download -l pl.UTF-8 | |
199 | Aby integracja poczty elektronicznej w Eventum działała, trzeba | |
200 | ustawić zadanie crona, aby uruchamiał odpowiedni skrypt wystarczająco | |
201 | często. | |
202 | ||
203 | Ten pakiet zawiera zadanie dla crona. | |
204 | ||
205 | %package reminder | |
206 | Summary: Eventum Reminder System | |
207 | Summary(pl.UTF-8): System przypominania dla Eventum | |
208 | Group: Applications/WWW | |
209 | Requires: %{name} = %{version}-%{release} | |
210 | Requires: crondaemon | |
211 | ||
212 | %description reminder | |
213 | The reminder system was designed with the objective as serving as a | |
214 | safe net for issues that need attention. Depending on what | |
215 | configuration you create, you may have several reminders (or alerts) | |
216 | be sent out whenever an issue needs attention, for whatever parameter | |
217 | you may deem necessary. | |
218 | ||
219 | This package contains the cron job. | |
220 | ||
221 | %description reminder -l pl.UTF-8 | |
222 | System przypominania został zaprojektowany tak, aby służył jako | |
223 | bezpieczna sieć dla spraw wymagających uwagi. W zależności od | |
224 | konfiguracji można ustawić różne przypominajki (lub alarmy) wysyłane | |
225 | przy każdej sprawie wymagającej uwagi lub przy parametrze, który można | |
226 | uważać za potrzebny. | |
227 | ||
228 | Ten pakiet zawiera zadanie dla crona. | |
229 | ||
230 | %package monitor | |
231 | Summary: Eventum Heartbeat Monitor | |
232 | Summary(pl.UTF-8): Monitor życia dla Eventum | |
233 | Group: Applications/WWW | |
234 | Requires: %{name} = %{version}-%{release} | |
235 | Requires: crondaemon | |
236 | Requires: php(posix) | |
237 | ||
238 | %description monitor | |
239 | The heartbeat monitor is a feature designed for the administrator that | |
240 | wants to be alerted whenever a common problem in Eventum is detected, | |
241 | like the database server not being available anymore, or maybe when | |
242 | the recommended permissions for certain configuration files are | |
243 | changed. | |
244 | ||
245 | Please note that before running the heartbeat monitor, you may need to | |
246 | customize some of the checks to be appropriate for your own system, | |
247 | particularly the permission and file checks on | |
248 | Monitor::checkConfiguration(). | |
249 | ||
250 | This package contains the cron job. | |
251 | ||
252 | %description monitor -l pl.UTF-8 | |
253 | Monitor życia to funkcjonalność zaprojektowana dla administratora | |
254 | chcącego być alarmowanym przy każdym wykryciu popularnego problemu z | |
255 | Eventum, jak nie działanie serwera bazy danych albo zmiana uprawnień | |
256 | do plików konfiguracyjnych. | |
257 | ||
258 | Należy zauważyć, że przed uruchomieniem tego monitora może być | |
259 | konieczne dostosowanie niektórych testów do systemu, w szczególności | |
260 | testów uprawnień i plików w Monitor::checkConfiguration(). | |
261 | ||
262 | Ten pakiet zawiera zadanie dla crona. | |
263 | ||
264 | %package router-postfix | |
265 | Summary: Eventum Mail Routing - Postfix | |
266 | Summary(pl.UTF-8): Przekazywanie poczty Eventum - Postfix | |
267 | Group: Applications/Mail | |
268 | Requires: %{name} = %{version}-%{release} | |
269 | Requires: postfix | |
270 | Provides: eventum(router) | |
271 | Obsoletes: eventum(router) | |
272 | ||
273 | %description router-postfix | |
274 | This package provides way of routing notes and emails back to Eventum | |
275 | via Postfix. | |
276 | ||
277 | The Postfix configuration instructions you can find from | |
278 | <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>. | |
279 | ||
280 | %description router-postfix -l pl.UTF-8 | |
281 | Ten pakiet udostępnia metodę przekazywania notatek i listów do Eventum | |
282 | przez Postfiksa. | |
283 | ||
284 | Opis konfiguracji Postfiksa można znaleźć pod adresem | |
285 | <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>. | |
286 | ||
287 | %package irc | |
288 | Summary: Eventum IRC Notification Bot | |
289 | Summary(pl.UTF-8): IRC-owy bot powiadamiający dla Eventum | |
290 | Group: Applications/WWW | |
291 | Requires(post,preun): /sbin/chkconfig | |
292 | Requires: %{name} = %{version}-%{release} | |
293 | Requires: php(pcntl) | |
294 | Requires: php(sockets) | |
295 | Requires: php-pear-Net_SmartIRC >= 1.1.9 | |
296 | Requires: rc-scripts >= 0.4.0.18 | |
297 | ||
298 | %description irc | |
299 | The IRC notification bot is a nice feature for remote teams that want | |
300 | to handle issues and want to have a quick and easy way to get simple | |
301 | notifications. Right now the bot notifies of the following actions: | |
302 | - New Issues | |
303 | - Blocked emails | |
304 | - Issues that got their assignment list changed | |
305 | ||
306 | NOTE: You will need to manually edit the bot.php script to set your | |
307 | appropriate preferences, like IRC server and channel that the bot | |
308 | should join. | |
309 | ||
310 | %description irc -l pl.UTF-8 | |
311 | IRC-owy bot powiadamiający to miła funkcjonalność dla zdalnych | |
312 | zespołów chcących obsługiwać sprawy i mieć szybki i łatwy sposób na | |
313 | uzyskiwanie prostych powiadomień. Aktualnie bot powiadamia o | |
314 | następujących zdarzeniach: | |
315 | - nowych sprawach | |
316 | - zablokowanych listach | |
317 | - sprawach, dla których zmieniła się lista powiązań | |
318 | ||
319 | UWAGA: w celu wprowadzenia własnych ustawień, takich jak serwer IRC i | |
320 | kanał używany przez bota, trzeba ręcznie zmodyfikować skrypt bot.php . | |
321 | ||
322 | %package cli | |
323 | Summary: Eventum command-line interface | |
324 | Summary(pl.UTF-8): Interfejs linii poleceń dla Eventum | |
325 | Group: Applications/WWW | |
326 | Requires: php(core) >= %{php_min_version} | |
327 | Requires: php(phar) | |
328 | Requires: php-pear-XML_RPC | |
329 | ||
330 | %description cli | |
331 | The Eventum command-line interface allows you to access most of the | |
332 | features of the web interface straight from your command shell. | |
333 | ||
334 | %description cli -l pl.UTF-8 | |
335 | Interfejs linii poleceń Eventum pozwala na dostęp do większości | |
336 | funkcji interfejsu WWW prosto z linii poleceń powłoki. | |
337 | ||
338 | %package scm | |
339 | Summary: Eventum SCM integration | |
340 | Summary(pl.UTF-8): Integracja SCM dla Eventum | |
341 | Group: Applications/WWW | |
342 | Requires: php(core) >= %{php_min_version} | |
343 | Requires: php(json) | |
344 | Requires: php(pcre) | |
345 | Requires: php(spl) | |
346 | Suggests: cvs | |
347 | Suggests: git-core | |
348 | Suggests: php(openssl) | |
349 | Suggests: subversion | |
350 | ||
351 | %description scm | |
352 | This feature allows your software development teams to integrate your | |
353 | Source Control Management system with your Issue Tracking System. | |
354 | ||
355 | The integration is implemented in such a way that it will be forward | |
356 | compatible with pretty much any SCM system, such as CVS. | |
357 | ||
358 | For installation see | |
359 | </eventum/help.php?topic=scm_integration_installation>. | |
360 | ||
361 | %description scm -l pl.UTF-8 | |
362 | Ten pakiet pozwala zespołom programistów na integrację systemu | |
363 | zarządzania źródłami (SCM - Source Control Management) z systemem | |
364 | śledzenia spraw. | |
365 | ||
366 | Integracja jest zaimplementowana tak, aby być kompatybilna w przód z | |
367 | prawie każdym systemem SCM, jak np. CVS. | |
368 | ||
369 | Szczegóły na temat instalacji można przeczytać pod | |
370 | </eventum/help.php?topic=scm_integration_installation>. | |
371 | ||
372 | %package sphinx | |
373 | Summary: Eventum Sphinx Search | |
374 | Group: Applications/WWW | |
375 | Requires: %{name} = %{version}-%{release} | |
376 | Requires: crondaemon | |
377 | Requires: sphinx | |
378 | ||
379 | %description sphinx | |
380 | Sphinx search integration for Eventum. | |
381 | ||
382 | This package contains the cron job. | |
383 | ||
384 | %prep | |
385 | %setup -q -n %{name}-%{version}%{?githash:-%{subver}-g%{githash}} | |
386 | ||
387 | mv docs/examples . | |
388 | ||
389 | # bug fixes / features | |
390 | %{?with_order:%patch2 -p1} | |
391 | #%patch3 -p0 | |
392 | #%patch4 -p1 | |
393 | ||
394 | %{?with_order:cp -p %{SOURCE16} htdocs/images} | |
395 | ||
396 | #%patch200 -p1 | |
397 | ||
398 | # produce default sphinx config | |
399 | # must be run before paths.patch | |
400 | %if 0 | |
401 | cat <<'EOF' > config/config.php | |
402 | <?php | |
403 | define('APP_SQL_DBTYPE', 'mysql'); | |
404 | define('APP_SQL_DBHOST', 'localhost:/var/lib/mysql/mysql.sock'); | |
405 | define('APP_SQL_DBPORT', 3306); | |
406 | define('APP_SQL_DBNAME', 'eventum'); | |
407 | define('APP_SQL_DBUSER', 'mysql'); | |
408 | define('APP_SQL_DBPASS', ''); | |
409 | define('APP_TABLE_PREFIX', 'eventum_'); | |
410 | EOF | |
411 | php config/sphinx.conf.php > config/sphinx.conf | |
412 | rm config/config.php | |
413 | %endif | |
414 | ||
415 | # packaging | |
416 | %patch100 -p1 | |
417 | %patch101 -p1 | |
418 | %patch107 -p1 | |
419 | %patch108 -p1 | |
420 | ||
421 | rm htdocs/.htaccess.dist | |
422 | # deprecated in favour of process_all_emails.php | |
423 | rm bin/route_*.php | |
424 | ||
425 | # cleanup vendor. keep only needed libraries. | |
426 | # (the rest are packaged with system packages) | |
427 | mv vendor vendor.dist | |
428 | vendor() { | |
429 | local path dir | |
430 | for path; do | |
431 | dir=$(dirname $path) | |
432 | test -d vendor/$dir || mkdir -p vendor/$dir | |
433 | mv vendor.dist/$path vendor/$path | |
434 | done | |
435 | } | |
436 | vendor autoload.php | |
437 | vendor composer/autoload_{classmap,files,namespaces,real,psr4}.php | |
438 | vendor composer/ClassLoader.php | |
439 | vendor ircmaxell/{password-compat,random-lib,security-lib} | |
440 | vendor defuse/php-encryption | |
441 | vendor ramsey/array_column | |
442 | vendor willdurand/email-reply-parser | |
443 | ||
444 | # remove backups from patching as we use globs to package files to buildroot | |
445 | find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v | |
446 | ||
447 | %build | |
448 | %{__make} -C localization | |
449 | ||
450 | %install | |
451 | rm -rf $RPM_BUILD_ROOT | |
452 | install -d \ | |
453 | $RPM_BUILD_ROOT{%{_webappdir}/{custom_field,templates,workflow},%{_sysconfdir},%{_bindir},%{_sbindir},%{_libdir}} \ | |
454 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,logrotate.d,sysconfig} \ | |
455 | $RPM_BUILD_ROOT/var/{run,cache,lib}/%{name} \ | |
456 | $RPM_BUILD_ROOT/var/log/{archive/,}%{name} \ | |
457 | $RPM_BUILD_ROOT/var/lib/%{name}/routed_{emails,drafts,notes} \ | |
458 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} | |
459 | ||
460 | %{__make} install-eventum install-cli install-scm install-localization \ | |
461 | sysconfdir=%{_webappdir} \ | |
462 | localedir=%{_localedir} \ | |
463 | DESTDIR=$RPM_BUILD_ROOT | |
464 | ||
465 | ln -s %{_webappdir} $RPM_BUILD_ROOT%{_appdir}/config | |
466 | ||
467 | cp -a vendor $RPM_BUILD_ROOT%{_appdir} | |
468 | ||
469 | # unsupported locale | |
470 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ht | |
471 | ||
472 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
473 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
474 | ||
475 | %{?with_order:cp -a htdocs/ajax $RPM_BUILD_ROOT%{_appdir}/htdocs} | |
476 | ||
477 | touch $RPM_BUILD_ROOT%{_webappdir}/htpasswd | |
478 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/apache.conf | |
479 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf | |
480 | cp -p %{SOURCE15} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf | |
481 | ||
482 | install -d $RPM_BUILD_ROOT/etc/sphinx | |
483 | #cp -p config/sphinx.conf $RPM_BUILD_ROOT/etc/sphinx/%{name}.conf | |
484 | cp -p config/sphinx.conf.php $RPM_BUILD_ROOT%{_webappdir} | |
485 | ||
486 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue | |
487 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download | |
488 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder | |
489 | cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor | |
490 | cp -p %{SOURCE10} $RPM_BUILD_ROOT/etc/cron.d/%{name}-sphinx | |
491 | ||
492 | cp -p config/irc_config.dist.php $RPM_BUILD_ROOT%{_webappdir}/irc_config.php | |
493 | ||
494 | install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/eventum-irc | |
495 | cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/eventum-irc | |
496 | ||
497 | cp -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
498 | ||
499 | # postfix router | |
500 | install -p %{SOURCE13} $RPM_BUILD_ROOT%{_libdir}/router-postfix | |
501 | ||
502 | cp -p %{SOURCE17} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
503 | ||
504 | %find_lang %{name} | |
505 | ||
506 | # scm | |
507 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/scm.php | |
508 | ||
509 | %clean | |
510 | rm -rf $RPM_BUILD_ROOT | |
511 | ||
512 | %pre | |
513 | %groupadd -g 146 %{name} | |
514 | %useradd -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name} | |
515 | %addusertogroup http %{name} | |
516 | ||
517 | %post | |
518 | # create empty ghost files | |
519 | # these permissions ensure the logs are write only | |
520 | for a in \ | |
521 | errors.log login_attempts.log \ | |
522 | eventum.log \ | |
523 | cli.log \ | |
524 | irc_bot_error.log irc_bot_smartirc.log \ | |
525 | ; do | |
526 | test -f /var/log/%{name}/$a && continue | |
527 | install -m 0620 -o root -g http /dev/null /var/log/%{name}/$a | |
528 | done | |
529 | ||
530 | # run database update if configured | |
531 | test -s %{_webappdir}/config.php && \ | |
532 | %{_appdir}/bin/upgrade.php || : | |
533 | ||
534 | # nuke Smarty templates cache after upgrade | |
535 | rm -f /var/cache/eventum/*.php | |
536 | ||
537 | # Restart webserver on upgrade to get .mo translations reloaded. | |
538 | # actually php engines "php-fcgi" and "php-fpm" needed only, apache is restarted anyway via webapp trigger. | |
539 | %php_webserver_restart | |
540 | ||
541 | %preun | |
542 | if [ "$1" = "0" ]; then | |
543 | # nuke cache | |
544 | rm -f /var/cache/eventum/*.php 2>/dev/null || : | |
545 | fi | |
546 | ||
547 | %postun | |
548 | if [ "$1" = "0" ]; then | |
549 | %userremove %{name} | |
550 | %groupremove %{name} | |
551 | fi | |
552 | ||
553 | %post setup | |
554 | chmod 660 %{_webappdir}/{config,private_key}.php | |
555 | chown root:http %{_webappdir}/{config,private_key}.php | |
556 | ||
557 | %postun setup | |
558 | if [ "$1" = "0" ] && [ -f %{_webappdir}/config.php ]; then | |
559 | chmod 640 %{_webappdir}/{config,private_key}.php | |
560 | chown root:http %{_webappdir}/{config,private_key}.php | |
561 | fi | |
562 | ||
563 | %post irc | |
564 | /sbin/chkconfig --add eventum-irc | |
565 | %service eventum-irc restart "Eventum IRC Bot" | |
566 | ||
567 | %preun irc | |
568 | if [ "$1" = 0 ]; then | |
569 | %service eventum-irc stop | |
570 | /sbin/chkconfig --del eventum-irc | |
571 | fi | |
572 | ||
573 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
574 | %webapp_register apache %{_webapp} | |
575 | ||
576 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
577 | %webapp_unregister apache %{_webapp} | |
578 | ||
579 | %triggerin -- apache < 2.2.0, apache-base | |
580 | %webapp_register httpd %{_webapp} | |
581 | ||
582 | %triggerun -- apache < 2.2.0, apache-base | |
583 | %webapp_unregister httpd %{_webapp} | |
584 | ||
585 | %triggerin -- lighttpd | |
586 | %webapp_register lighttpd %{_webapp} | |
587 | ||
588 | %triggerun -- lighttpd | |
589 | %webapp_unregister lighttpd %{_webapp} | |
590 | ||
591 | %triggerpostun -- %{name} < 3.0.0-0.2 | |
592 | for f in /etc/cron.d/eventum-*; do | |
593 | # crontabs moved to bin | |
594 | %{__sed} -i -e ' | |
595 | s,/usr/share/eventum/crons/process_mail_queue.php,%{_appdir}/bin/process_mail_queue.php, | |
596 | s,/usr/share/eventum/crons/download_emails.php,%{_appdir}/bin/download_emails.php, | |
597 | s,/usr/share/eventum/crons/check_reminders.php,%{_appdir}/bin/check_reminders.php, | |
598 | s,/usr/share/eventum/crons/monitor.php,%{_appdir}/bin/monitor.php, | |
599 | ' $f | |
600 | done | |
601 | ||
602 | %files -f %{name}.lang | |
603 | %defattr(644,root,root,755) | |
604 | %attr(751,root,root) %dir %{_webappdir} | |
605 | %attr(751,root,root) %dir %{_webappdir}/custom_field | |
606 | %attr(751,root,root) %dir %{_webappdir}/templates | |
607 | %attr(751,root,root) %dir %{_webappdir}/workflow | |
608 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf | |
609 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf | |
610 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/lighttpd.conf | |
611 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/config.php | |
612 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/private_key.php | |
613 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/setup.php | |
614 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/htpasswd | |
615 | ||
616 | %dir %attr(711,root,http) /var/log/%{name} | |
617 | %attr(620,root,http) %ghost /var/log/%{name}/* | |
618 | %dir %attr(750,root,root) /var/log/archive/%{name} | |
619 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} | |
620 | ||
621 | %dir %{_appdir} | |
622 | %{_appdir}/config | |
623 | ||
624 | %dir %{_appdir}/bin | |
625 | %attr(755,root,root) %{_appdir}/bin/process_all_emails.php | |
626 | %attr(755,root,root) %{_appdir}/bin/upgrade.php | |
627 | ||
628 | %{_appdir}/autoload.php | |
629 | %{_appdir}/init.php | |
630 | %dir %{_appdir}/htdocs | |
631 | %{_appdir}/htdocs/*.php | |
632 | %{_appdir}/htdocs/*.ico | |
633 | %{_appdir}/htdocs/ajax | |
634 | %{_appdir}/htdocs/css | |
635 | %{_appdir}/htdocs/customer | |
636 | %{_appdir}/htdocs/images | |
637 | %{_appdir}/htdocs/js | |
638 | %{_appdir}/htdocs/manage | |
639 | %{_appdir}/htdocs/reports | |
640 | %{_appdir}/htdocs/rpc | |
641 | %{_appdir}/htdocs/components | |
642 | %{_appdir}/templates | |
643 | ||
644 | %dir %{_appdir}/upgrade | |
645 | %{_appdir}/upgrade/*.sql | |
646 | %{_appdir}/upgrade/patches | |
647 | ||
648 | %{_appdir}/vendor | |
649 | %{_appdir}/src | |
650 | %dir %{_appdir}/lib | |
651 | %{_appdir}/lib/eventum | |
652 | %exclude %{_appdir}/lib/eventum/class.monitor.php | |
653 | ||
654 | %dir %{_libdir} | |
655 | ||
656 | %{systemdtmpfilesdir}/%{name}.conf | |
657 | ||
658 | %dir /var/lib/%{name} | |
659 | %dir %attr(730,root,http) /var/run/%{name} | |
660 | %dir %attr(730,root,http) /var/cache/%{name} | |
661 | ||
662 | # saved mail copies | |
663 | %attr(770,root,http) %dir /var/lib/%{name}/routed_emails | |
664 | %attr(770,root,http) %dir /var/lib/%{name}/routed_drafts | |
665 | %attr(770,root,http) %dir /var/lib/%{name}/routed_notes | |
666 | ||
667 | %files setup | |
668 | %defattr(644,root,root,755) | |
669 | %{_appdir}/htdocs/setup | |
670 | ||
671 | %files doc | |
672 | %defattr(644,root,root,755) | |
673 | %doc docs/* | |
674 | %{_examplesdir}/%{name}-%{version} | |
675 | ||
676 | %files mail-queue | |
677 | %defattr(644,root,root,755) | |
678 | %attr(755,root,root) %{_appdir}/bin/process_mail_queue.php | |
679 | %attr(755,root,root) %{_appdir}/bin/truncate_mail_queue.php | |
680 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue | |
681 | ||
682 | %files mail-download | |
683 | %defattr(644,root,root,755) | |
684 | %attr(755,root,root) %{_appdir}/bin/download_emails.php | |
685 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download | |
686 | ||
687 | %files reminder | |
688 | %defattr(644,root,root,755) | |
689 | %attr(755,root,root) %{_appdir}/bin/check_reminders.php | |
690 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder | |
691 | ||
692 | %files monitor | |
693 | %defattr(644,root,root,755) | |
694 | %{_appdir}/lib/eventum/class.monitor.php | |
695 | %attr(755,root,root) %{_appdir}/bin/monitor.php | |
696 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor | |
697 | ||
698 | %files router-postfix | |
699 | %defattr(644,root,root,755) | |
700 | %attr(755,root,root) %{_libdir}/router-postfix | |
701 | ||
702 | %files irc | |
703 | %defattr(644,root,root,755) | |
704 | %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/irc_config.php | |
705 | %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/eventum-irc | |
706 | %attr(755,root,root) %{_appdir}/bin/irc-bot.php | |
707 | %attr(754,root,root) /etc/rc.d/init.d/%{name}-irc | |
708 | ||
709 | %files cli | |
710 | %defattr(644,root,root,755) | |
711 | %doc cli/eventumrc | |
712 | %attr(755,root,root) %{_bindir}/%{name} | |
713 | ||
714 | %files scm | |
715 | %defattr(644,root,root,755) | |
716 | %attr(751,root,root) %dir %{_sysconfdir} | |
717 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scm.php | |
718 | %attr(755,root,root) %{_sbindir}/eventum-cvs-hook | |
719 | %attr(755,root,root) %{_sbindir}/eventum-git-hook | |
720 | %attr(755,root,root) %{_sbindir}/eventum-svn-hook | |
721 | %attr(755,root,root) %{_sbindir}/helpers.php | |
722 | ||
723 | %files sphinx | |
724 | %defattr(644,root,root,755) | |
725 | %{_webappdir}/sphinx.conf.php | |
726 | #%attr(750,root,http) %config(noreplace) %verify(not md5 mtime size) /etc/sphinx/%{name}.conf | |
727 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-sphinx |