3 %bcond_with order # with experimental order patch
7 #define githash 2276dac77
8 %define php_min_version 7.3.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-md5: 0f2c9e99c7e0e913f3d1a471486da2eb
18 #Source0: https://github.com/eventum/eventum/releases/download/snapshot/%{name}-%{version}-%{subver}-g%{githash}.tar.xz
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 Source14: %{name}.logrotate
26 Source15: %{name}-lighttpd.conf
27 Source16: http://www.isocra.com/images/updown2.gif
28 # Source16-md5: deb6eeb2552ba757d3a949ed10c4107d
29 Source17: %{name}.tmpfiles
30 Patch2: %{name}-order.patch
31 #Patch3: group-users.patch
32 #Patch4: https://github.com/glensc/eventum/compare/cf_escape.patch
33 # packaging patches that probably never go upstream
34 Patch100: %{name}-paths.patch
35 Patch107: %{name}-gettext.patch
36 Patch108: autoload.patch
38 Patch200: %{name}-fixed-nav.patch
39 URL: https://github.com/eventum/eventum
40 BuildRequires: gettext-tools
41 BuildRequires: rpmbuild(macros) >= 1.654
42 BuildRequires: sed >= 4.0
43 BuildRequires: tar >= 1:1.22
46 Requires(postun): /usr/sbin/groupdel
47 Requires(postun): /usr/sbin/userdel
48 Requires(pre): /bin/id
49 Requires(pre): /usr/bin/getgid
50 Requires(pre): /usr/sbin/groupadd
51 Requires(pre): /usr/sbin/useradd
52 Requires: fonts-TTF-RedHat-liberation
53 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-monolog >= 1.17.2
66 Requires: php-psr-Log >= 1.0.0-2
67 Requires: phplot >= 5.8.0
69 Requires: webserver(access)
70 Requires: webserver(alias)
71 Requires: webserver(indexfile)
72 Requires: webserver(php) >= 4.2.0
74 Suggests: php(openssl)
75 Suggests: webserver(setenv)
76 Provides: group(eventum)
77 Provides: user(eventum)
78 Obsoletes: eventum-base < 3.0.3-1.305
79 Obsoletes: eventum-route-drafts < 3.0.8-1.1
80 Obsoletes: eventum-route-emails < 3.0.8-1.1
81 Obsoletes: eventum-route-notes < 3.0.8-1.1
82 Conflicts: logrotate < 3.8.0
84 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86 %define _noautoreq_pear .*
87 %define _libdir %{_prefix}/lib/%{name}
88 %define _appdir %{_datadir}/%{name}
89 %define _smartydir %{php_data_dir}/Smarty
90 %define _webapps /etc/webapps
91 %define _webapp %{name}
92 %define _webappdir %{_webapps}/%{_webapp}
93 %define _sysconfdir /etc/%{name}
96 Eventum is a user-friendly and flexible issue tracking system that can
97 be used by a support department to track incoming technical support
98 requests, or by a software development team to quickly organize tasks
101 %description -l pl.UTF-8
102 Eventum to przyjazny dla użytkownika system śledzenia spraw, który
103 może być używany przez dział obsługi do śledzenia przychodzących żądań
104 obsługi technicznej albo przez zespół tworzący oprogramowanie do
105 szybkiej organizacji zadań i błędów.
108 Summary: Eventum setup package
109 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Eventum
110 Group: Applications/WWW
111 Requires: %{name} = %{version}-%{release}
114 Install this package to configure initial Eventum installation. You
115 should uninstall this package when you're done, as it considered
116 insecure to keep the setup files in place.
118 %description setup -l pl.UTF-8
119 Ten pakiet należy zainstalować w celu wstępnej konfiguracji Eventum po
120 pierwszej instalacji. Potem należy go odinstalować, jako że
121 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
124 Summary: Eventum documentation and Wiki
128 Eventum documentation and Wiki.
131 Summary: Eventum mail queue process
132 Summary(pl.UTF-8): Przetwarzanie kolejki poczty Eventum
133 Group: Applications/WWW
134 Requires: %{name} = %{version}-%{release}
137 %description mail-queue
138 Beginning with the first release of Eventum, emails are not directly
139 sent out from the various scripts, but rather added to a mail queue
140 table that is processed by a cron job. If an email cannot be sent, it
141 will be marked as such in the mail queue log, and the cron job script
142 will re-try to send it again the next time it runs.
144 This package contains the cron job.
146 %description mail-queue -l pl.UTF-8
147 Od pierwszego wydania Eventum poczta nie jest wysyłana bezpośrednio z
148 różnych skryptów, lecz dodawana do kolejki przetwarzanej z crona.
149 Jeśli poczta nie może być wysłana, będzie odpowiednio oznaczona w logu
150 kolejki poczty, a skrypt z crona będzie próbował wysłać ją ponownie
153 Ten pakiet zawiera zadanie dla crona.
155 %package mail-download
156 Summary: Eventum email download
157 Summary(pl.UTF-8): Ściąganie poczty Eventum
158 Group: Applications/WWW
159 Requires: %{name} = %{version}-%{release}
162 %description mail-download
163 In order for Eventum's email integration feature to work, you need to
164 setup a cron job to run the script every so often.
166 This package contains the cron job.
168 %description mail-download -l pl.UTF-8
169 Aby integracja poczty elektronicznej w Eventum działała, trzeba
170 ustawić zadanie crona, aby uruchamiał odpowiedni skrypt wystarczająco
173 Ten pakiet zawiera zadanie dla crona.
176 Summary: Eventum Reminder System
177 Summary(pl.UTF-8): System przypominania dla Eventum
178 Group: Applications/WWW
179 Requires: %{name} = %{version}-%{release}
182 %description reminder
183 The reminder system was designed with the objective as serving as a
184 safe net for issues that need attention. Depending on what
185 configuration you create, you may have several reminders (or alerts)
186 be sent out whenever an issue needs attention, for whatever parameter
187 you may deem necessary.
189 This package contains the cron job.
191 %description reminder -l pl.UTF-8
192 System przypominania został zaprojektowany tak, aby służył jako
193 bezpieczna sieć dla spraw wymagających uwagi. W zależności od
194 konfiguracji można ustawić różne przypominajki (lub alarmy) wysyłane
195 przy każdej sprawie wymagającej uwagi lub przy parametrze, który można
198 Ten pakiet zawiera zadanie dla crona.
201 Summary: Eventum Heartbeat Monitor
202 Summary(pl.UTF-8): Monitor życia dla Eventum
203 Group: Applications/WWW
204 Requires: %{name} = %{version}-%{release}
209 The heartbeat monitor is a feature designed for the administrator that
210 wants to be alerted whenever a common problem in Eventum is detected,
211 like the database server not being available anymore, or maybe when
212 the recommended permissions for certain configuration files are
215 Please note that before running the heartbeat monitor, you may need to
216 customize some of the checks to be appropriate for your own system,
217 particularly the permission and file checks on
218 Monitor::checkConfiguration().
220 This package contains the cron job.
222 %description monitor -l pl.UTF-8
223 Monitor życia to funkcjonalność zaprojektowana dla administratora
224 chcącego być alarmowanym przy każdym wykryciu popularnego problemu z
225 Eventum, jak nie działanie serwera bazy danych albo zmiana uprawnień
226 do plików konfiguracyjnych.
228 Należy zauważyć, że przed uruchomieniem tego monitora może być
229 konieczne dostosowanie niektórych testów do systemu, w szczególności
230 testów uprawnień i plików w Monitor::checkConfiguration().
232 Ten pakiet zawiera zadanie dla crona.
235 Summary: Eventum Sphinx Search
236 Group: Applications/WWW
237 Requires: %{name} = %{version}-%{release}
242 Sphinx search integration for Eventum.
244 This package contains the cron job.
247 %setup -q -n %{name}-%{version}%{?githash:-%{subver}-g%{githash}}
251 # bug fixes / features
252 %{?with_order:%patch2 -p1}
255 %{?with_order:cp -p %{SOURCE16} htdocs/images}
258 # produce default sphinx config
259 # must be run before paths.patch
261 cat <<'EOF' > config/config.php
263 define('APP_SQL_DBTYPE', 'mysql');
264 define('APP_SQL_DBHOST', 'localhost:/var/lib/mysql/mysql.sock');
265 define('APP_SQL_DBPORT', 3306);
266 define('APP_SQL_DBNAME', 'eventum');
267 define('APP_SQL_DBUSER', 'mysql');
268 define('APP_SQL_DBPASS', '');
269 define('APP_TABLE_PREFIX', 'eventum_');
271 php config/sphinx.conf.php > config/sphinx.conf
280 rm htdocs/.htaccess.dist
282 # cleanup libs taken from system, everything else gets bundled
283 rm -r vendor/fonts/liberation
284 rm -r vendor/monolog/monolog
285 rm -r vendor/phplot/phplot
287 rm -r vendor/smarty-gettext/smarty-gettext
288 rm -r vendor/smarty/smarty
289 rm -r vendor/sphinx/php-sphinxapi
291 %{__sed} -i '1s|^#!.*php\b|#!/usr/bin/php|' config/sphinx.conf.php bin/*.php
293 # remove backups from patching as we use globs to package files to buildroot
294 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
297 %{__make} -C localization
300 rm -rf $RPM_BUILD_ROOT
302 $RPM_BUILD_ROOT{%{_webappdir}/{custom_field,templates,workflow},%{_sysconfdir},%{_bindir},%{_sbindir},%{_libdir}} \
303 $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,logrotate.d,sysconfig} \
304 $RPM_BUILD_ROOT/var/{run,lib,spool}/%{name} \
305 $RPM_BUILD_ROOT/var/log/{archive/,}%{name} \
306 $RPM_BUILD_ROOT/var/lib/%{name}/{routed_{emails,drafts,notes},storage} \
307 $RPM_BUILD_ROOT/var/cache/%{name}/doctrine/proxies \
308 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
310 %{__make} install-eventum install-localization \
311 sysconfdir=%{_webappdir} \
312 localedir=%{_localedir} \
313 DESTDIR=$RPM_BUILD_ROOT
315 ln -s --relative $RPM_BUILD_ROOT{%{_webappdir},%{_appdir}/config}
317 cp -a vendor $RPM_BUILD_ROOT%{_appdir}
320 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ht
322 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
323 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
325 %{?with_order:cp -a htdocs/ajax $RPM_BUILD_ROOT%{_appdir}/htdocs}
327 touch $RPM_BUILD_ROOT%{_webappdir}/htpasswd
328 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
329 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
330 cp -p %{SOURCE15} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf
332 install -d $RPM_BUILD_ROOT/etc/sphinx
333 #cp -p config/sphinx.conf $RPM_BUILD_ROOT/etc/sphinx/%{name}.conf
334 cp -p config/sphinx.conf.php $RPM_BUILD_ROOT%{_webappdir}
336 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
337 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
338 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder
339 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor
340 cp -p %{SOURCE10} $RPM_BUILD_ROOT/etc/cron.d/%{name}-sphinx
342 cp -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
344 cp -p %{SOURCE17} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
349 rm -rf $RPM_BUILD_ROOT
352 %groupadd -g 146 %{name}
353 %useradd -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
354 %addusertogroup http %{name}
357 # create empty ghost files
358 # these permissions ensure the logs are write only
360 errors.log login_attempts.log \
364 test -f /var/log/%{name}/$a && continue
365 install -m 0620 -o root -g http /dev/null /var/log/%{name}/$a
368 # run database update if configured
369 test -s %{_webappdir}/setup.php && \
370 sudo -H -u http -- %{_appdir}/bin/upgrade.php || :
372 # nuke Smarty templates cache after upgrade
373 rm -f /var/cache/eventum/smarty/*.php
375 # Restart webserver on upgrade to get .mo translations reloaded.
376 # actually php engines "php-fcgi" and "php-fpm" needed only, apache is restarted anyway via webapp trigger.
377 %php_webserver_restart
380 if [ "$1" = "0" ]; then
386 chmod 660 %{_webappdir}/{setup,private_key,secret_key}.php
387 chown root:http %{_webappdir}/{setup,private_key,secret_key}.php
390 if [ "$1" = "0" ] && [ -f %{_webappdir}/setup.php ]; then
391 chmod 640 %{_webappdir}/{setup,private_key,secret_key}.php
392 chown root:http %{_webappdir}/{setup,private_key,secret_key}.php
395 %triggerin -- apache1 < 1.3.37-3, apache1-base
396 %webapp_register apache %{_webapp}
398 %triggerun -- apache1 < 1.3.37-3, apache1-base
399 %webapp_unregister apache %{_webapp}
401 %triggerin -- apache < 2.2.0, apache-base
402 %webapp_register httpd %{_webapp}
404 %triggerun -- apache < 2.2.0, apache-base
405 %webapp_unregister httpd %{_webapp}
407 %triggerin -- lighttpd
408 %webapp_register lighttpd %{_webapp}
410 %triggerun -- lighttpd
411 %webapp_unregister lighttpd %{_webapp}
413 %files -f %{name}.lang
414 %defattr(644,root,root,755)
415 %attr(771,root,http) %dir %{_webappdir}
416 %attr(751,root,http) %dir %{_webappdir}/crm
417 %attr(751,root,http) %dir %{_webappdir}/custom_field
418 %attr(751,root,http) %dir %{_webappdir}/partner
419 %attr(751,root,http) %dir %{_webappdir}/templates
420 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/htpasswd
421 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/private_key.php
422 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/secret_key.php
423 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
424 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
425 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/lighttpd.conf
426 %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/setup.php
428 %dir %attr(731,root,http) /var/log/%{name}
429 %attr(620,root,http) %ghost /var/log/%{name}/*
430 %dir %attr(750,root,root) /var/log/archive/%{name}
431 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
437 %attr(755,root,root) %{_appdir}/bin/check_reminders.php
438 %attr(755,root,root) %{_appdir}/bin/console.php
439 %attr(755,root,root) %{_appdir}/bin/download_emails.php
440 %attr(755,root,root) %{_appdir}/bin/export-issues.php
441 %attr(755,root,root) %{_appdir}/bin/extension.php
442 %attr(755,root,root) %{_appdir}/bin/ldapsync.php
443 %attr(755,root,root) %{_appdir}/bin/migrate_storage_adapter.php
444 %attr(755,root,root) %{_appdir}/bin/monitor.php
445 %attr(755,root,root) %{_appdir}/bin/process_all_emails.php
446 %attr(755,root,root) %{_appdir}/bin/process_mail_queue.php
447 %attr(755,root,root) %{_appdir}/bin/truncate_mail_queue.php
448 %attr(755,root,root) %{_appdir}/bin/upgrade.php
450 %{_appdir}/autoload.php
453 %dir %{_appdir}/htdocs
454 %{_appdir}/htdocs/*.php
455 %{_appdir}/htdocs/*.ico
456 %{_appdir}/htdocs/mix-manifest.json
457 %{_appdir}/htdocs/ajax
458 %{_appdir}/htdocs/css
459 %{_appdir}/htdocs/customer
460 %{_appdir}/htdocs/fonts
461 %{_appdir}/htdocs/images
463 %{_appdir}/htdocs/manage
464 %{_appdir}/htdocs/reports
465 %{_appdir}/htdocs/rpc
469 %dir %{_appdir}/db/migrations
470 %{_appdir}/db/migrations/*.php
471 %dir %{_appdir}/db/seeds
472 %{_appdir}/db/seeds/*.php
478 %{_appdir}/lib/eventum
482 %{systemdtmpfilesdir}/%{name}.conf
484 %dir /var/lib/%{name}
485 %dir %attr(730,root,http) /var/run/%{name}
486 %dir %attr(730,root,http) /var/spool/%{name}
487 %dir %attr(730,root,http) /var/cache/%{name}
488 %dir %attr(730,root,http) /var/cache/%{name}/doctrine
489 %dir %attr(730,root,http) /var/cache/%{name}/doctrine/proxies
492 %attr(770,root,http) %dir /var/lib/%{name}/routed_emails
493 %attr(770,root,http) %dir /var/lib/%{name}/routed_drafts
494 %attr(770,root,http) %dir /var/lib/%{name}/routed_notes
496 %attr(770,root,http) %dir /var/lib/%{name}/storage
499 %defattr(644,root,root,755)
500 %{_appdir}/htdocs/setup
503 %defattr(644,root,root,755)
505 %{_examplesdir}/%{name}-%{version}
508 %defattr(644,root,root,755)
509 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
512 %defattr(644,root,root,755)
513 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
516 %defattr(644,root,root,755)
517 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
520 %defattr(644,root,root,755)
521 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
524 %defattr(644,root,root,755)
525 %{_webappdir}/sphinx.conf.php
526 #%attr(750,root,http) %config(noreplace) %verify(not md5 mtime size) /etc/sphinx/%{name}.conf
527 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-sphinx