]> git.pld-linux.org Git - packages/eventum.git/blob - eventum.spec
Up to 3.10.12
[packages/eventum.git] / eventum.spec
1 #
2 # Conditional build:
3 %bcond_with     order   # with experimental order patch
4
5 %define         rel             1
6 #define         subver  37
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
11 Name:           eventum
12 Version:        3.10.12
13 Release:        %{?subver:1.%{subver}.%{?githash:g%{githash}.}}%{rel}
14 License:        GPL v2+
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
37 # some tests
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
44 BuildRequires:  xz
45 Requires(post): sudo
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}
54 Requires:       php(ds)
55 Requires:       php(filter)
56 Requires:       php(iconv)
57 Requires:       php(imap)
58 Requires:       php(json)
59 Requires:       php(mbstring)
60 Requires:       php(pcre)
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
68 Requires:       webapps
69 Requires:       webserver(access)
70 Requires:       webserver(alias)
71 Requires:       webserver(indexfile)
72 Requires:       webserver(php) >= 4.2.0
73 Suggests:       localedb
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
83 BuildArch:      noarch
84 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85
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}
94
95 %description
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
99 and bugs.
100
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.
106
107 %package setup
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}
112
113 %description setup
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.
117
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.
122
123 %package doc
124 Summary:        Eventum documentation and Wiki
125 Group:          Documentation
126
127 %description doc
128 Eventum documentation and Wiki.
129
130 %package mail-queue
131 Summary:        Eventum mail queue process
132 Summary(pl.UTF-8):      Przetwarzanie kolejki poczty Eventum
133 Group:          Applications/WWW
134 Requires:       %{name} = %{version}-%{release}
135 Requires:       crondaemon
136
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.
143
144 This package contains the cron job.
145
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
151 następnym razem.
152
153 Ten pakiet zawiera zadanie dla crona.
154
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}
160 Requires:       crondaemon
161
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.
165
166 This package contains the cron job.
167
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
171 często.
172
173 Ten pakiet zawiera zadanie dla crona.
174
175 %package reminder
176 Summary:        Eventum Reminder System
177 Summary(pl.UTF-8):      System przypominania dla Eventum
178 Group:          Applications/WWW
179 Requires:       %{name} = %{version}-%{release}
180 Requires:       crondaemon
181
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.
188
189 This package contains the cron job.
190
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
196 uważać za potrzebny.
197
198 Ten pakiet zawiera zadanie dla crona.
199
200 %package monitor
201 Summary:        Eventum Heartbeat Monitor
202 Summary(pl.UTF-8):      Monitor życia dla Eventum
203 Group:          Applications/WWW
204 Requires:       %{name} = %{version}-%{release}
205 Requires:       crondaemon
206 Requires:       php(posix)
207
208 %description monitor
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
213 changed.
214
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().
219
220 This package contains the cron job.
221
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.
227
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().
231
232 Ten pakiet zawiera zadanie dla crona.
233
234 %package sphinx
235 Summary:        Eventum Sphinx Search
236 Group:          Applications/WWW
237 Requires:       %{name} = %{version}-%{release}
238 Requires:       crondaemon
239 Requires:       sphinx
240
241 %description sphinx
242 Sphinx search integration for Eventum.
243
244 This package contains the cron job.
245
246 %prep
247 %setup -q -n %{name}-%{version}%{?githash:-%{subver}-g%{githash}}
248
249 mv docs/examples .
250
251 # bug fixes / features
252 %{?with_order:%patch2 -p1}
253 #%patch3 -p0
254 #%patch4 -p1
255 %{?with_order:cp -p %{SOURCE16} htdocs/images}
256 #%patch200 -p1
257
258 # produce default sphinx config
259 # must be run before paths.patch
260 %if 0
261 cat <<'EOF' > config/config.php
262 <?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_');
270 EOF
271 php config/sphinx.conf.php > config/sphinx.conf
272 rm config/config.php
273 %endif
274
275 # packaging
276 %patch100 -p1
277 %patch107 -p1
278 %patch108 -p1
279
280 rm htdocs/.htaccess.dist
281
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
286 rm -r vendor/psr/log
287 rm -r vendor/smarty-gettext/smarty-gettext
288 rm -r vendor/smarty/smarty
289 rm -r vendor/sphinx/php-sphinxapi
290
291 %{__sed} -i '1s|^#!.*php\b|#!/usr/bin/php|' config/sphinx.conf.php bin/*.php
292
293 # remove backups from patching as we use globs to package files to buildroot
294 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
295
296 %build
297 %{__make} -C localization
298
299 %install
300 rm -rf $RPM_BUILD_ROOT
301 install -d \
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}
309
310 %{__make} install-eventum install-localization \
311         sysconfdir=%{_webappdir} \
312         localedir=%{_localedir} \
313         DESTDIR=$RPM_BUILD_ROOT
314
315 ln -s --relative $RPM_BUILD_ROOT{%{_webappdir},%{_appdir}/config}
316
317 cp -a vendor $RPM_BUILD_ROOT%{_appdir}
318
319 # unsupported locale
320 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ht
321
322 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
323 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
324
325 %{?with_order:cp -a htdocs/ajax $RPM_BUILD_ROOT%{_appdir}/htdocs}
326
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
331
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}
335
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
341
342 cp -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
343
344 cp -p %{SOURCE17} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
345
346 %find_lang %{name}
347
348 %clean
349 rm -rf $RPM_BUILD_ROOT
350
351 %pre
352 %groupadd -g 146 %{name}
353 %useradd -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
354 %addusertogroup http %{name}
355
356 %post
357 # create empty ghost files
358 # these permissions ensure the logs are write only
359 for a in \
360         errors.log login_attempts.log \
361         eventum.log \
362         auth.log cli.log \
363 ; do
364         test -f /var/log/%{name}/$a && continue
365         install -m 0620 -o root -g http /dev/null /var/log/%{name}/$a
366 done
367
368 # run database update if configured
369 test -s %{_webappdir}/setup.php && \
370 sudo -H -u http -- %{_appdir}/bin/upgrade.php || :
371
372 # nuke Smarty templates cache after upgrade
373 rm -f /var/cache/eventum/smarty/*.php
374
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
378
379 %postun
380 if [ "$1" = "0" ]; then
381         %userremove %{name}
382         %groupremove %{name}
383 fi
384
385 %post setup
386 chmod 660 %{_webappdir}/{setup,private_key,secret_key}.php
387 chown root:http %{_webappdir}/{setup,private_key,secret_key}.php
388
389 %postun setup
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
393 fi
394
395 %triggerin -- apache1 < 1.3.37-3, apache1-base
396 %webapp_register apache %{_webapp}
397
398 %triggerun -- apache1 < 1.3.37-3, apache1-base
399 %webapp_unregister apache %{_webapp}
400
401 %triggerin -- apache < 2.2.0, apache-base
402 %webapp_register httpd %{_webapp}
403
404 %triggerun -- apache < 2.2.0, apache-base
405 %webapp_unregister httpd %{_webapp}
406
407 %triggerin -- lighttpd
408 %webapp_register lighttpd %{_webapp}
409
410 %triggerun -- lighttpd
411 %webapp_unregister lighttpd %{_webapp}
412
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
427
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}
432
433 %dir %{_appdir}
434 %{_appdir}/config
435
436 %dir %{_appdir}/bin
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
449
450 %{_appdir}/autoload.php
451 %{_appdir}/init.php
452 %{_appdir}/phinx.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
462 %{_appdir}/htdocs/js
463 %{_appdir}/htdocs/manage
464 %{_appdir}/htdocs/reports
465 %{_appdir}/htdocs/rpc
466 %{_appdir}/templates
467
468 %dir %{_appdir}/db
469 %dir %{_appdir}/db/migrations
470 %{_appdir}/db/migrations/*.php
471 %dir %{_appdir}/db/seeds
472 %{_appdir}/db/seeds/*.php
473
474 %{_appdir}/res
475 %{_appdir}/src
476 %{_appdir}/vendor
477 %dir %{_appdir}/lib
478 %{_appdir}/lib/eventum
479
480 %dir %{_libdir}
481
482 %{systemdtmpfilesdir}/%{name}.conf
483
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
490
491 # saved mail copies
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
495 # attachment storage
496 %attr(770,root,http) %dir /var/lib/%{name}/storage
497
498 %files setup
499 %defattr(644,root,root,755)
500 %{_appdir}/htdocs/setup
501
502 %files doc
503 %defattr(644,root,root,755)
504 %doc docs/*
505 %{_examplesdir}/%{name}-%{version}
506
507 %files mail-queue
508 %defattr(644,root,root,755)
509 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
510
511 %files mail-download
512 %defattr(644,root,root,755)
513 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
514
515 %files reminder
516 %defattr(644,root,root,755)
517 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
518
519 %files monitor
520 %defattr(644,root,root,755)
521 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
522
523 %files sphinx
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
This page took 0.11462 seconds and 4 git commands to generate.