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