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