2 # - discard bundled packages (from INSTALL):
3 # - JpGraph 1.5.3 (last GPL version)
4 # - dTree 2.0.5 (http://www.destroydrop.com/javascript/tree/)
5 # - dynCalendar.js (http://www.phpguru.org/dyncalendar.html)
6 # - overLIB 3.5.1 (http://www.bosrup.com/web/overlib/)
7 # - A few other small javascript libraries
10 %bcond_with qmail # build the router-qmail subpackage
12 #define _snap 20060921
13 %define _svn 20070306.3264
17 %include /usr/lib/rpm/macros.php
18 Summary: Eventum Issue / Bug tracking system
19 Summary(pl.UTF-8): Eventum - system śledzenia spraw/błędów
22 Release: %{?_rc:%{_rc}.}%{_rel}%{?_snap:.%{_snap}}%{?_svn:.%{_svn}}
24 Group: Applications/WWW
25 #Source0: http://downloads.mysql.com/snapshots/eventum/%{name}-nightly-%{_snap}.tar.gz
26 Source0: %{name}-%{_svn}.tar.bz2
27 # Source0-md5: 1bdbfea9bb75dcdd542356fb29f0dfce
28 Source1: %{name}-apache.conf
29 Source2: %{name}-mail-queue.cron
30 Source3: %{name}-mail-download.cron
31 Source4: %{name}-reminder.cron
32 Source5: %{name}-monitor.cron
33 Source6: %{name}-cvs.php
34 Source7: %{name}-irc.php
35 Source8: %{name}-irc.init
36 Source9: %{name}-irc.sysconfig
37 Source10: %{name}-router-qmail.sh
38 Source12: %{name}-upgrade.sh
39 Source13: %{name}-router-postfix.sh
40 Source14: %{name}.logrotate
41 Source15: %{name}-lighttpd.conf
42 Patch0: %{name}-lf.patch
43 Patch1: %{name}-timetracking-advanced-logic.patch
44 Patch2: %{name}-email-notify-display.patch
45 Patch3: %{name}-backtraces.patch
46 Patch4: %{name}-errorhandler.patch
47 Patch5: %{name}-utf_on_charts.patch
48 # packaging patches that probably never go upstream
49 Patch100: %{name}-paths.patch
50 Patch101: %{name}-cvs-config.patch
51 Patch102: %{name}-irc-config.patch
52 Patch103: %{name}-PEAR.patch
53 Patch104: %{name}-httpclient-clientside.patch
54 Patch105: %{name}-bot-reconnect.patch
55 Patch106: %{name}-mem-limits.patch
56 Patch107: %{name}-gettext.patch
58 Patch200: %{name}-fixed-nav.patch
59 URL: http://dev.mysql.com/downloads/other/eventum/
60 BuildRequires: gettext-devel
61 BuildRequires: rpm-php-pearprov >= 4.0.2-98
62 BuildRequires: rpmbuild(macros) >= 1.268
63 BuildRequires: sed >= 4.0
64 Requires(triggerpostun): /usr/bin/php
65 Requires(triggerpostun): sed >= 4.0
66 Requires: %{name}-base = %{version}-%{release}
67 Requires: Smarty >= 2.6.10-4
68 Requires: apache(mod_dir)
71 Requires: php(mbstring)
74 Requires: php(session)
76 Requires: php-pear-Date
77 Requires: php-pear-HTTP_Request
78 Requires: php-pear-Mail
79 Requires: php-pear-Mail_Mime
80 Requires: php-pear-Math_Stats
81 Requires: php-pear-Net_DIME
82 Requires: php-pear-Net_SMTP
83 Requires: php-pear-Net_Socket
84 Requires: php-pear-Net_URL
85 Requires: php-pear-Net_UserAgent_Detect
86 Requires: php-pear-PEAR-core
87 Requires: php-pear-Text_Diff
88 Requires: php-pear-XML_RPC
89 Requires: smarty-gettext
91 Requires: webserver(access)
92 Requires: webserver(alias)
93 Requires: webserver(php) >= 4.2.0
95 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 %define _noautoreq 'pear(/etc/webapps/.*)' 'pear(jpgraph_dir.php)' 'pear(.*Smarty.class.php)' 'pear(Benchmark/.*)'
99 %define _libdir %{_prefix}/lib/%{name}
100 %define _appdir %{_datadir}/%{name}
101 %define _smartyplugindir %{_appdir}/include/smarty
102 %define _smartydir /usr/share/php/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
112 and bugs. Eventum is used by the MySQL AB Technical Support team, and
113 has allowed us to dramatically improve our response times.
115 %description -l pl.UTF-8
116 Eventum to przyjazny dla użytkownika system śledzenia spraw, który
117 może być używany przez dział obsługi do śledzenia przychodzących żądań
118 obsługi technicznej albo przez zespół tworzący oprogramowanie do
119 szybkiej organizacji zadań i błędów. Eventum jest używany przez zespół
120 Technical Support MySQL AB i umożliwił im znacząco poprawić czasy
124 Summary: Eventum base package
125 Summary(pl.UTF-8): Podstawowy pakiet Eventum
126 Group: Applications/WWW
127 Requires(postun): /usr/sbin/groupdel
128 Requires(postun): /usr/sbin/userdel
129 Requires(pre): /bin/id
130 Requires(pre): /usr/bin/getgid
131 Requires(pre): /usr/sbin/groupadd
132 Requires(pre): /usr/sbin/useradd
133 Provides: group(eventum)
134 Provides: user(eventum)
137 This package contains base directory structure for Eventum.
139 %description base -l pl.UTF-8
140 Ten pakiet zawiera podstawową strukturę katalogów dla Eventum.
143 Summary: Eventum setup package
144 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Eventum
145 Group: Applications/WWW
146 Requires: %{name} = %{version}-%{release}
149 Install this package to configure initial Eventum installation. You
150 should uninstall this package when you're done, as it considered
151 insecure to keep the setup files in place.
153 %description setup -l pl.UTF-8
154 Ten pakiet należy zainstalować w celu wstępnej konfiguracji Eventum po
155 pierwszej instalacji. Potem należy go odinstalować, jako że
156 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
159 Summary: Eventum mail queue process
160 Summary(pl.UTF-8): Przetwarzanie kolejki poczty Eventum
161 Group: Applications/WWW
162 Requires: %{name} = %{version}-%{release}
165 %description mail-queue
166 Beginning with the first release of Eventum, emails are not directly
167 sent out from the various scripts, but rather added to a mail queue
168 table that is processed by a cron job. If an email cannot be sent, it
169 will be marked as such in the mail queue log, and the cron job script
170 will re-try to send it again the next time it runs.
172 This package contains the cron job.
174 %description mail-queue -l pl.UTF-8
175 Od pierwszego wydania Eventum poczta nie jest wysyłana bezpośrednio z
176 różnych skryptów, lecz dodawana do kolejki przetwarzanej z crona.
177 Jeśli poczta nie może być wysłana, będzie odpowiednio oznaczona w logu
178 kolejki poczty, a skrypt z crona będzie próbował wysłać ją ponownie
181 Ten pakiet zawiera zadanie dla crona.
183 %package mail-download
184 Summary: Eventum email download
185 Summary(pl.UTF-8): Ściąganie poczty Eventum
186 Group: Applications/WWW
187 Requires: %{name} = %{version}-%{release}
190 %description mail-download
191 In order for Eventum's email integration feature to work, you need to
192 setup a cron job to run the script every so often.
194 This package contains the cron job.
196 %description mail-download -l pl.UTF-8
197 Aby integracja poczty elektronicznej w Eventum działała, trzeba
198 ustawić zadanie crona, aby uruchamiał odpowiedni skrypt wystarczająco
201 Ten pakiet zawiera zadanie dla crona.
204 Summary: Eventum Reminder System
205 Summary(pl.UTF-8): System przypominania dla Eventum
206 Group: Applications/WWW
207 Requires: %{name} = %{version}-%{release}
210 %description reminder
211 The reminder system was designed with the objective as serving as a
212 safe net for issues that need attention. Depending on what
213 configuration you create, you may have several reminders (or alerts)
214 be sent out whenever an issue needs attention, for whatever parameter
215 you may deem necessary.
217 This package contains the cron job.
219 %description reminder -l pl.UTF-8
220 System przypominania został zaprojektowany tak, aby służył jako
221 bezpieczna sieć dla spraw wymagających uwagi. W zależności od
222 konfiguracji można ustawić różne przypominajki (lub alarmy) wysyłane
223 przy każdej sprawie wymagającej uwagi lub przy parametrze, który można
226 Ten pakiet zawiera zadanie dla crona.
229 Summary: Eventum Heartbeat Monitor
230 Summary(pl.UTF-8): Monitor życia dla Eventum
231 Group: Applications/WWW
232 Requires: %{name} = %{version}-%{release}
237 The heartbeat monitor is a feature designed for the administrator that
238 wants to be alerted whenever a common problem in Eventum is detected,
239 like the database server not being available anymore, or maybe when
240 the recommended permissions for certain configuration files are
243 Please note that before running the heartbeat monitor, you may need to
244 customize some of the checks to be appropriate for your own system,
245 particularly the permission and file checks on
246 Monitor::checkConfiguration().
248 This package contains the cron job.
250 %description monitor -l pl.UTF-8
251 Monitor życia to funkcjonalność zaprojektowana dla administratora
252 chcącego być alarmowanym przy każdym wykryciu popularnego problemu z
253 Eventum, jak nie działanie serwera bazy danych albo zmiana uprawnień
254 do plików konfiguracyjnych.
256 Należy zauważyć, że przed uruchomieniem tego monitora może być
257 konieczne dostosowanie niektórych testów do systemu, w szczególności
258 testów uprawnień i plików w Monitor::checkConfiguration().
260 Ten pakiet zawiera zadanie dla crona.
262 %package route-drafts
263 Summary: Eventum Draft Routing
264 Summary(pl.UTF-8): Przekazywanie szkiców dla Eventum
265 Group: Applications/WWW
266 Requires: %{name} = %{version}-%{release}
267 Requires: eventum(router)
269 %description route-drafts
270 The draft routing feature is used to automatically associate a thread
271 of drafts into an Eventum issue. By setting up qmail (or even Postfix)
272 to deliver emails sent to a specific address (usually
273 draft-<number>@<domain>) to the above script, users are able to send
274 drafts written in their mail client to be stored in Eventum. These
275 drafts will NOT broadcasted to the notification list.
277 %description route-drafts -l pl.UTF-8
278 Przekazywanie szkiców służy do automatycznego wiązania wątku szkiców z
279 problemem w Eventum. Ustawiając qmaila (czy nawet Postfiksa), aby
280 dostarczał pocztę wysłaną na podany adres (zwykle
281 draft-<liczba>@<domena>) do tego skryptu umożliwia się użytkownikom
282 wysyłanie szkiców napisanych w ich kliencie pocztowym do zapisania w
283 Eventum. Szkice te NIE będą wysyłane na listę powiadomień.
285 %package route-emails
286 Summary: Eventum Email Routing
287 Summary(pl.UTF-8): Przekazywanie poczty dla Eventum
288 Group: Applications/WWW
289 Requires: %{name} = %{version}-%{release}
290 Requires: eventum(router)
292 %description route-emails
293 The email routing feature is used to automatically associate a thread
294 of emails into an Eventum issue. By setting up qmail (or even postfix)
295 to deliver emails sent to a specific address (usually
296 issue-<number>@<domain>) to the above script, users are able to use
297 their email clients to reply to emails coming from Eventum, and those
298 replies will be automatically associated with the issue and
299 broadcasted to the entire notification list.
301 %description route-emails -l pl.UTF-8
302 Funkcjonalność przekazywania poczty służy do automatycznego wiązania
303 wątku listów ze sprawą w Eventum. Po ustawieniu qmaila (czy nawet
304 postfiksa), aby dostarczał listy wysyłane na pewien adres (zwykle
305 issue-<numer>@<domena>) na powyższy skrypt, użytkownicy będą mogli
306 używać klientów pocztowych do odpowiadania na listy przychodzące z
307 Eventum, a odpowiedzi te będą automatycznie wiązane ze sprawą i
308 rozprowadzane do całej listy ogłoszeniowej.
311 Summary: Eventum Note Routing
312 Summary(pl.UTF-8): Przekazywanie notatek dla Eventum
313 Group: Applications/WWW
314 Requires: %{name} = %{version}-%{release}
315 Requires: eventum(router)
317 %description route-notes
318 The note routing feature is used to automatically associate a thread
319 of notes into an Eventum issue. By setting up qmail (or even postfix)
320 to deliver emails sent to a specific address (usually
321 note-<number>@<domain>) to the above script, users are able to use
322 their email clients to reply to internal notes coming from Eventum,
323 and those replies will be automatically associated with the issue and
324 broadcasted to the notification list staff members.
326 %description route-notes -l pl.UTF-8
327 Funkcjonalność przekazywania notatek służy do automatycznego wiązania
328 wątku notatek ze sprawą w Eventum. Po ustawieniu qmaila (czy nawet
329 postfiksa), aby dostarczał listy wysyłane na pewien adres (zwykle
330 note-<numer>@<domena>) na powyższy skrypt, użytkownicy będą mogli
331 używać klientów pocztowych do odpowiadania na wewnętrzne notatki
332 pochodzące od Eventu, a odpowiedzi te będą automatycznie wiązane ze
333 sprawą i rozprowadzane do członków personelu listy ogłoszeniowej.
335 %package router-qmail
336 Summary: Eventum Mail Routing - qmail
337 Summary(pl.UTF-8): Przekazywanie poczty Eventum - qmail
338 Group: Applications/Mail
339 # loose dep is intentional. qmail subpackage isn't built on PLD
340 # builders and there really nothing changes.
341 Requires: %{name} >= %{version}-%{release}
342 Requires: qmail >= 1.03
343 Provides: eventum(router)
344 Obsoletes: eventum(router)
346 %description router-qmail
347 This package provides way of routing notes and emails back to Eventum
350 %description router-qmail -l pl.UTF-8
351 Ten pakiet udostępnia metodę przekazywania notatek i listów do Eventum
354 %package router-postfix
355 Summary: Eventum Mail Routing - Postfix
356 Summary(pl.UTF-8): Przekazywanie poczty Eventum - Postfix
357 Group: Applications/Mail
358 Requires: %{name} = %{version}-%{release}
360 Provides: eventum(router)
361 Obsoletes: eventum(router)
363 %description router-postfix
364 This package provides way of routing notes and emails back to Eventum
367 The Postfix configuration instructions you can find from
368 <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>.
370 %description router-postfix -l pl.UTF-8
371 Ten pakiet udostępnia metodę przekazywania notatek i listów do Eventum
374 Opis konfiguracji Postfiksa można znaleźć pod adresem
375 <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>.
378 Summary: Eventum IRC Notification Bot
379 Summary(pl.UTF-8): IRC-owy bot powiadamiający dla Eventum
380 Group: Applications/WWW
381 Requires(post,preun): /sbin/chkconfig
382 Requires(triggerpostun): sed >= 4.0
383 Requires: %{name} = %{version}-%{release}
384 Requires: php(sockets)
385 Requires: php-pear-Net_SmartIRC
386 Requires: rc-scripts >= 0.4.0.18
389 The IRC notification bot is a nice feature for remote teams that want
390 to handle issues and want to have a quick and easy way to get simple
391 notifications. Right now the bot notifies of the following actions:
394 - Issues that got their assignment list changed
396 NOTE: You will need to manually edit the bot.php script to set your
397 appropriate preferences, like IRC server and channel that the bot
400 %description irc -l pl.UTF-8
401 IRC-owy bot powiadamiający to miła funkcjonalność dla zdalnych
402 zespołów chcących obsługiwać sprawy i mieć szybki i łatwy sposób na
403 uzyskiwanie prostych powiadomień. Aktualnie bot powiadamia o
404 następujących zdarzeniach:
406 - zablokowanych listach
407 - sprawach, dla których zmieniła się lista powiązań
409 UWAGA: w celu wprowadzenia własnych ustawień, takich jak serwer IRC i
410 kanał używany przez bota, trzeba ręcznie zmodyfikować skrypt bot.php .
413 Summary: Eventum command-line interface
414 Summary(pl.UTF-8): Interfejs linii poleceń dla Eventum
415 Group: Applications/WWW
416 Requires: %{name}-base = %{version}-%{release}
418 Requires: php-common >= 3:4.1.0
419 Requires: php-pear-XML_RPC
422 The Eventum command-line interface allows you to access most of the
423 features of the web interface straight from your command shell.
425 %description cli -l pl.UTF-8
426 Interfejs linii poleceń Eventum pozwala na dostęp do większości
427 funkcji interfejsu WWW prosto z linii poleceń powłoki.
430 Summary: Eventum SCM integration
431 Summary(pl.UTF-8): Integracja SCM dla Eventum
432 Group: Applications/WWW
433 Requires: %{name}-base = %{version}-%{release}
436 Requires: php-common >= 3:4.1.0
439 This feature allows your software development teams to integrate your
440 Source Control Management system with your Issue Tracking System.
442 The integration is implemented in such a way that it will be forward
443 compatible with pretty much any SCM system, such as CVS.
446 </eventum/help.php?topic=scm_integration_installation>.
448 %description scm -l pl.UTF-8
449 Ten pakiet pozwala zespołom programistów na integrację systemu
450 zarządzania źródłami (SCM - Source Control Management) z systemem
453 Integracja jest zaimplementowana tak, aby być kompatybilna w przód z
454 prawie każdym systemem SCM, jak np. CVS.
456 Szczegóły na temat instalacji można przeczytać pod
457 </eventum/help.php?topic=scm_integration_installation>.
460 %setup -q %{?_snap:-n %{name}-%{_snap}}%{?_svn:-n %{name}}
462 find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
465 rm -r misc/upgrade/*v1.[123]* # too old to support in PLD Linux
466 rm misc/upgrade/flush_compiled_templates.php
467 rm -r misc/upgrade/*/upgrade_config.php # not needed in PLD Linux
468 rm -r misc/upgrade/*/index.html # not needed in PLD Linux
470 rm -r include/php-gettext
471 # sample, not used in eventum
472 rm rpc/xmlrpc_client.php
495 cat <<'EOF'> mysql-permissions.sql
496 # use this schema if you want to grant permissions manually instead of using setup
497 # this schema is extracted from setup/index.php.
498 GRANT SELECT, UPDATE, DELETE, INSERT, ALTER, DROP, CREATE, INDEX ON eventum.* TO 'eventum'@'localhost' IDENTIFIED BY 'password';
501 mv misc/localization/de{_DE,}
502 mv misc/localization/es{_ES,}
503 mv misc/localization/fi{_FI,}
504 mv misc/localization/fr{_FR,}
505 mv misc/localization/it{_IT,}
506 mv misc/localization/nl{_NL,}
507 mv misc/localization/ru{_RU,}
508 mv misc/localization/sv{_SE,}
509 mkdir -p misc/localization/pl/LC_MESSAGES
511 # oops, the file got truncated - quick fix
512 cp misc/localization/eventum.po misc/localization/de/LC_MESSAGES/eventum.po
513 cp misc/localization/eventum.po misc/localization/es/LC_MESSAGES/eventum.po
514 cp misc/localization/eventum.po misc/localization/fi/LC_MESSAGES/eventum.po
515 cp misc/localization/eventum.po misc/localization/fr/LC_MESSAGES/eventum.po
516 cp misc/localization/eventum.po misc/localization/nl/LC_MESSAGES/eventum.po
517 cp misc/localization/eventum.po misc/localization/ru/LC_MESSAGES/eventum.po
518 cp misc/localization/eventum.po misc/localization/en_US/LC_MESSAGES/eventum.po
520 sed -e '1s,#!.*/bin/php -q,#!%{_bindir}/php,' misc/cli/eventum > %{name}-cli
521 mv misc/cli/eventumrc_example eventumrc
522 sed -i -e '1i#!%{_bindir}/php' misc/*.php
525 # remove backups from patching as we use globs to package files to buildroot
526 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
530 for a in */LC_MESSAGES; do
531 msgfmt -o $a/eventum.mo $a/eventum.po
535 rm -rf $RPM_BUILD_ROOT
537 $RPM_BUILD_ROOT{%{_webappdir},%{_sysconfdir},%{_bindir},%{_sbindir},%{_libdir}} \
538 $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,sysconfig} \
539 $RPM_BUILD_ROOT/var/{run,cache,lib}/%{name} \
540 $RPM_BUILD_ROOT/var/log/{archiv/,}%{name} \
541 $RPM_BUILD_ROOT/var/lib/%{name}/routed_{emails,drafts,notes} \
542 $RPM_BUILD_ROOT%{_appdir}/{include,htdocs/misc,upgrade} \
544 cp -a *.php css customer images js manage reports rpc setup $RPM_BUILD_ROOT%{_appdir}/htdocs
545 cp -a misc/*.html $RPM_BUILD_ROOT%{_appdir}/htdocs/misc
546 cp -a misc/*.php $RPM_BUILD_ROOT%{_appdir}
547 cp -a templates $RPM_BUILD_ROOT%{_appdir}
548 cp -a include/{customer,custom_field,jpgraph,workflow} $RPM_BUILD_ROOT%{_appdir}/include
549 cp -a include/*.php $RPM_BUILD_ROOT%{_appdir}/include
550 cp -a logs/* $RPM_BUILD_ROOT/var/log/%{name}
551 cp -a misc/upgrade $RPM_BUILD_ROOT%{_appdir}
553 cp -a favicon.ico $RPM_BUILD_ROOT%{_appdir}/htdocs/favicon.ico
554 install %{SOURCE12} $RPM_BUILD_ROOT%{_appdir}/upgrade/upgrade.sh
557 install -d $RPM_BUILD_ROOT%{_appdir}/cli
558 cp -a misc/cli/include/class.{misc,command_line}.php $RPM_BUILD_ROOT%{_appdir}/cli
559 cp -a misc/cli/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/cli.php
560 install %{name}-cli $RPM_BUILD_ROOT%{_bindir}/%{name}
561 install misc/irc/bot.php $RPM_BUILD_ROOT%{_sbindir}/%{name}-bot
564 install misc/scm/process_cvs_commits.php $RPM_BUILD_ROOT%{_libdir}/process_cvs_commits
565 install misc/scm/process_svn_commits.php $RPM_BUILD_ROOT%{_libdir}/process_svn_commits
566 ln -s process_cvs_commits $RPM_BUILD_ROOT%{_libdir}/scm
567 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/scm.php
571 $private_key = "DEFAULTPRIVATEKEY";' > $RPM_BUILD_ROOT%{_webappdir}/private_key.php
572 touch $RPM_BUILD_ROOT%{_webappdir}/htpasswd
574 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
575 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
576 cp -a %{SOURCE15} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf
577 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
578 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
579 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder
580 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor
581 cp -a %{SOURCE7} $RPM_BUILD_ROOT%{_webappdir}/irc_config.php
582 cp -a %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/eventum-irc
583 cp -a %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/eventum-irc
586 %{__sed} -i -e "/define('APP_VERSION'/ {
587 idefine('APP_VERSION', '%{version}%{?_snap:-%{_snap}}%{?_rc:-%{_rc}}%{?_svn:-%{_svn}}');
590 }" $RPM_BUILD_ROOT%{_appdir}/htdocs/init.php
593 > $RPM_BUILD_ROOT%{_webappdir}/setup.php
594 > $RPM_BUILD_ROOT%{_webappdir}/config.php
596 install -d $RPM_BUILD_ROOT%{_smartyplugindir}
597 # These plugins are not in Smarty package (Smarty-2.6.2-3)
599 include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,textarea_size}}.php \
600 include/Smarty/plugins/modifier.highlight_quoted.php \
601 $RPM_BUILD_ROOT%{_smartyplugindir}
605 d=$RPM_BUILD_ROOT/var/lib/%{name}
606 echo 'root' > $d/.qmail
607 echo 'root' > $d/.qmail-default
608 echo '| %{_libdir}/router-qmail drafts' > $d/.qmail-draft-default
609 echo '| %{_libdir}/router-qmail emails 1' > $d/.qmail-issue-default
610 echo '| %{_libdir}/router-qmail notes' > $d/.qmail-note-default
611 install %{SOURCE10} $RPM_BUILD_ROOT%{_libdir}/router-qmail
614 install %{SOURCE13} $RPM_BUILD_ROOT%{_libdir}/router-postfix
616 install -D %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
619 for a in */LC_MESSAGES; do
620 install -d $RPM_BUILD_ROOT%{_datadir}/locale/$a
621 cp -a $a/%{name}.mo $RPM_BUILD_ROOT%{_datadir}/locale/$a
628 rm -rf $RPM_BUILD_ROOT
631 %addusertogroup http %{name}
634 # check if the package is configured.
635 if grep -q "Header('Location: setup/')" %{_webappdir}/config.php; then
636 if [ -f %{_appdir}/htdocs/setup/index.php ]; then
637 %banner %{name} -e <<EOF
639 You haven't yet configured Eventum!
640 Please open in browser <http://localhost/eventum/>
641 If you need access from elsewhere, you need to edit
642 %{_webappdir}/apache.conf and restart apache.
644 IMPORTANT: When You have configured Eventum, please uninstall the
645 setup package, so that %{name}-setup is able to secure your Eventum
651 %banner %{name} -e <<EOF
653 You haven't yet configured Eventum!
655 To setup eventum, please install %{name}-setup and open in browser
656 <http://localhost/eventum/>.
657 If you need access from elsewhere, you need to edit
658 %{_webappdir}/*.conf depending on webserver and restart the webserver.
660 IMPORTANT: When You have configured Eventum, please uninstall the
661 setup package, so that %{name}-setup is able to secure your Eventum
668 elif grep -q 'DEFAULTPRIVATEKEY' %{_webappdir}/private_key.php; then
669 %banner %{name} -e <<EOF
671 You have default private key installed!
673 Install %{name}-setup and open up http://yourserver/eventum/setup/
674 -- that will help you setup initial config.
676 when have configured Eventum, please uninstall the setup package,
677 so that %{name}-setup is able to secure your Eventum installation.
680 elif [ -d %{_appdir}/setup ]; then
681 %banner %{name} -e <<EOF
683 If you have have configured Eventum, please uninstall the setup package,
684 so that %{name}-setup is able to secure your Eventum installation.
689 # nuke Smarty templates cache after upgrade
690 rm -f /var/cache/eventum/*.php
693 if [ "$1" = "0" ]; then
695 rm -f /var/cache/eventum/*.php 2>/dev/null || :
699 %groupadd -P %{name}-base -g 146 %{name}
700 %useradd -P %{name}-base -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
703 if [ "$1" = "0" ]; then
709 CF=/etc/qmail/control/virtualdomains
710 if ! grep -q ':%{name}\b' $CF 2>/dev/null; then
711 FQDN=$(awk -F'"' '/define/ && $2 ~ /APP_HOSTNAME/ {print $4}' %{_webappdir}/config.php 2>/dev/null)
712 [ "$FQDN" ] || FQDN=$(hostname -f 2>/dev/null || echo localhost)
714 echo "#${FQDN}:%{name}" >> $CF
716 %banner %{name}-qmail -e <<EOF
718 Added "#${FQDN}:%{name}" to $CF,
719 Please verify that it is correct and restart qmail:
720 # service qmail reload
722 Consult qmail-send(8) for more information on virtualdomains.
728 if [ "$1" = "0" ]; then
729 sed -i -e '/:%{name}\b/d' /etc/qmail/control/virtualdomains
733 chmod 660 %{_webappdir}/{config,private_key}.php
734 chown root:eventum %{_webappdir}/{config,private_key}.php
737 if [ "$1" = "0" ]; then
738 chmod 640 %{_webappdir}/{config,private_key}.php
739 chown root:eventum %{_webappdir}/{config,private_key}.php
743 /sbin/chkconfig --add eventum-irc
744 %service eventum-irc restart "Eventum IRC Bot"
747 if [ "$1" = 0 ]; then
748 %service eventum-irc stop
749 /sbin/chkconfig --del eventum-irc
752 %triggerin -- apache1 < 1.3.37-3, apache1-base
753 %webapp_register apache %{_webapp}
755 %triggerun -- apache1 < 1.3.37-3, apache1-base
756 %webapp_unregister apache %{_webapp}
758 %triggerin -- apache < 2.2.0, apache-base
759 %webapp_register httpd %{_webapp}
761 %triggerun -- apache < 2.2.0, apache-base
762 %webapp_unregister httpd %{_webapp}
764 %triggerin -- lighttpd
765 %webapp_register lighttpd %{_webapp}
767 %triggerun -- lighttpd
768 %webapp_unregister lighttpd %{_webapp}
771 # only one upgrade trigger is called if you're upgrading over two
772 # versions, say 1.5 to 1.5.3, only 1.5.3 trigger is called.
773 # use common trigger (the highest version and rpmvercmp from poldek?)
774 %triggerpostun -- eventum < 1.5.1-0.257
775 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5_to_v1.5.1 <<EOF
776 database_changes.php Perform database changes
779 %triggerpostun -- eventum < 1.5.2-0.289
780 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.1_to_v1.5.2 <<EOF
781 database_changes.php Perform database changes
782 set_priority_ranks.php Fix the ranking of priority values
785 %triggerpostun -- eventum < 1.5.3-0.291
786 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.2_to_v1.5.3 <<EOF
787 database_changes.php Perform database changes
790 %triggerpostun -- eventum < 1.5.4-1.12
791 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.3_to_v1.5.4 <<EOF
792 database_changes.php Perform database changes
795 %triggerpostun -- eventum < 1.6.0-RC2.6
796 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.5_to_v1.6.0 <<EOF
797 database_changes.php Perform database changes
798 upgrade_saved_searches.php Upgrade existing custom filters (saved searches)
801 %triggerpostun -- eventum < 1.6.1-0.2
802 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.0_to_v1.6.1 <<EOF
803 database_changes.php Perform database changes
806 %triggerpostun -- eventum < 1.7.1-4.132.20061119.3143
807 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.7.1_to_v2.0 <<EOF
808 database_changes.php Perform database changes
811 %triggerpostun irc -- eventum-irc < 1.6.1-3.14
813 s,\$irc_host,$irc_server_hostname,
814 s,\$irc_port,$irc_server_port,
815 s,\$irc_nick,$nickname,
816 s,\$irc_realname,$realname,
817 s,\$irc_username,$username,
818 s,\$irc_password,$password,
819 ' /etc/eventum/irc.php
821 %triggerpostun -- eventum < 1.7.0-2.0.48
822 # migrate from apache-config macros
823 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
824 if [ -d /etc/apache/webapps.d ]; then
825 cp -f %{_webapps}/%{_webapp}/apache.conf{,.rpmnew}
826 cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/apache.conf
829 if [ -d /etc/httpd/webapps.d ]; then
830 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
831 cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
835 if [ -L /etc/apache/conf.d/99_%{_webapp}.conf ]; then
836 /usr/sbin/webapp register apache %{_webapp}
837 rm -f /etc/apache/conf.d/99_%{_webapp}.conf
838 %service -q apache reload
840 if [ -L /etc/httpd/httpd.conf/99_%{_webapp}.conf ]; then
841 /usr/sbin/webapp register httpd %{_webapp}
842 rm -f /etc/httpd/httpd.conf/99_%{_webapp}.conf
843 %service -q httpd reload
846 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.1_to_v1.7.0 <<EOF
847 database_changes.php Perform database changes
848 set_root_message_ids.php Set iss_root_message_id
852 for i in apache.conf config.php private_key.php setup.php; do
853 if [ -f /etc/eventum/$i.rpmsave ]; then
854 mv -f %{_webappdir}/$i{,.rpmnew}
855 mv -f /etc/eventum/$i.rpmsave %{_webappdir}/$i
859 %triggerpostun cli -- %{name}-cli < 1.7.0-3.4
860 if [ -f %{_webappdir}/cli.php.rpmsave ]; then
861 mv -f %{_sysconfdir}/cli.php{,.rpmnew}
862 mv -f %{_webappdir}/cli.php.rpmsave %{_sysconfdir}/cli.php
865 %triggerpostun scm -- %{name}-scm < 1.7.1-2.70.20060724
866 if [ -f %{_sysconfdir}/cvs.php.rpmsave ]; then
867 mv -f %{_sysconfdir}/scm.php{,.rpmnew}
868 mv -f %{_sysconfdir}/cvs.php.rpmsave %{_sysconfdir}/scm.php
870 ln -sf process_cvs_commits $RPM_BUILD_ROOT%{_libdir}/scm
872 %triggerpostun -- %{name} < 1.7.1-5.165
875 ' %{_webappdir}/config.php
877 %triggerpostun irc -- %{name}-irc < 1.7.1-5.181
878 # change from 1.7.0-3.4
879 if [ -f %{_webappdir}/irc.php.rpmsave ]; then
880 mv -f %{_webappdir}/irc_config.php{,.rpmnew}
881 mv -f %{_webappdir}/irc.php.rpmsave %{_webappdir}/irc_config.php
884 # change from 1.7.1-5.181
885 if [ -f %{_sysconfdir}/irc.php.rpmsave ]; then
886 mv -f %{_webappdir}/irc_config.php{,.rpmnew}
887 mv -f %{_sysconfdir}/irc.php.rpmsave %{_webappdir}/irc_config.php
890 %files -f %{name}.lang
891 %defattr(644,root,root,755)
892 %doc ChangeLog FAQ INSTALL README UPGRADE CONTRIB
893 %doc docs/* setup/schema.sql mysql-permissions.sql
894 %attr(751,root,root) %dir %{_webappdir}
895 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
896 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
897 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/lighttpd.conf
898 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/config.php
899 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/private_key.php
900 %attr(660,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/setup.php
901 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/htpasswd
903 %dir %attr(731,root,eventum) /var/log/%{name}
904 %attr(620,root,eventum) %ghost /var/log/%{name}/*
905 %dir %attr(750,root,root) /var/log/archiv/%{name}
906 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
908 %dir %{_appdir}/htdocs
909 %{_appdir}/htdocs/*.php
910 %{_appdir}/htdocs/*.ico
911 %{_appdir}/htdocs/css
912 %{_appdir}/htdocs/customer
913 %{_appdir}/htdocs/images
915 %{_appdir}/htdocs/manage
916 %{_appdir}/htdocs/reports
917 %{_appdir}/htdocs/rpc
918 %{_appdir}/htdocs/misc
920 %dir %{_appdir}/upgrade
921 %attr(755,root,root) %{_appdir}/upgrade/upgrade.sh
922 %{_appdir}/upgrade/[!u]*
925 %dir %{_appdir}/include
926 %{_appdir}/include/customer
927 %{_appdir}/include/custom_field
928 %{_appdir}/include/jpgraph
929 %{_appdir}/include/workflow
930 %{_appdir}/include/class.[!m]*.php
931 %{_appdir}/include/class.mail.php
932 %{_appdir}/include/class.mail_queue.php
933 %{_appdir}/include/class.mime_helper.php
934 %{_appdir}/include/class.misc.php
935 %{_appdir}/include/db_access.php
937 %dir %attr(730,root,eventum) /var/run/%{name}
938 %dir %attr(730,root,eventum) /var/cache/%{name}
941 %defattr(644,root,root,755)
942 %attr(751,root,root) %dir %{_sysconfdir}
945 # qmail will ignore user, if it's home directory is not owned
946 %attr(750,eventum,eventum) %dir /var/lib/%{name}
948 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_emails
949 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_drafts
950 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_notes
953 %defattr(644,root,root,755)
954 %{_appdir}/htdocs/setup
957 %defattr(644,root,root,755)
958 %attr(755,root,root) %{_appdir}/process_mail_queue.php
959 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
962 %defattr(644,root,root,755)
963 %attr(755,root,root) %{_appdir}/download_emails.php
964 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
967 %defattr(644,root,root,755)
968 %attr(755,root,root) %{_appdir}/check_reminders.php
969 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
972 %defattr(644,root,root,755)
973 %{_appdir}/include/class.monitor.php
974 %attr(755,root,root) %{_appdir}/monitor.php
975 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
978 %defattr(644,root,root,755)
979 %attr(755,root,root) %{_appdir}/route_drafts.php
982 %defattr(644,root,root,755)
983 %attr(755,root,root) %{_appdir}/route_emails.php
986 %defattr(644,root,root,755)
987 %attr(755,root,root) %{_appdir}/route_notes.php
991 %defattr(644,root,root,755)
992 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/.qmail*
993 %attr(755,root,root) %{_libdir}/router-qmail
996 %files router-postfix
997 %defattr(644,root,root,755)
998 %attr(755,root,root) %{_libdir}/router-postfix
1001 %defattr(644,root,root,755)
1002 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/irc_config.php
1003 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/eventum-irc
1004 %attr(755,root,root) %{_sbindir}/%{name}-bot
1005 %attr(754,root,root) /etc/rc.d/init.d/%{name}-irc
1008 %defattr(644,root,root,755)
1010 %config %verify(not md5 mtime size) %{_sysconfdir}/cli.php
1011 %attr(755,root,root) %{_bindir}/%{name}
1015 %defattr(644,root,root,755)
1016 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scm.php
1017 %attr(755,root,root) %{_libdir}/process_cvs_commits
1018 %attr(755,root,root) %{_libdir}/process_svn_commits
1020 %ghost %{_libdir}/scm