]> git.pld-linux.org Git - packages/eventum.git/blob - eventum.spec
- advanced timetracking patch
[packages/eventum.git] / eventum.spec
1 # TODO
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
8 # - 64bit platforms beware? http://bugs.php.net/bug.php?id=30215 (it's actually Smarty related problem)
9 #
10 # Conditional build:
11 %bcond_with     qmail   # build the router-qmail subpackage
12 %bcond_with     order_patch     # with custom issue order patch
13
14 #define _snap   20060330
15 #define _rc             RC3
16 %define _rel    2.19
17
18 %include        /usr/lib/rpm/macros.php
19 Summary:        Eventum Issue / Bug tracking system
20 Summary(pl):    Eventum - system ¶ledzenia spraw/b³êdów
21 Name:           eventum
22 Version:        1.7.1
23 Release:        %{?_snap:0.%{_snap}.}%{?_rc:%{_rc}.}%{_rel}
24 License:        GPL
25 Group:          Applications/WWW
26 #Source0:       http://downloads.mysql.com/snapshots/eventum/%{name}-nightly-%{_snap}.tar.gz
27 Source0:        http://mysql.dataphone.se/Downloads/eventum/%{name}-%{version}.tar.gz
28 # Source0-md5:  e1845de39b4d9bd30ddec9c26031a7d5
29 Source1:        %{name}-apache.conf
30 Source2:        %{name}-mail-queue.cron
31 Source3:        %{name}-mail-download.cron
32 Source4:        %{name}-reminder.cron
33 Source5:        %{name}-monitor.cron
34 Source6:        %{name}-cvs.php
35 Source7:        %{name}-irc.php
36 Source8:        %{name}-irc.init
37 Source9:        %{name}-irc.sysconfig
38 Source10:       %{name}-config.php
39 Source11:       %{name}-router-qmail.sh
40 Source12:       %{name}-config-setup.php
41 Source13:       %{name}-upgrade.sh
42 Source14:       %{name}-router-postfix.sh
43 Patch0:         %{name}-lf.patch
44 Patch1:         %{name}-perms.patch
45 Patch2:         %{name}-cli-wr-separated.patch
46 Patch3:         %{name}-scm-parse-response.patch
47 Patch4:         %{name}-double-decode.patch
48 Patch5:         %{name}-route-mem.patch
49 Patch6:         %{name}-scm-pluscharisbad.patch
50 Patch7:         %{name}-scm-updates.patch
51 Patch8:         %{name}-close-signature.patch
52 Patch9:         %{name}-list-sorting.patch
53 Patch10:        %{name}-workflow-handlenewnote-note_id.patch
54 Patch11:        %{name}-order4b.patch
55 Patch12:        %{name}-cli-errorcheck.patch
56 Patch13:        %{name}-combined.patch
57 Patch14:        %{name}-xml-inline.patch
58 Patch15:        %{name}-timetracking-advanced-logic.patch
59 # packaging patches that probably never go upstream
60 Patch100:       %{name}-paths.patch
61 Patch101:       %{name}-cvs-config.patch
62 Patch102:       %{name}-irc-mem.patch
63 Patch103:       %{name}-irc-config.patch
64 Patch104:       %{name}-PEAR.patch
65 Patch105:       %{name}-httpclient-clientside.patch
66 Patch106:       %{name}-bot-reconnect.patch
67 Patch107:       %{name}-private-key.patch
68 URL:            http://dev.mysql.com/downloads/other/eventum/
69 BuildRequires:  rpm-php-pearprov >= 4.0.2-98
70 BuildRequires:  rpmbuild(macros) >= 1.268
71 BuildRequires:  sed >= 4.0
72 Requires(triggerpostun):        /usr/bin/php
73 Requires(triggerpostun):        sed >= 4.0
74 Requires:       %{name}-base = %{version}-%{release}
75 Requires:       Smarty >= 2.6.10-4
76 Requires:       apache(mod_dir)
77 Requires:       php >= 3:4.2.0
78 Requires:       php-gd
79 Requires:       php-imap
80 Requires:       php-mysql
81 Requires:       php-pcre
82 Requires:       php-pear-Benchmark
83 Requires:       php-pear-DB
84 Requires:       php-pear-Date
85 Requires:       php-pear-HTTP_Request
86 Requires:       php-pear-Mail
87 Requires:       php-pear-Mail_Mime
88 Requires:       php-pear-Math_Stats
89 Requires:       php-pear-Net_DIME
90 Requires:       php-pear-Net_SMTP
91 Requires:       php-pear-Net_Socket
92 Requires:       php-pear-Net_URL
93 Requires:       php-pear-Net_UserAgent_Detect
94 Requires:       php-pear-PEAR-core
95 Requires:       php-pear-Text_Diff
96 Requires:       php-pear-XML_RPC
97 Requires:       php-session
98 Requires:       webapps
99 BuildArch:      noarch
100 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101
102 %define         _noautoreq      'pear(/etc/webapps/.*)' 'pear(jpgraph_dir.php)' 'pear(.*Smarty.class.php)'
103
104 %define         _libdir         %{_prefix}/lib/%{name}
105 %define         _appdir         %{_datadir}/%{name}
106 %define         _smartyplugindir        %{_appdir}/include/smarty
107 %define         _smartydir      /usr/share/php/Smarty
108 %define         _webapps        /etc/webapps
109 %define         _webapp         %{name}
110 %define         _webappdir      %{_webapps}/%{_webapp}
111 %define         _sysconfdir     /etc/%{name}
112
113 %description
114 Eventum is a user-friendly and flexible issue tracking system that can
115 be used by a support department to track incoming technical support
116 requests, or by a software development team to quickly organize tasks
117 and bugs. Eventum is used by the MySQL AB Technical Support team, and
118 has allowed us to dramatically improve our response times.
119
120 %description -l pl
121 Eventum to przyjazny dla u¿ytkownika system ¶ledzenia spraw, który
122 mo¿e byæ u¿ywany przez dzia³ obs³ugi do ¶ledzenia przychodz±cych ¿±dañ
123 obs³ugi technicznej albo przez zespó³ tworz±cy oprogramowanie do
124 szybkiej organizacji zadañ i b³êdów. Eventum jest u¿ywany przez zespó³
125 Technical Support MySQL AB i umo¿liwi³ im znacz±co poprawiæ czasy
126 reakcji.
127
128 %package base
129 Summary:        Eventum base package
130 Summary(pl):    Podstawowy pakiet Eventum
131 Group:          Applications/WWW
132 Requires(postun):       /usr/sbin/groupdel
133 Requires(postun):       /usr/sbin/userdel
134 Requires(pre):  /bin/id
135 Requires(pre):  /usr/bin/getgid
136 Requires(pre):  /usr/sbin/groupadd
137 Requires(pre):  /usr/sbin/useradd
138 Provides:       group(eventum)
139 Provides:       user(eventum)
140
141 %description base
142 This package contains base directory structure for Eventum.
143
144 %description base -l pl
145 Ten pakiet zawiera podstawow± strukturê katalogów dla Eventum.
146
147 %package setup
148 Summary:        Eventum setup package
149 Summary(pl):    Pakiet do wstêpnej konfiguracji Eventum
150 Group:          Applications/WWW
151 Requires:       %{name} = %{version}-%{release}
152
153 %description setup
154 Install this package to configure initial Eventum installation. You
155 should uninstall this package when you're done, as it considered
156 insecure to keep the setup files in place.
157
158 %description setup -l pl
159 Ten pakiet nale¿y zainstalowaæ w celu wstêpnej konfiguracji Eventum po
160 pierwszej instalacji. Potem nale¿y go odinstalowaæ, jako ¿e
161 pozostawienie plików instalacyjnych mog³oby byæ niebezpieczne.
162
163 %package mail-queue
164 Summary:        Eventum mail queue process
165 Summary(pl):    Przetwarzanie kolejki poczty Eventum
166 Group:          Applications/WWW
167 Requires:       %{name} = %{version}-%{release}
168 Requires:       crondaemon
169
170 %description mail-queue
171 Beginning with the first release of Eventum, emails are not directly
172 sent out from the various scripts, but rather added to a mail queue
173 table that is processed by a cron job. If an email cannot be sent, it
174 will be marked as such in the mail queue log, and the cron job script
175 will re-try to send it again the next time it runs.
176
177 This package contains the cron job.
178
179 %description mail-queue -l pl
180 Od pierwszego wydania Eventum poczta nie jest wysy³ana bezpo¶rednio z
181 ró¿nych skryptów, lecz dodawana do kolejki przetwarzanej z crona.
182 Je¶li poczta nie mo¿e byæ wys³ana, bêdzie odpowiednio oznaczona w logu
183 kolejki poczty, a skrypt z crona bêdzie próbowa³ wys³aæ j± ponownie
184 nastêpnym razem.
185
186 Ten pakiet zawiera zadanie dla crona.
187
188 %package mail-download
189 Summary:        Eventum email download
190 Summary(pl):    ¦ci±ganie poczty Eventum
191 Group:          Applications/WWW
192 Requires:       %{name} = %{version}-%{release}
193 Requires:       crondaemon
194
195 %description mail-download
196 In order for Eventum's email integration feature to work, you need to
197 setup a cron job to run the script every so often.
198
199 This package contains the cron job.
200
201 %description mail-download -l pl
202 Aby integracja poczty elektronicznej w Eventum dzia³a³a, trzeba
203 ustawiæ zadanie crona, aby uruchamia³ odpowiedni skrypt wystarczaj±co
204 czêsto.
205
206 Ten pakiet zawiera zadanie dla crona.
207
208 %package reminder
209 Summary:        Eventum Reminder System
210 Summary(pl):    System przypominania dla Eventum
211 Group:          Applications/WWW
212 Requires:       %{name} = %{version}-%{release}
213 Requires:       crondaemon
214
215 %description reminder
216 The reminder system was designed with the objective as serving as a
217 safe net for issues that need attention. Depending on what
218 configuration you create, you may have several reminders (or alerts)
219 be sent out whenever an issue needs attention, for whatever parameter
220 you may deem necessary.
221
222 This package contains the cron job.
223
224 %description reminder -l pl
225 System przypominania zosta³ zaprojektowany tak, aby s³u¿y³ jako
226 bezpieczna sieæ dla spraw wymagaj±cych uwagi. W zale¿no¶ci od
227 konfiguracji mo¿na ustawiæ ró¿ne przypominajki (lub alarmy) wysy³ane
228 przy ka¿dej sprawie wymagaj±cej uwagi lub przy parametrze, który mo¿na
229 uwa¿aæ za potrzebny.
230
231 Ten pakiet zawiera zadanie dla crona.
232
233 %package monitor
234 Summary:        Eventum Heartbeat Monitor
235 Summary(pl):    Monitor ¿ycia dla Eventum
236 Group:          Applications/WWW
237 Requires:       %{name} = %{version}-%{release}
238 Requires:       crondaemon
239 Requires:       php-posix
240
241 %description monitor
242 The heartbeat monitor is a feature designed for the administrator that
243 wants to be alerted whenever a common problem in Eventum is detected,
244 like the database server not being available anymore, or maybe when
245 the recommended permissions for certain configuration files are
246 changed.
247
248 Please note that before running the heartbeat monitor, you may need to
249 customize some of the checks to be appropriate for your own system,
250 particularly the permission and file checks on
251 Monitor::checkConfiguration().
252
253 This package contains the cron job.
254
255 %description monitor -l pl
256 Monitor ¿ycia to funkcjonalno¶æ zaprojektowana dla administratora
257 chc±cego byæ alarmowanym przy ka¿dym wykryciu popularnego problemu z
258 Eventum, jak nie dzia³anie serwera bazy danych albo zmiana uprawnieñ
259 do plików konfiguracyjnych.
260
261 Nale¿y zauwa¿yæ, ¿e przed uruchomieniem tego monitora mo¿e byæ
262 konieczne dostosowanie niektórych testów do systemu, w szczególno¶ci
263 testów uprawnieñ i plików w Monitor::checkConfiguration().
264
265 Ten pakiet zawiera zadanie dla crona.
266
267 %package route-drafts
268 Summary:        Eventum Draft Routing
269 Summary(pl):    Przekazywanie szkiców dla Eventum
270 Group:          Applications/WWW
271 Requires:       %{name} = %{version}-%{release}
272 Requires:       eventum(router)
273
274 %description route-drafts
275 The draft routing feature is used to automatically associate a thread
276 of drafts into an Eventum issue. By setting up qmail (or even Postfix)
277 to deliver emails sent to a specific address (usually
278 draft-<number>@<domain>) to the above script, users are able to send
279 drafts written in their mail client to be stored in Eventum. These
280 drafts will NOT broadcasted to the notification list.
281
282 %description route-drafts -l pl
283 Przekazywanie szkiców s³u¿y do automatycznego wi±zania w±tku szkiców z
284 problemem w Eventum. Ustawiaj±c qmaila (czy nawet Postfiksa), aby
285 dostarcza³ pocztê wys³an± na podany adres (zwykle
286 draft-<liczba>@<domena>) do tego skryptu umo¿liwia siê u¿ytkownikom
287 wysy³anie szkiców napisanych w ich kliencie pocztowym do zapisania w
288 Eventum. Szkice te NIE bêd± wysy³ane na listê powiadomieñ.
289
290 %package route-emails
291 Summary:        Eventum Email Routing
292 Summary(pl):    Przekazywanie poczty dla Eventum
293 Group:          Applications/WWW
294 Requires:       %{name} = %{version}-%{release}
295 Requires:       eventum(router)
296
297 %description route-emails
298 The email routing feature is used to automatically associate a thread
299 of emails into an Eventum issue. By setting up qmail (or even postfix)
300 to deliver emails sent to a specific address (usually
301 issue-<number>@<domain>) to the above script, users are able to use
302 their email clients to reply to emails coming from Eventum, and those
303 replies will be automatically associated with the issue and
304 broadcasted to the entire notification list.
305
306 %description route-emails -l pl
307 Funkcjonalno¶æ przekazywania poczty s³u¿y do automatycznego wi±zania
308 w±tku listów ze spraw± w Eventum. Po ustawieniu qmaila (czy nawet
309 postfiksa), aby dostarcza³ listy wysy³ane na pewien adres (zwykle
310 issue-<numer>@<domena>) na powy¿szy skrypt, u¿ytkownicy bêd± mogli
311 u¿ywaæ klientów pocztowych do odpowiadania na listy przychodz±ce z
312 Eventum, a odpowiedzi te bêd± automatycznie wi±zane ze spraw± i
313 rozprowadzane do ca³ej listy og³oszeniowej.
314
315 %package route-notes
316 Summary:        Eventum Note Routing
317 Summary(pl):    Przekazywanie notatek dla Eventum
318 Group:          Applications/WWW
319 Requires:       %{name} = %{version}-%{release}
320 Requires:       eventum(router)
321
322 %description route-notes
323 The note routing feature is used to automatically associate a thread
324 of notes into an Eventum issue. By setting up qmail (or even postfix)
325 to deliver emails sent to a specific address (usually
326 note-<number>@<domain>) to the above script, users are able to use
327 their email clients to reply to internal notes coming from Eventum,
328 and those replies will be automatically associated with the issue and
329 broadcasted to the notification list staff members.
330
331 %description route-notes -l pl
332 Funkcjonalno¶æ przekazywania notatek s³u¿y do automatycznego wi±zania
333 w±tku notatek ze spraw± w Eventum. Po ustawieniu qmaila (czy nawet
334 postfiksa), aby dostarcza³ listy wysy³ane na pewien adres (zwykle
335 note-<numer>@<domena>) na powy¿szy skrypt, u¿ytkownicy bêd± mogli
336 u¿ywaæ klientów pocztowych do odpowiadania na wewnêtrzne notatki
337 pochodz±ce od Eventu, a odpowiedzi te bêd± automatycznie wi±zane ze
338 spraw± i rozprowadzane do cz³onków personelu listy og³oszeniowej.
339
340 %package router-qmail
341 Summary:        Eventum Mail Routing - qmail
342 Summary(pl):    Przekazywanie poczty Eventum - qmail
343 Group:          Applications/Mail
344 # loose dep is intentional. qmail subpackage isn't built on PLD
345 # builders and there really nothing changes.
346 Requires:       %{name} >= %{version}-%{release}
347 Requires:       qmail >= 1.03
348 Provides:       eventum(router)
349 Obsoletes:      eventum(router)
350
351 %description router-qmail
352 This package provides way of routing notes and emails back to Eventum
353 via qmail.
354
355 %description router-qmail -l pl
356 Ten pakiet udostêpnia metodê przekazywania notatek i listów do Eventum
357 przez qmaila.
358
359 %package router-postfix
360 Summary:        Eventum Mail Routing - Postfix
361 Summary(pl):    Przekazywanie poczty Eventum - Postfix
362 Group:          Applications/Mail
363 Requires:       %{name} = %{version}-%{release}
364 Requires:       postfix
365 Provides:       eventum(router)
366 Obsoletes:      eventum(router)
367
368 %description router-postfix
369 This package provides way of routing notes and emails back to Eventum
370 via Postfix.
371
372 The Postfix configuration instructions you can find from
373 <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>.
374
375 %description router-postfix -l pl
376 Ten pakiet udostêpnia metodê przekazywania notatek i listów do Eventum
377 przez Postfiksa.
378
379 Opis konfiguracji Postfiksa mo¿na znale¼æ pod adresem
380 <http://eventum.mysql.org/wiki/index.php/Setting_up_email_routing_with_postfix>.
381
382 %package irc
383 Summary:        Eventum IRC Notification Bot
384 Summary(pl):    IRC-owy bot powiadamiaj±cy dla Eventum
385 Group:          Applications/WWW
386 Requires(post,preun):   /sbin/chkconfig
387 Requires(triggerpostun):        sed >= 4.0
388 Requires:       %{name} = %{version}-%{release}
389 Requires:       php-pear-Net_SmartIRC
390 Requires:       php-sockets
391 Requires:       rc-scripts >= 0.4.0.18
392
393 %description irc
394 The IRC notification bot is a nice feature for remote teams that want
395 to handle issues and want to have a quick and easy way to get simple
396 notifications. Right now the bot notifies of the following actions:
397 - New Issues
398 - Blocked emails
399 - Issues that got their assignment list changed
400
401 NOTE: You will need to manually edit the bot.php script to set your
402 appropriate preferences, like IRC server and channel that the bot
403 should join.
404
405 %description irc -l pl
406 IRC-owy bot powiadamiaj±cy to mi³a funkcjonalno¶æ dla zdalnych
407 zespo³ów chc±cych obs³ugiwaæ sprawy i mieæ szybki i ³atwy sposób na
408 uzyskiwanie prostych powiadomieñ. Aktualnie bot powiadamia o
409 nastêpuj±cych zdarzeniach:
410 - nowych sprawach
411 - zablokowanych listach
412 - sprawach, dla których zmieni³a siê lista powi±zañ
413
414 UWAGA: w celu wprowadzenia w³asnych ustawieñ, takich jak serwer IRC i
415 kana³ u¿ywany przez bota, trzeba rêcznie zmodyfikowaæ skrypt bot.php .
416
417 %package cli
418 Summary:        Eventum command-line interface
419 Summary(pl):    Interfejs linii poleceñ dla Eventum
420 Group:          Applications/WWW
421 Requires:       %{name}-base = %{version}-%{release}
422 Requires:       php-cli
423 Requires:       php-common >= 3:4.1.0
424 Requires:       php-pear-XML_RPC
425
426 %description cli
427 The Eventum command-line interface allows you to access most of the
428 features of the web interface straight from your command shell.
429
430 %description cli -l pl
431 Interfejs linii poleceñ Eventum pozwala na dostêp do wiêkszo¶ci
432 funkcji interfejsu WWW prosto z linii poleceñ pow³oki.
433
434 %package scm
435 Summary:        Eventum SCM integration
436 Summary(pl):    Integracja SCM dla Eventum
437 Group:          Applications/WWW
438 Requires:       %{name}-base = %{version}-%{release}
439 Requires:       php-cli
440 Requires:       php-common >= 3:4.1.0
441 Requires:       php-pcre
442
443 %description scm
444 This feature allows your software development teams to integrate your
445 Source Control Management system with your Issue Tracking System.
446
447 The integration is implemented in such a way that it will be forward
448 compatible with pretty much any SCM system, such as CVS.
449
450 For installation see
451 </eventum/help.php?topic=scm_integration_installation>.
452
453 %description scm -l pl
454 Ten pakiet pozwala zespo³om programistów na integracjê systemu
455 zarz±dzania ¼ród³ami (SCM - Source Control Management) z systemem
456 ¶ledzenia spraw.
457
458 Integracja jest zaimplementowana tak, aby byæ kompatybilna w przód z
459 prawie ka¿dym systemem SCM, jak np. CVS.
460
461 Szczegó³y na temat instalacji mo¿na przeczytaæ pod
462 </eventum/help.php?topic=scm_integration_installation>.
463
464 %prep
465 %setup -q %{?_snap:-n %{name}-%{_snap}}
466 # undos the source
467 find . -type f -print0 | xargs -0 sed -i -e 's,\r$,,'
468
469 rm -f setup.conf.php # not to be installed by *.php glob
470 rm -rf misc/upgrade/*v1.[123]* # too old to support in PLD Linux
471 rm -f misc/upgrade/flush_compiled_templates.php
472 rm -rf misc/upgrade/*/upgrade_config.php # not needed in PLD Linux
473
474 # sample, not used in eventum
475 rm -f rpc/xmlrpc_client.php
476
477 # bug fixes.
478 %patch0 -p1
479 %patch1 -p1
480 %patch2 -p1
481 %patch3 -p1
482 %patch4 -p1
483 %patch5 -p1
484 %patch6 -p1
485 %patch7 -p1
486 %patch8 -p1
487 %patch9 -p1
488 %patch10 -p1
489 %{?with_order_patch:%patch11 -p1}
490 %patch12 -p1
491 %patch13 -p1
492 %patch14 -p1
493 %patch15 -p1
494
495 # packaging
496 %patch100 -p1
497 %patch101 -p1
498 %patch102 -p1
499 %patch103 -p1
500 %patch104 -p1
501 %patch105 -p1
502 %patch106 -p1
503 %patch107 -p1
504
505 sed -e '1s,#!.*/bin/php -q,#!%{_bindir}/php,' misc/cli/eventum > %{name}-cli
506 sed -e '1i#!%{_bindir}/php' misc/scm/process_cvs_commits.php > %{name}-scm
507 sed -e '1i#!%{_bindir}/php' misc/irc/bot.php > %{name}-bot
508 mv misc/cli/eventumrc_example eventumrc
509 sed -i -e '1i#!%{_bindir}/php' misc/*.php
510 chmod +x misc/*.php
511 mv include/private_key.php private_key.php.in
512
513 # replace in remaining scripts config.inc.php to system one
514 grep -rl 'include_once(".*config.inc.php")' . | xargs sed -i -e '
515         s,include_once(".*config.inc.php"),include_once("%{_webappdir}/core.php"),
516 '
517
518 grep -rl 'APP_INC_PATH..*"private_key.php"' . | xargs sed -i -e '
519         s,include_once(APP_INC_PATH.*"private_key.php"),include_once("%{_webappdir}/private_key.php"),
520 '
521
522 # remove backups from patching as we use globs to package files to buildroot
523 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
524
525 %install
526 rm -rf $RPM_BUILD_ROOT
527 install -d \
528         $RPM_BUILD_ROOT{%{_webappdir},%{_sysconfdir},%{_bindir},%{_sbindir},%{_libdir}} \
529         $RPM_BUILD_ROOT/etc/{rc.d/init.d,cron.d,sysconfig} \
530         $RPM_BUILD_ROOT/var/{run,log,cache,lib}/%{name} \
531         $RPM_BUILD_ROOT/var/lib/%{name}/routed_{emails,drafts,notes} \
532         $RPM_BUILD_ROOT%{_appdir}/{include,htdocs/misc,upgrade} \
533
534 cp -a *.php css customer images js manage reports rpc setup $RPM_BUILD_ROOT%{_appdir}/htdocs
535 cp -a misc/*.html $RPM_BUILD_ROOT%{_appdir}/htdocs/misc
536 cp -a misc/*.php $RPM_BUILD_ROOT%{_appdir}
537 cp -a templates $RPM_BUILD_ROOT%{_appdir}
538 cp -a include/{customer,custom_field,jpgraph,workflow} $RPM_BUILD_ROOT%{_appdir}/include
539 cp -a include/*.php $RPM_BUILD_ROOT%{_appdir}/include
540 cp -a logs/* $RPM_BUILD_ROOT/var/log/%{name}
541 cp -a misc/upgrade $RPM_BUILD_ROOT%{_appdir}
542
543 cp -a favicon.ico $RPM_BUILD_ROOT%{_appdir}/htdocs/favicon.ico
544 install %{SOURCE12} $RPM_BUILD_ROOT%{_appdir}/htdocs/setup/config.inc.php
545 install %{SOURCE13} $RPM_BUILD_ROOT%{_appdir}/upgrade/upgrade.sh
546
547 # cli
548 install -d $RPM_BUILD_ROOT%{_appdir}/cli
549 cp -a misc/cli/include/class.{misc,command_line}.php $RPM_BUILD_ROOT%{_appdir}/cli
550 cp -a misc/cli/config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/cli.php
551 install %{name}-cli $RPM_BUILD_ROOT%{_bindir}/%{name}
552 install %{name}-bot $RPM_BUILD_ROOT%{_sbindir}
553
554 # scm
555 install %{name}-scm $RPM_BUILD_ROOT%{_libdir}/scm
556 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/cvs.php
557
558 # private key
559 cp -a private_key.php.in $RPM_BUILD_ROOT%{_webappdir}/private_key.php
560
561 install %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
562 install %{SOURCE1} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
563 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
564 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
565 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}-reminder
566 install %{SOURCE5} $RPM_BUILD_ROOT/etc/cron.d/%{name}-monitor
567 install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/irc.php
568 install %{SOURCE8} $RPM_BUILD_ROOT/etc/rc.d/init.d/eventum-irc
569 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/eventum-irc
570
571 sed -e '
572 s,%%{APP_VERSION}%%,%{version}%{?_snap:-%{_snap}}%{?_rc:-%{_rc}},
573 s,%%{PHP_PEAR_DIR}%%,%{php_pear_dir},
574 s,%%{APP_PATH}%%,%{_appdir},
575 s,%%{SMARTY_DIR}%%,%{_smartydir},
576 s,%%{SYSCONFDIR}%%,%{_webappdir},
577 ' %{SOURCE10} > $RPM_BUILD_ROOT%{_webappdir}/core.php
578
579 # config
580 > $RPM_BUILD_ROOT%{_webappdir}/setup.php
581 mv $RPM_BUILD_ROOT{%{_appdir}/htdocs/config.inc,%{_webappdir}/config}.php
582
583 install -d $RPM_BUILD_ROOT%{_smartyplugindir}
584 # These plugins are not in Smarty package (Smarty-2.6.2-3)
585 cp -a \
586         include/Smarty/plugins/function.{calendar,get_{display_style,innerhtml,textarea_size}}.php \
587         include/Smarty/plugins/modifier.highlight_quoted.php \
588         $RPM_BUILD_ROOT%{_smartyplugindir}
589
590 # qmail router
591 %if %{with qmail}
592 d=$RPM_BUILD_ROOT/var/lib/%{name}
593 echo 'root' > $d/.qmail
594 echo 'root' > $d/.qmail-default
595 echo '| %{_libdir}/router-qmail drafts' > $d/.qmail-draft-default
596 echo '| %{_libdir}/router-qmail emails 1' > $d/.qmail-issue-default
597 echo '| %{_libdir}/router-qmail notes' > $d/.qmail-note-default
598 install %{SOURCE11} $RPM_BUILD_ROOT%{_libdir}/router-qmail
599 %endif
600 # postfix router
601 install %{SOURCE14} $RPM_BUILD_ROOT%{_libdir}/router-postfix
602
603 %clean
604 rm -rf $RPM_BUILD_ROOT
605
606 %pre
607 %addusertogroup http %{name}
608
609 %post
610 # check if the package is configured.
611 if grep -q 'header("Location: setup/")' %{_webappdir}/config.php; then
612 if [ -f %{_appdir}/htdocs/setup/index.php ]; then
613 %banner %{name} -e <<EOF
614
615 You haven't yet configured Eventum!
616 Please open in browser <http://localhost/eventum/>
617 If you need access from elsewhere, you need to edit
618 %{_webappdir}/apache.conf and restart apache.
619
620 IMPORTANT: When You have configured Eventum, please uninstall the
621 setup package, so that %{name}-setup is able to secure your Eventum
622 installation.
623
624 EOF
625 #' vim syntax hack
626 else
627 %banner %{name} -e <<EOF
628
629 You haven't yet configured Eventum!
630
631 To setup eventum, please install %{name}-setup and open in browser
632 <http://localhost/eventum/>.
633 If you need access from elsewhere, you need to edit
634 %{_webappdir}/apache.conf and restart apache.
635
636 IMPORTANT: When You have configured Eventum, please uninstall the
637 setup package, so that %{name}-setup is able to secure your Eventum
638 installation.
639
640 EOF
641 #' vim syntax hack
642 fi
643
644 elif grep -q 'DEFAULTPRIVATEKEY' %{_webappdir}/private_key.php; then
645 %banner %{name} -e <<EOF
646
647 You have default private key installed!
648
649 Install %{name}-setup and open up http://yourserver/eventum/setup/
650 -- that will help you setup initial config.
651
652 when have configured Eventum, please uninstall the setup package,
653 so that %{name}-setup is able to secure your Eventum installation.
654
655 EOF
656         elif [ -d %{_appdir}/setup ]; then
657 %banner %{name} -e <<EOF
658
659 If you have have configured Eventum, please uninstall the setup package,
660 so that %{name}-setup is able to secure your Eventum installation.
661
662 EOF
663 fi
664
665 # nuke Smarty templates cache after upgrade
666 rm -f /var/cache/eventum/*.php
667
668 %preun
669 if [ "$1" = "0" ]; then
670         # nuke cache
671         rm -f /var/cache/eventum/*.php 2>/dev/null || :
672 fi
673
674 %pre base
675 %groupadd -P %{name}-base -g 146 %{name}
676 %useradd -P %{name}-base -u 146 -d /var/lib/%{name} -g %{name} -c "Eventum User" %{name}
677
678 %postun base
679 if [ "$1" = "0" ]; then
680         %userremove %{name}
681         %groupremove %{name}
682 fi
683
684 %post router-qmail
685 CF=/etc/qmail/control/virtualdomains
686 if ! grep -q ':%{name}\b' $CF 2>/dev/null; then
687         FQDN=$(awk -F'"' '/define/ && $2 ~ /APP_HOSTNAME/ {print $4}' %{_webappdir}/config.php 2>/dev/null)
688         [ "$FQDN" ] || FQDN=$(hostname -f 2>/dev/null || echo localhost)
689         umask 022
690         echo "#${FQDN}:%{name}" >> $CF
691
692 %banner %{name}-qmail -e <<EOF
693
694 Added "#${FQDN}:%{name}" to $CF,
695 Please verify that it is correct and restart qmail:
696 # service qmail reload
697
698 Consult qmail-send(8) for more information on virtualdomains.
699
700 EOF
701 fi
702
703 %preun router-qmail
704 if [ "$1" = "0" ]; then
705         sed -i -e '/:%{name}\b/d' /etc/qmail/control/virtualdomains
706 fi
707
708 %post setup
709 chmod 660 %{_webappdir}/{config,private_key}.php
710 chown root:eventum %{_webappdir}/{config,private_key}.php
711
712 %postun setup
713 if [ "$1" = "0" ]; then
714         chmod 640 %{_webappdir}/{config,private_key}.php
715         chown root:eventum %{_webappdir}/{config,private_key}.php
716 fi
717
718 %post irc
719 /sbin/chkconfig --add eventum-irc
720 %service eventum-irc restart "Eventum IRC Bot"
721
722 %triggerin -- apache1
723 %webapp_register apache %{_webapp}
724
725 %triggerun -- apache1
726 %webapp_unregister apache %{_webapp}
727
728 %triggerin -- apache < 2.2.0, apache-base
729 %webapp_register httpd %{_webapp}
730
731 %triggerun -- apache < 2.2.0, apache-base
732 %webapp_unregister httpd %{_webapp}
733
734 # FIXME
735 # only one upgrade trigger is called if you're upgrading over two
736 # versions, say 1.5 to 1.5.3, only 1.5.3 trigger is called.
737 # use common trigger (the highest version and rpmvercmp from poldek?)
738 %triggerpostun -- eventum < 1.5.1-0.257
739 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5_to_v1.5.1 <<EOF
740 database_changes.php Perform database changes
741 EOF
742
743 %triggerpostun -- eventum < 1.5.2-0.289
744 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.1_to_v1.5.2 <<EOF
745 database_changes.php Perform database changes
746 set_priority_ranks.php Fix the ranking of priority values
747 EOF
748
749 %triggerpostun -- eventum < 1.5.3-0.291
750 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.2_to_v1.5.3 <<EOF
751 database_changes.php Perform database changes
752 EOF
753
754 %triggerpostun -- eventum < 1.5.4-1.12
755 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.3_to_v1.5.4 <<EOF
756 database_changes.php Perform database changes
757 EOF
758
759 %triggerpostun -- eventum < 1.6.0-RC2.6
760 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.5.5_to_v1.6.0 <<EOF
761 database_changes.php Perform database changes
762 upgrade_saved_searches.php Upgrade existing custom filters (saved searches)
763 EOF
764
765 %triggerpostun -- eventum < 1.6.1-0.2
766 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.0_to_v1.6.1 <<EOF
767 database_changes.php Perform database changes
768 EOF
769
770 %triggerpostun irc -- eventum-irc < 1.6.1-3.14
771 sed -i -e '
772 s,\$irc_host,$irc_server_hostname,
773 s,\$irc_port,$irc_server_port,
774 s,\$irc_nick,$nickname,
775 s,\$irc_realname,$realname,
776 s,\$irc_username,$username,
777 s,\$irc_password,$password,
778 ' /etc/eventum/irc.php
779
780 %triggerpostun -- eventum < 1.7.0-2.0.48
781 # migrate from apache-config macros
782 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
783         if [ -d /etc/apache/webapps.d ]; then
784                 cp -f %{_webapps}/%{_webapp}/apache.conf{,.rpmnew}
785                 cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/apache.conf
786         fi
787
788         if [ -d /etc/httpd/webapps.d ]; then
789                 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
790                 cp -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
791         fi
792 fi
793
794 if [ -L /etc/apache/conf.d/99_%{_webapp}.conf ]; then
795         /usr/sbin/webapp register apache %{_webapp}
796         rm -f /etc/apache/conf.d/99_%{_webapp}.conf
797         %service -q apache reload
798 fi
799 if [ -L /etc/httpd/httpd.conf/99_%{_webapp}.conf ]; then
800         /usr/sbin/webapp register httpd %{_webapp}
801         rm -f /etc/httpd/httpd.conf/99_%{_webapp}.conf
802         %service -q httpd reload
803 fi
804
805 %{_appdir}/upgrade/upgrade.sh %{_appdir}/upgrade/v1.6.1_to_v1.7.0 <<EOF
806 database_changes.php Perform database changes
807 set_root_message_ids.php Set iss_root_message_id
808 EOF
809
810 # regular configs
811 for i in apache.conf config.php private_key.php setup.php; do
812         if [ -f /etc/eventum/$i.rpmsave ]; then
813                 mv -f %{_webappdir}/$i{,.rpmnew}
814                 mv -f /etc/eventum/$i.rpmsave %{_webappdir}/$i
815         fi
816 done
817
818 %triggerpostun cli -- %{name}-cli < 1.7.0-3.4
819 if [ -f %{_webappdir}/cli.php.rpmsave ]; then
820         mv -f %{_sysconfdir}/cli.php{,.rpmnew}
821         mv -f %{_webappdir}/cli.php.rpmsave %{_sysconfdir}/cli.php
822 fi
823
824 %triggerpostun irc -- %{name}-irc < 1.7.0-3.4
825 if [ -f %{_webappdir}/irc.php.rpmsave ]; then
826         mv -f %{_sysconfdir}/irc.php{,.rpmnew}
827         mv -f %{_webappdir}/irc.php.rpmsave %{_sysconfdir}/irc.php
828 fi
829
830 %files
831 %defattr(644,root,root,755)
832 %doc ChangeLog FAQ INSTALL README UPGRADE CONTRIB
833 %doc docs/* setup/schema.sql
834 %attr(751,root,root) %dir %{_webappdir}
835 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
836 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
837 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/config.php
838 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/private_key.php
839 %attr(660,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/setup.php
840 %attr(640,root,eventum) %config %verify(not mtime) %{_webappdir}/core.php
841
842 %dir %attr(731,root,eventum) /var/log/%{name}
843 %attr(620,root,eventum) %ghost /var/log/%{name}/*
844
845 %dir %{_appdir}/htdocs
846 %{_appdir}/htdocs/*.php
847 %{_appdir}/htdocs/*.ico
848 %{_appdir}/htdocs/css
849 %{_appdir}/htdocs/customer
850 %{_appdir}/htdocs/images
851 %{_appdir}/htdocs/js
852 %{_appdir}/htdocs/manage
853 %{_appdir}/htdocs/reports
854 %{_appdir}/htdocs/rpc
855 %{_appdir}/htdocs/misc
856 %{_appdir}/templates
857 %dir %{_appdir}/upgrade
858 %attr(755,root,root) %{_appdir}/upgrade/upgrade.sh
859 %{_appdir}/upgrade/[!u]*
860 %{_smartyplugindir}
861
862 %dir %{_appdir}/include
863 %{_appdir}/include/customer
864 %{_appdir}/include/custom_field
865 %{_appdir}/include/jpgraph
866 %{_appdir}/include/workflow
867 %{_appdir}/include/class.[!m]*.php
868 %{_appdir}/include/class.mail.php
869 %{_appdir}/include/class.mail_queue.php
870 %{_appdir}/include/class.mime_helper.php
871 %{_appdir}/include/class.misc.php
872 %{_appdir}/include/db_access.php
873
874 %dir %attr(730,root,eventum) /var/run/%{name}
875 %dir %attr(730,root,eventum) /var/cache/%{name}
876
877 %files base
878 %defattr(644,root,root,755)
879 %attr(751,root,root) %dir %{_sysconfdir}
880 %dir %{_libdir}
881 %dir %{_appdir}
882 # qmail will ignore user, if it's home directory is not owned
883 %attr(750,eventum,eventum) %dir /var/lib/%{name}
884 # saved mail copies
885 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_emails
886 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_drafts
887 %attr(770,root,eventum) %dir /var/lib/%{name}/routed_notes
888
889 %files setup
890 %defattr(644,root,root,755)
891 %{_appdir}/htdocs/setup
892
893 %files mail-queue
894 %defattr(644,root,root,755)
895 %attr(755,root,root) %{_appdir}/process_mail_queue.php
896 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
897
898 %files mail-download
899 %defattr(644,root,root,755)
900 %attr(755,root,root) %{_appdir}/download_emails.php
901 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
902
903 %files reminder
904 %defattr(644,root,root,755)
905 %attr(755,root,root) %{_appdir}/check_reminders.php
906 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-reminder
907
908 %files monitor
909 %defattr(644,root,root,755)
910 %{_appdir}/include/class.monitor.php
911 %attr(755,root,root) %{_appdir}/monitor.php
912 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-monitor
913
914 %files route-drafts
915 %defattr(644,root,root,755)
916 %attr(755,root,root) %{_appdir}/route_drafts.php
917
918 %files route-emails
919 %defattr(644,root,root,755)
920 %attr(755,root,root) %{_appdir}/route_emails.php
921
922 %files route-notes
923 %defattr(644,root,root,755)
924 %attr(755,root,root) %{_appdir}/route_notes.php
925
926 %if %{with qmail}
927 %files router-qmail
928 %defattr(644,root,root,755)
929 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/.qmail*
930 %attr(755,root,root) %{_libdir}/router-qmail
931 %endif
932
933 %files router-postfix
934 %defattr(644,root,root,755)
935 %attr(755,root,root) %{_libdir}/router-postfix
936
937 %files irc
938 %defattr(644,root,root,755)
939 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/irc.php
940 %attr(640,root,eventum) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/eventum-irc
941 %attr(755,root,root) %{_sbindir}/%{name}-bot
942 %attr(754,root,root) /etc/rc.d/init.d/%{name}-irc
943
944 %files cli
945 %defattr(644,root,root,755)
946 %doc eventumrc
947 %attr(644,root,root) %config %verify(not md5 mtime size) %{_sysconfdir}/cli.php
948 %attr(755,root,root) %{_bindir}/%{name}
949 %{_appdir}/cli
950
951 %files scm
952 %defattr(644,root,root,755)
953 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cvs.php
954 %attr(755,root,root) %{_libdir}/scm
This page took 0.107967 seconds and 4 git commands to generate.