]> git.pld-linux.org Git - packages/eventum.git/blob - eventum.spec
- subpackage for downloading mails
[packages/eventum.git] / eventum.spec
1 # TODO
2 # - where to put templates_c (templates cache dir)? /var/run/eventum? /var/run/php/eventum? /var/cache/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 #  - Smarty 2.3.0 (http://smarty.php.net)
7 #  - PEAR packages
8 #  - dTree 2.0.5 (http://www.destroydrop.com/javascript/tree/)
9 #  - dynCalendar.js (http://www.phpguru.org/dyncalendar.html)
10 #  - overLIB 3.5.1 (http://www.bosrup.com/web/overlib/)
11 #  - A few other small javascript libraries
12 # - Reminder System (misc/check_reminders.php)
13 # - Heartbeat Monitor (misc/monitor.php)
14 # - Email Routing Script (misc/route_emails.php)
15 # - Note Routing Script (misc/route_notes.php)
16 # - IRC Notification Bot (misc/irc/bot.php)
17 # - Command-line Interface (misc/cli/eventum)
18
19 # snapshot: DATE
20 #define _snap 20050115
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.wildyou.net/Downloads/%{name}/%{name}-%{version}.tar.gz
26 %endif
27
28 %define _rel 1.53
29
30 Summary:        Eventum Issue / Bug Tracking System
31 Summary(pl):    Eventum - system ¶ledzenia spraw/b³êdów
32 Name:           eventum
33 Version:        1.4
34 Release:        %{?_snap:0.%{_snap}.}%{_rel}
35 License:        GPL
36 Group:          Applications/WWW
37 Source0:        %{_source}
38 # Source0-md5:  361c1355e46a6bbfa54e420964ec92cf
39 Source1:        %{name}-apache.conf
40 Source2:        %{name}-mail-queue.sh
41 Source3:        %{name}-mail-download.sh
42 Patch0:         %{name}-rpm.patch
43 Patch1:         %{name}-clock-status.patch
44 URL:            http://dev.mysql.com/downloads/other/eventum/index.html
45 BuildRequires:  rpmbuild(macros) >= 1.177
46 BuildRequires:  sed >= 4.0
47 Requires:       php >= 4.1.0
48 Requires:       php-gd
49 Requires:       php-imap
50 Requires:       php-mysql
51 Requires:       php-pcre
52 #Requires:      apache-mod_dir
53 # conflict with non-confdir apache
54 Conflicts:      apache1 < 1.3.33-1.1
55 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
57 %define         _sysconfdir     /etc/%{name}
58 %define         _appdir %{_datadir}/%{name}
59
60 %define         _apache1dir     /etc/apache
61 %define         _apache2dir     /etc/httpd
62
63 %description
64 Eventum is a user-friendly and flexible issue tracking system that can
65 be used by a support department to track incoming technical support
66 requests, or by a software development team to quickly organize tasks
67 and bugs. Eventum is used by the MySQL AB Technical Support team, and
68 has allowed us to dramatically improve our response times.
69
70 %description -l pl
71 Eventum to przyjazny dla u¿ytkownika system ¶ledzenia spraw, który
72 mo¿e byæ u¿ywany przez dzia³ obs³ugi do ¶ledzenia przychodz±cych ¿±dañ
73 obs³ugi technicznej albo przez zespó³ tworz±cy oprogramowanie do
74 szybkiej organizacji zadañ i b³êdów. Eventum jest u¿ywany przez zespó³
75 Technical Support MySQL AB i umo¿liwi³ im znacz±co poprawiæ czasy
76 reakcji.
77
78 %package setup
79 Summary:        Eventum setup package
80 Summary(pl):    Pakiet do wstêpnej konfiguracji Eventum
81 Group:          Applications/WWW
82 PreReq:         %{name} = %{epoch}:%{version}-%{release}
83
84 %description setup
85 Install this package to configure initial Eventum installation. You
86 should uninstall this package when you're done, as it considered
87 insecure to keep the setup files in place.
88
89 %description setup -l pl
90 Ten pakiet nale¿y zainstalowaæ w celu wstêpnej konfiguracji Eventum po
91 pierwszej instalacji. Potem nale¿y go odinstalowaæ, jako ¿e
92 pozostawienie plików instalacyjnych mog³oby byæ niebezpieczne.
93
94 %package mail-queue
95 Summary:        Eventum Mail Queue Process
96 Group:          Applications/WWW
97 Requires:       %{name} = %{epoch}:%{version}-%{release}
98 Requires:       php4 >= 4.1.0
99 Requires:       crondaemon
100
101 %description mail-queue
102 Beginning with the first release of Eventum, emails are not directly
103 sent out from the various scripts, but rather added to a mail queue
104 table that is processed by a cron job. If an email cannot be sent, it
105 will be marked as such in the mail queue log, and the cron job script
106 will re-try to send it again the next time it runs.
107
108 This package contains the cron job.
109
110 %package mail-download
111 Summary:        Eventum Email Download
112 Group:          Applications/WWW
113 Requires:       %{name} = %{epoch}:%{version}-%{release}
114 Requires:       php4 >= 4.1.0
115 Requires:       crondaemon
116
117 %description mail-download
118 In order for Eventum's email integration feature to work, you need to
119 setup a cron job to run the script every so often.
120
121 This package contains the cron job.
122
123 %prep
124 %setup -q %{?_snap:-n %{name}-%{_snap}}
125 %patch0 -p1
126 %patch1 -p1
127
128 %build
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,%{_appdir}/{locks,templates_c},/var/log}
133
134 cp -a . $RPM_BUILD_ROOT%{_appdir}
135
136 > $RPM_BUILD_ROOT%{_appdir}/setup.conf.php
137
138 sed -i -e 's,/usr/local/bin/php,/usr/bin/php4,' $RPM_BUILD_ROOT%{_appdir}/misc/cli/eventum
139
140 # change private key, so we can easily grep
141 sed -i -e '
142 s,$private_key\s*=\s*".*";,$private_key = "DEFAULTPRIVATEKEYPLEASERUNSETUP!";,
143 ' $RPM_BUILD_ROOT%{_appdir}/include/private_key.php
144
145 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
146 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-queue
147 install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name}-mail-download
148
149 # in conf
150 mv $RPM_BUILD_ROOT%{_appdir}/{config.inc.php,setup.conf.php} $RPM_BUILD_ROOT%{_sysconfdir}
151 ln -s %{_sysconfdir}/config.inc.php $RPM_BUILD_ROOT%{_appdir}
152 ln -s %{_sysconfdir}/setup.conf.php $RPM_BUILD_ROOT%{_appdir}
153 mv $RPM_BUILD_ROOT%{_appdir}/include/private_key.php $RPM_BUILD_ROOT%{_sysconfdir}
154 ln -s %{_sysconfdir}/private_key.php $RPM_BUILD_ROOT%{_appdir}/include/private_key.php
155
156 # log directory
157 mv $RPM_BUILD_ROOT%{_appdir}/logs $RPM_BUILD_ROOT/var/log/%{name}
158 ln -s /var/log/%{name} $RPM_BUILD_ROOT%{_appdir}/logs
159
160 # in doc
161 rm -f $RPM_BUILD_ROOT%{_appdir}/{COPYING,ChangeLog,FAQ,INSTALL,README,UPGRADE}
162 rm -rf $RPM_BUILD_ROOT%{_appdir}/{docs,misc/upgrade}
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %post
168 # apache1
169 if [ -f %{_apache1dir}/apache.conf ]; then
170         ln -sf %{_sysconfdir}/apache.conf %{_apache1dir}/conf.d/99_%{name}.conf
171         if [ -f /var/lock/subsys/apache ]; then
172                 /etc/rc.d/init.d/apache restart 1>&2
173         fi
174 fi
175 # apache2
176 if [ -d %{_apache2dir}/httpd.conf ]; then
177         ln -sf %{_sysconfdir}/apache.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
178         if [ -f /var/lock/subsys/httpd ]; then
179                 /etc/rc.d/init.d/httpd restart 1>&2
180         fi
181 fi
182
183 # check if the package is configured.
184 if grep -q 'header("Location: setup/")' %{_sysconfdir}/config.inc.php; then
185 %banner %{name} -e <<EOF
186
187 You haven't yet configured Eventum!
188
189 Install %{name}-setup and open up http://yourserver/eventum/
190 -- that will help you setup initial config.
191
192 when have configured Eventum, please uninstall the setup package,
193 so that %{name}-setup is able to secure your Eventum installation.
194
195 EOF
196 #' vim stupidity.
197
198 elif grep -q 'DEFAULTPRIVATEKEY' %{_sysconfdir}/private_key.php; then
199 %banner %{name} -e <<EOF
200
201 You have default private key installed!
202
203 Install %{name}-setup and open up http://yourserver/eventum/setup/
204 -- that will help you setup initial config.
205
206 when have configured Eventum, please uninstall the setup package,
207 so that %{name}-setup is able to secure your Eventum installation.
208
209 EOF
210         elif [ -d %{_appdir}/setup ]; then
211 %banner %{name} -e <<EOF
212
213 If you have have configured Eventum, please uninstall the setup package,
214 so that %{name}-setup is able to secure your Eventum installation.
215
216 EOF
217 fi
218
219
220 %preun
221 if [ "$1" = "0" ]; then
222         # apache1
223         if [ -f %{_apache1dir}/apache.conf ]; then
224                 rm -f %{_apache1dir}/conf.d/99_%{name}.conf
225                 if [ -f /var/lock/subsys/apache ]; then
226                         /etc/rc.d/init.d/apache restart 1>&2
227                 fi
228         fi
229         # apache2
230         if [ -d %{_apache2dir}/httpd.conf ]; then
231                 rm -f %{_apache1dir}/httpd.conf/99_%{name}.conf
232                 if [ -f /var/lock/subsys/httpd ]; then
233                         /etc/rc.d/init.d/httpd restart 1>&2
234                 fi
235         fi
236 fi
237
238 %post setup
239 chmod 660 %{_sysconfdir}/{config.inc,setup.conf,private_key}.php
240 chown root:http %{_sysconfdir}/{config.inc,setup.conf,private_key}.php
241
242 %postun setup
243 if [ "$1" = "0" ]; then
244         chmod 640 %{_sysconfdir}/{config.inc,setup.conf,private_key}.php
245         chown root:http %{_sysconfdir}/{config.inc,setup.conf,private_key}.php
246 fi
247
248 %files
249 %defattr(644,root,root,755)
250 %doc ChangeLog FAQ INSTALL README UPGRADE misc/upgrade docs/*
251 %attr(751,root,root) %dir %{_sysconfdir}
252 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
253
254 %dir %attr(731,root,http) /var/log/%{name}
255 %attr(620,root,http) %ghost /var/log/%{name}/*
256
257 %dir %{_appdir}
258 %{_appdir}/*.php
259 %{_appdir}/css
260 %{_appdir}/customer
261 %{_appdir}/images
262 %{_appdir}/js
263 %{_appdir}/logs
264 %{_appdir}/manage
265 %{_appdir}/reports
266 %{_appdir}/rpc
267 %{_appdir}/templates
268
269 %dir %attr(730,root,http) %{_appdir}/locks
270
271 %dir %{_appdir}/include
272 %{_appdir}/include/customer
273 %{_appdir}/include/jpgraph
274 %{_appdir}/include/pear
275 %{_appdir}/include/Smarty
276 %{_appdir}/include/workflow
277 %{_appdir}/include/*.php
278
279 %dir %attr(730,root,http) %{_appdir}/templates_c
280
281 %dir %{_appdir}/misc
282 %{_appdir}/misc/cli
283 %{_appdir}/misc/irc
284 %{_appdir}/misc/scm
285 %{_appdir}/misc/blank.html
286 %{_appdir}/misc/check_reminders.php
287 %{_appdir}/misc/monitor.php
288 %{_appdir}/misc/route_drafts.php
289 %{_appdir}/misc/route_emails.php
290 %{_appdir}/misc/route_notes.php
291
292 %files setup
293 %defattr(644,root,root,755)
294 %{_appdir}/setup
295
296 %files mail-queue
297 %defattr(644,root,root,755)
298 %{_appdir}/misc/process_mail_queue.php
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-queue
300
301 %files mail-download
302 %defattr(644,root,root,755)
303 %{_appdir}/misc/download_emails.php
304 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}-mail-download
This page took 0.053225 seconds and 3 git commands to generate.