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