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