3 %bcond_with order # with experimental order patch
7 %define githash a5872073e
8 %define php_min_version 5.6.0
9 Summary: Eventum Issue / Bug tracking system
10 Summary(pl.UTF-8): Eventum - system śledzenia spraw/błędów
13 Release: %{?subver:1.%{subver}.%{?githash:g%{githash}.}}%{rel}
15 Group: Applications/WWW
16 #Source0: https://github.com/eventum/eventum/releases/download/v%{version}/%{name}-%{version}.tar.xz
17 Source0: https://github.com/eventum/eventum/releases/download/snapshot/%{name}-%{version}-%{subver}-g%{githash}.tar.xz
18 # Source0-md5: 3e1b7e7f76b5207fa0c3d3df422445b6
19 Source1: %{name}-apache.conf
20 Source2: %{name}-mail-queue.cron
21 Source3: %{name}-mail-download.cron
22 Source4: %{name}-reminder.cron
23 Source5: %{name}-monitor.cron
24 Source10: sphinx.crontab
25 Source13: %{name}-router-postfix.sh
26 Source14: %{name}.logrotate
27 Source15: %{name}-lighttpd.conf
28 Source16: http://www.isocra.com/images/updown2.gif
29 # Source16-md5: deb6eeb2552ba757d3a949ed10c4107d
30 Source17: %{name}.tmpfiles
31 Patch2: %{name}-order.patch
32 #Patch3: group-users.patch
33 #Patch4: https://github.com/glensc/eventum/compare/cf_escape.patch
34 # packaging patches that probably never go upstream
35 Patch100: %{name}-paths.patch
36 Patch107: %{name}-gettext.patch
37 Patch108: autoload.patch
39 Patch200: %{name}-fixed-nav.patch
40 URL: https://wiki.github.com/eventum/eventum/
41 BuildRequires: gettext-tools
42 BuildRequires: rpmbuild(macros) >= 1.654
43 BuildRequires: sed >= 4.0
44 BuildRequires: tar >= 1:1.22
47 Requires(postun): /usr/sbin/groupdel
48 Requires(postun): /usr/sbin/userdel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /usr/sbin/groupadd
52 Requires(pre): /usr/sbin/useradd
53 Requires: fonts-TTF-RedHat-liberation
54 Requires: php(core) >= %{php_min_version}
59 Requires: php(mbstring)
61 Requires: php(pdo_mysql)
62 Requires: php(session)
63 Requires: php-Smarty >= 3.1
64 Requires: php-Smarty-plugin-gettext
65 Requires: php-ZendFramework-Config >= 2.4
66 Requires: php-ZendFramework-Loader >= 2.4
67 Requires: php-ZendFramework-Mail >= 2.4.13-2
68 Requires: php-ZendFramework-Mime >= 2.4
69 Requires: php-ZendFramework-ServiceManager >= 2.4
70 Requires: php-ZendFramework-Validator >= 2.4
71 Requires: php-monolog >= 1.17.2
72 Requires: php-pear-Math_Stats
73 Requires: php-pear-Net_SMTP
74 Requires: php-pear-Net_Socket
75 Requires: php-pear-Net_URL
76 Requires: php-pear-PEAR-core
77 Requires: php-pear-Text_Diff
78 Requires: php-psr-Log >= 1.0.0-2
79 Requires: phplot >= 5.8.0
81 Requires: webserver(access)
82 Requires: webserver(alias)
83 Requires: webserver(indexfile)
84 Requires: webserver(php) >= 4.2.0
87 Suggests: php(openssl)
88 Suggests: php-pear-Net_POP3
89 Suggests: webserver(setenv)
90 Provides: group(eventum)
91 Provides: user(eventum)
92 Obsoletes: eventum-base < 3.0.3-1.305
93 Obsoletes: eventum-route-drafts < 3.0.8-1.1
94 Obsoletes: eventum-route-emails < 3.0.8-1.1
95 Obsoletes: eventum-route-notes < 3.0.8-1.1
96 Conflicts: logrotate < 3.8.0
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100 %define _libdir %{_prefix}/lib/%{name}
101 %define _appdir %{_datadir}/%{name}
102 %define _smartydir %{php_data_dir}/Smarty
103 %define _webapps /etc/webapps
104 %define _webapp %{name}
105 %define _webappdir %{_webapps}/%{_webapp}
106 %define _sysconfdir /etc/%{name}
109 Eventum is a user-friendly and flexible issue tracking system that can
110 be used by a support department to track incoming technical support
111 requests, or by a software development team to quickly organize tasks
114 %description -l pl.UTF-8
115 Eventum to przyjazny dla użytkownika system śledzenia spraw, który
116 może być używany przez dział obsługi do śledzenia przychodzących żądań
117 obsługi technicznej albo przez zespół tworzący oprogramowanie do
118 szybkiej organizacji zadań i błędów.
121 Summary: Eventum setup package
122 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Eventum
123 Group: Applications/WWW
124 Requires: %{name} = %{version}-%{release}
127 Install this package to configure initial Eventum installation. You
128 should uninstall this package when you're done, as it considered
129 insecure to keep the setup files in place.
131 %description setup -l pl.UTF-8
132 Ten pakiet należy zainstalować w celu wstępnej konfiguracji Eventum po
133 pierwszej instalacji. Potem należy go odinstalować, jako że
134 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
137 Summary: Eventum documentation and Wiki
141 Eventum documentation and copy of Wiki.
144 Summary: Eventum mail queue process
145 Summary(pl.UTF-8): Przetwarzanie kolejki poczty Eventum
146 Group: Applications/WWW
147 Requires: %{name} = %{version}-%{release}
150 %description mail-queue
151 Beginning with the first release of Eventum, emails are not directly
152 sent out from the various scripts, but rather added to a mail queue
153 table that is processed by a cron job. If an email cannot be sent, it
154 will be marked as such in the mail queue log, and the cron job script
155 will re-try to send it again the next time it runs.
157 This package contains the cron job.
159 %description mail-queue -l pl.UTF-8
160 Od pierwszego wydania Eventum poczta nie jest wysyłana bezpośrednio z
161 różnych skryptów, lecz dodawana do kolejki przetwarzanej z crona.
162 Jeśli poczta nie może być wysłana, będzie odpowiednio oznaczona w logu
163 kolejki poczty, a skrypt z crona będzie próbował wysłać ją ponownie
166 Ten pakiet zawiera zadanie dla crona.
168 %package mail-download
169 Summary: Eventum email download
170 Summary(pl.UTF-8): Ściąganie poczty Eventum
171 Group: Applications/WWW
172 Requires: %{name} = %{version}-%{release}
175 %description mail-download
176 In order for Eventum's email integration feature to work, you need to
177 setup a cron job to run the script every so often.
179 This package contains the cron job.
181 %description mail-download -l pl.UTF-8
182 Aby integracja poczty elektronicznej w Eventum działała, trzeba
183 ustawić zadanie crona, aby uruchamiał odpowiedni skrypt wystarczająco
186 Ten pakiet zawiera zadanie dla crona.
189 Summary: Eventum Reminder System
190 Summary(pl.UTF-8): System przypominania dla Eventum
191 Group: Applications/WWW
192 Requires: %{name} = %{version}-%{release}
195 %description reminder
196 The reminder system was designed with the objective as serving as a
197 safe net for issues that need attention. Depending on what
198 configuration you create, you may have several reminders (or alerts)
199 be sent out whenever an issue needs attention, for whatever parameter
200 you may deem necessary.
202 This package contains the cron job.
204 %description reminder -l pl.UTF-8
205 System przypominania został zaprojektowany tak, aby służył jako
206 bezpieczna sieć dla spraw wymagających uwagi. W zależności od
207 konfiguracji można ustawić różne przypominajki (lub alarmy) wysyłane
208 przy każdej sprawie wymagającej uwagi lub przy parametrze, który można
211 Ten pakiet zawiera zadanie dla crona.
214 Summary: Eventum Heartbeat Monitor
215 Summary(pl.UTF-8): Monitor życia dla Eventum
216 Group: Applications/WWW
217 Requires: %{name} = %{version}-%{release}
222 The heartbeat monitor is a feature designed for the administrator that
223 wants to be alerted whenever a common problem in Eventum is detected,
224 like the database server not being available anymore, or maybe when
225 the recommended permissions for certain configuration files are
228 Please note that before running the heartbeat monitor, you may need to
229 customize some of the checks to be appropriate for your own system,
230 particularly the permission and file checks on
231 Monitor::checkConfiguration().
233 This package contains the cron job.
235 %description monitor -l pl.UTF-8
236 Monitor życia to funkcjonalność zaprojektowana dla administratora
237 chcącego być alarmowanym przy każdym wykryciu popularnego problemu z
238 Eventum, jak nie działanie serwera bazy danych albo zmiana uprawnień
239 do plików konfiguracyjnych.
241 Należy zauważyć, że przed uruchomieniem tego monitora może być
242 konieczne dostosowanie niektórych testów do systemu, w szczególności
243 testów uprawnień i plików w Monitor::checkConfiguration().
245 Ten pakiet zawiera zadanie dla crona.
247 %package router-postfix
248 Summary: Eventum Mail Routing - Postfix
249 Summary(pl.UTF-8): Przekazywanie poczty Eventum - Postfix
250 Group: Applications/Mail
251 Requires: %{name} = %{version}-%{release}
253 Provides: eventum(router)
254 Obsoletes: eventum(router)
256 %description router-postfix
257 This package provides way of routing notes and emails back to Eventum
260 The Postfix configuration instructions you can find from
261 <https://github.com/eventum/eventum/wiki/System-Admin:-Setting-up-email-routing-with-postfix>
263 %description router-postfix -l pl.UTF-8
264 Ten pakiet udostępnia metodę przekazywania notatek i listów do Eventum
267 Opis konfiguracji Postfiksa można znaleźć pod adresem
268 <https://github.com/eventum/eventum/wiki/System-Admin:-Setting-up-email-routing-with-postfix>
271 Summary: Eventum Sphinx Search
272 Group: Applications/WWW
273 Requires: %{name} = %{version}-%{release}
278 Sphinx search integration for Eventum.
280 This package contains the cron job.
283 %setup -q -n %{name}-%{version}%{?githash:-%{subver}-g%{githash}}
287 # bug fixes / features
288 %{?with_order:%patch2 -p1}
291 %{?with_order:cp -p %{SOURCE16} htdocs/images}
294 # produce default sphinx config
295 # must be run before paths.patch
297 cat <<'EOF' > config/config.php
299 define('APP_SQL_DBTYPE', 'mysql');
300 define('APP_SQL_DBHOST', 'localhost:/var/lib/mysql/mysql.sock');
301 define('APP_SQL_DBPORT', 3306);
302 define('APP_SQL_DBNAME', 'eventum');
303 define('APP_SQL_DBUSER', 'mysql');
304 define('APP_SQL_DBPASS', '');
305 define('APP_TABLE_PREFIX', 'eventum_');
307 php config/sphinx.conf.php > config/sphinx.conf
316 rm htdocs/.htaccess.dist
317 rm config/config.dist.php
319 # cleanup libs taken from system, everything else gets bundled
320 rm -r vendor/fonts/liberation
321 rm -r vendor/monolog/monolog
322 rm -r vendor/pear/pear-core-minimal
323 rm -r vendor/pear/pear_exception
324 rm -r vendor/pear-pear.php.net/Math_Stats
325 rm -r vendor/pear-pear.php.net/Text_Diff
326 rm -r vendor/php-gettext/php-gettext
327 rm -r vendor/phplot/phplot
329 rm -r vendor/smarty-gettext/smarty-gettext
330 rm -r vendor/smarty/smarty
331 rm -r vendor/sphinx/php-sphinxapi
332 rm -r vendor/zendframework/zend-config
333 rm -r vendor/zendframework/zend-loader
334 rm -r vendor/zendframework/zend-mail
335 rm -r vendor/zendframework/zend-mime
336 rm -r vendor/zendframework/zend-servicemanager
337 rm -r vendor/zendframework/zend-stdlib
338 rm -r vendor/zendframework/zend-validator
340 # remove backups from patching as we use globs to package files to buildroot
341 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
344 %{__make} -C localization
347 rm -rf $RPM_BUILD_ROOT
349 $RPM_BUILD_ROOT{%{_webappdir}/{custom_field,templates,workflow},%{_sysconfdir},%{_bindir},%{_sbindir},%{_libdir}} \
350 $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,logrotate.d,sysconfig} \
351 $RPM_BUILD_ROOT/var/{run,cache,lib}/%{name} \
352 $RPM_BUILD_ROOT/var/log/{archive/,}%{name} \
353 $RPM_BUILD_ROOT/var/lib/%{name}/{routed_{emails,drafts,notes},storage} \
354 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
356 %{__make} install-eventum install-localization \
357 sysconfdir=%{_webappdir} \
358 localedir=%{_localedir} \
359 DESTDIR=$RPM_BUILD_ROOT
361 ln -s %{_webappdir} $RPM_BUILD_ROOT%{_appdir}/config
363 cp -a vendor $RPM_BUILD_ROOT%{_appdir}
366 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ht
368 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
369 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
371 %{?with_order:cp -a htdocs/ajax $RPM_BUILD_ROOT%{_appdir}/htdocs}
373 touch $RPM_BUILD_ROOT%{_webappdir}/htpasswd
374 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
375 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
376 cp -p %{SOURCE15} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf
378 install -d $RPM_BUILD_ROOT/etc/sphinx
379 #cp -p config/sphinx.conf $RPM_BUILD_ROOT/etc/sphinx/%{name}.conf
380 cp -p config/sphinx.conf.php $RPM_BUILD_ROOT%{_webappdir}
382 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
383 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
384 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder
385 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor
386 cp -p %{SOURCE10} $RPM_BUILD_ROOT/etc/cron.d/%{name}-sphinx
388 cp -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
391 install -p %{SOURCE13} $RPM_BUILD_ROOT%{_libdir}/router-postfix
393 cp -p %{SOURCE17} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
398 rm -rf $RPM_BUILD_ROOT
401 %groupadd -g 146 %{name}
402 %useradd -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
403 %addusertogroup http %{name}
406 # create empty ghost files
407 # these permissions ensure the logs are write only
409 errors.log login_attempts.log \
413 test -f /var/log/%{name}/$a && continue
414 install -m 0620 -o root -g http /dev/null /var/log/%{name}/$a
417 # run database update if configured
418 test -s %{_webappdir}/config.php && \
419 sudo -H -u http -- %{_appdir}/bin/upgrade.php || :
421 # nuke Smarty templates cache after upgrade
422 rm -f /var/cache/eventum/*.php
424 # Restart webserver on upgrade to get .mo translations reloaded.
425 # actually php engines "php-fcgi" and "php-fpm" needed only, apache is restarted anyway via webapp trigger.
426 %php_webserver_restart
429 if [ "$1" = "0" ]; then
431 rm -f /var/cache/eventum/*.php 2>/dev/null || :
435 if [ "$1" = "0" ]; then
441 chmod 660 %{_webappdir}/{config,private_key,secret_key}.php
442 chown root:http %{_webappdir}/{config,private_key,secret_key}.php
445 if [ "$1" = "0" ] && [ -f %{_webappdir}/config.php ]; then
446 chmod 640 %{_webappdir}/{config,private_key,secret_key}.php
447 chown root:http %{_webappdir}/{config,private_key,secret_key}.php
450 %triggerin -- apache1 < 1.3.37-3, apache1-base
451 %webapp_register apache %{_webapp}
453 %triggerun -- apache1 < 1.3.37-3, apache1-base
454 %webapp_unregister apache %{_webapp}
456 %triggerin -- apache < 2.2.0, apache-base
457 %webapp_register httpd %{_webapp}
459 %triggerun -- apache < 2.2.0, apache-base
460 %webapp_unregister httpd %{_webapp}
462 %triggerin -- lighttpd
463 %webapp_register lighttpd %{_webapp}
465 %triggerun -- lighttpd
466 %webapp_unregister lighttpd %{_webapp}
468 %files -f %{name}.lang
469 %defattr(644,root,root,755)
470 %attr(771,root,http) %dir %{_webappdir}
471 %attr(751,root,http) %dir %{_webappdir}/crm
472 %attr(751,root,http) %dir %{_webappdir}/custom_field
473 %attr(751,root,http) %dir %{_webappdir}/partner
474 %attr(751,root,http) %dir %{_webappdir}/templates
475 %attr(751,root,http) %dir %{_webappdir}/workflow
476 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
477 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
478 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/lighttpd.conf
479 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/config.php
480 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/private_key.php
481 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/secret_key.php
482 %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/setup.php
483 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/htpasswd
485 %dir %attr(731,root,http) /var/log/%{name}
486 %attr(620,root,http) %ghost /var/log/%{name}/*
487 %dir %attr(750,root,root) /var/log/archive/%{name}
488 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
494 %attr(755,root,root) %{_appdir}/bin/extension.php
495 %attr(755,root,root) %{_appdir}/bin/ldapsync.php
496 %attr(755,root,root) %{_appdir}/bin/migrate_storage_adapter.php
497 %attr(755,root,root) %{_appdir}/bin/process_all_emails.php
498 %attr(755,root,root) %{_appdir}/bin/upgrade.php
500 %{_appdir}/autoload.php
501 %{_appdir}/globals.php
504 %dir %{_appdir}/htdocs
505 %{_appdir}/htdocs/*.php
506 %{_appdir}/htdocs/*.ico
507 %{_appdir}/htdocs/ajax
508 %{_appdir}/htdocs/css
509 %{_appdir}/htdocs/customer
510 %{_appdir}/htdocs/images
512 %{_appdir}/htdocs/manage
513 %{_appdir}/htdocs/reports
514 %{_appdir}/htdocs/rpc
515 %{_appdir}/htdocs/components
519 %dir %{_appdir}/db/migrations
520 %{_appdir}/db/migrations/*.php
526 %{_appdir}/lib/eventum
527 %exclude %{_appdir}/src/Console/Command/MailDownloadCommand.php
528 %exclude %{_appdir}/src/Console/Command/MailQueueProcessCommand.php
529 %exclude %{_appdir}/src/Console/Command/MailQueueTruncateCommand.php
530 %exclude %{_appdir}/src/Console/Command/MonitorCommand.php
531 %exclude %{_appdir}/src/Console/Command/ReminderCheckCommand.php
535 %{systemdtmpfilesdir}/%{name}.conf
537 %dir /var/lib/%{name}
538 %dir %attr(730,root,http) /var/run/%{name}
539 %dir %attr(730,root,http) /var/cache/%{name}
542 %attr(770,root,http) %dir /var/lib/%{name}/routed_emails
543 %attr(770,root,http) %dir /var/lib/%{name}/routed_drafts
544 %attr(770,root,http) %dir /var/lib/%{name}/routed_notes
546 %attr(770,root,http) %dir /var/lib/%{name}/storage
549 %defattr(644,root,root,755)
550 %{_appdir}/htdocs/setup
553 %defattr(644,root,root,755)
555 %{_examplesdir}/%{name}-%{version}
558 %defattr(644,root,root,755)
559 %{_appdir}/src/Console/Command/MailQueueProcessCommand.php
560 %{_appdir}/src/Console/Command/MailQueueTruncateCommand.php
561 %attr(755,root,root) %{_appdir}/bin/process_mail_queue.php
562 %attr(755,root,root) %{_appdir}/bin/truncate_mail_queue.php
563 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
566 %defattr(644,root,root,755)
567 %{_appdir}/src/Console/Command/MailDownloadCommand.php
568 %attr(755,root,root) %{_appdir}/bin/download_emails.php
569 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
572 %defattr(644,root,root,755)
573 %{_appdir}/src/Console/Command/ReminderCheckCommand.php
574 %attr(755,root,root) %{_appdir}/bin/check_reminders.php
575 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
578 %defattr(644,root,root,755)
579 %{_appdir}/src/Console/Command/MonitorCommand.php
580 %attr(755,root,root) %{_appdir}/bin/monitor.php
581 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
583 %files router-postfix
584 %defattr(644,root,root,755)
585 %attr(755,root,root) %{_libdir}/router-postfix
588 %defattr(644,root,root,755)
589 %{_webappdir}/sphinx.conf.php
590 #%attr(750,root,http) %config(noreplace) %verify(not md5 mtime size) /etc/sphinx/%{name}.conf
591 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-sphinx