]> git.pld-linux.org Git - packages/eventum.git/blob - eventum.spec
- docs/* to %doc
[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 # - Mail Queue Process, cron or separate package (misc/process_mail_queue.php)
13 # - Email Download (misc/download_emails.php)
14 # - Reminder System (misc/check_reminders.php)
15 # - Heartbeat Monitor (misc/monitor.php)
16 # - Email Routing Script (misc/route_emails.php)
17 # - Note Routing Script (misc/route_notes.php)
18 # - IRC Notification Bot (misc/irc/bot.php)
19 # - Command-line Interface (misc/cli/eventum)
20
21 # snapshot: DATE
22 #define _snap 20050114
23
24 %if 0%{?_snap}
25 %define _source http://downloads.mysql.com/snapshots/%{name}/%{name}-nightly-%{_snap}.tar.gz
26 %else
27 %define _source http://mysql.wildyou.net/Downloads/%{name}/%{name}-%{version}.tar.gz
28 %endif
29
30 %define _rel 1.38
31
32 Summary:        Eventum Issue / Bug Tracking System
33 Name:           eventum
34 Version:        1.4
35 Release:        %{?_snap:0.%{_snap}.}%{_rel}
36 License:        GPL
37 Group:          Applications/WWW
38 Source0:        %{_source}
39 # Source0-md5:  361c1355e46a6bbfa54e420964ec92cf
40 Source1:        %{name}-apache.conf
41 Patch0:         %{name}-rpm.patch
42 Patch1:         %{name}-clock-status.patch
43 URL:            http://dev.mysql.com/downloads/other/eventum/index.html
44 BuildRequires:  sed >= 4.0
45 BuildRequires:  rpmbuild(macros) >= 1.177
46 Requires:       php >= 4.1.0
47 Requires:       php-pcre
48 Requires:       php-mysql
49 Requires:       php-gd
50 Requires:       php-imap
51 #Requires:      apache-mod_dir
52 # conflict with non-confdir apache
53 Conflicts:      apache1 < 1.3.33-1.1
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %define         _sysconfdir     /etc/%{name}
57 %define         _appdir %{_datadir}/%{name}
58
59 %define         _apache1dir     /etc/apache
60 %define         _apache2dir     /etc/httpd
61
62 %description
63 Eventum is a user-friendly and flexible issue tracking system that can
64 be used by a support department to track incoming technical support
65 requests, or by a software development team to quickly organize tasks
66 and bugs. Eventum is used by the MySQL AB Technical Support team, and
67 has allowed us to dramatically improve our response times.
68
69 %package setup
70 Summary:        Eventum setup package.
71 Group:          Applications/WWW
72 PreReq:         %{name}
73 Requires:       %{name} = %{epoch}:%{version}-%{release}
74
75 %description setup
76 Install this package to configure initial Eventum installation. You
77 should uninstall this package when you're done, as it considered
78 insecure to keep the setup files in place.
79
80 %prep
81 %setup -q %{?_snap:-n %{name}-%{_snap}}
82 %patch0 -p1
83 %patch1 -p1
84
85 %build
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89
90 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}/{locks,templates_c},/var/log}
91
92 cp -a . $RPM_BUILD_ROOT%{_appdir}
93
94 > $RPM_BUILD_ROOT%{_appdir}/setup.conf.php
95
96 sed -i -e 's,/usr/local/bin/php,/usr/bin/php4,' $RPM_BUILD_ROOT%{_appdir}/misc/cli/eventum
97
98 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
99
100 # in conf
101 mv $RPM_BUILD_ROOT%{_appdir}/{config.inc.php,setup.conf.php} $RPM_BUILD_ROOT%{_sysconfdir}
102 ln -s %{_sysconfdir}/config.inc.php $RPM_BUILD_ROOT%{_appdir}
103 ln -s %{_sysconfdir}/setup.conf.php $RPM_BUILD_ROOT%{_appdir}
104
105 # log directory
106 mv $RPM_BUILD_ROOT%{_appdir}/logs $RPM_BUILD_ROOT/var/log/%{name}
107 ln -s /var/log/%{name} $RPM_BUILD_ROOT%{_appdir}/logs
108
109 # in doc
110 rm -f $RPM_BUILD_ROOT%{_appdir}/{COPYING,ChangeLog,FAQ,INSTALL,README,UPGRADE}
111 rm -rf $RPM_BUILD_ROOT%{_appdir}/{docs,misc/upgrade}
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %post
117 # apache1
118 if [ -f %{_apache1dir}/apache.conf ]; then
119         ln -sf %{_sysconfdir}/apache.conf %{_apache1dir}/conf.d/99_%{name}.conf
120         if [ -f /var/lock/subsys/apache ]; then
121                 /etc/rc.d/init.d/apache restart 1>&2
122         fi
123 fi
124 # apache2
125 if [ -d %{_apache2dir}/httpd.conf ]; then
126         ln -sf %{_sysconfdir}/apache.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
127         if [ -f /var/lock/subsys/httpd ]; then
128                 /etc/rc.d/init.d/httpd restart 1>&2
129         fi
130 fi
131
132 # check if the package is configured.
133 if grep -q 'header("Location: setup/")' %{_sysconfdir}/config.inc.php; then
134 %banner %{name} -e <<EOF
135
136 You haven't yet configured Eventum!
137
138 Install %{name}-setup and open up http://yourserver/eventum/
139 -- that will help you setup initial config.
140
141 when have configured Eventum, please uninstall the setup package,
142 so that %{name}-setup is able to secure your Eventum installation.
143
144 EOF
145 #' vim stupidity.
146 else
147         if [ -d %{_appdir}/setup ]; then
148 %banner %{name} -e <<EOF
149
150 If you have have configured Eventum, please uninstall the setup package,
151 so that %{name}-setup is able to secure your Eventum installation.
152
153 EOF
154         fi
155 fi
156
157 %preun
158 if [ "$1" = "0" ]; then
159         # apache1
160         if [ -f %{_apache1dir}/apache.conf ]; then
161                 rm -f %{_apache1dir}/conf.d/99_%{name}.conf
162                 if [ -f /var/lock/subsys/apache ]; then
163                         /etc/rc.d/init.d/apache restart 1>&2
164                 fi
165         fi
166         # apache2
167         if [ -d %{_apache2dir}/httpd.conf ]; then
168                 rm -f %{_apache1dir}/httpd.conf/99_%{name}.conf
169                 if [ -f /var/lock/subsys/httpd ]; then
170                         /etc/rc.d/init.d/httpd restart 1>&2
171                 fi
172         fi
173 fi
174
175 %post setup
176 # RACE possible? chmod just in case
177 chmod 640 %{_sysconfdir}/{config.inc,setup.conf}.php
178 chown http:root %{_sysconfdir}/{config.inc,setup.conf}.php
179
180 %postun setup
181 if [ "$1" = "0" ]; then
182         # RACE condition possible?
183         chmod 640 %{_sysconfdir}/{config.inc,setup.conf}.php
184         chown root:http %{_sysconfdir}/{config.inc,setup.conf}.php
185 fi
186
187 %files
188 %defattr(644,root,root,755)
189 %doc ChangeLog FAQ INSTALL README UPGRADE misc/upgrade docs/*
190 %dir %{_sysconfdir}
191 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
192
193 %dir %attr(731,root,http) /var/log/%{name}
194 %attr(640,http,root) %ghost /var/log/%{name}/*
195
196 %dir %{_appdir}
197 %{_appdir}/*.php
198 %{_appdir}/css
199 %{_appdir}/customer
200 %{_appdir}/images
201 %{_appdir}/js
202 %{_appdir}/logs
203 %{_appdir}/manage
204 %{_appdir}/misc
205 %{_appdir}/reports
206 %{_appdir}/rpc
207 %{_appdir}/templates
208
209 %dir %attr(750,http,root) %{_appdir}/locks
210
211 %dir %{_appdir}/include
212 %{_appdir}/include/customer
213 %{_appdir}/include/jpgraph
214 %{_appdir}/include/pear
215 %{_appdir}/include/Smarty
216 %{_appdir}/include/workflow
217 %{_appdir}/include/class.*
218 %{_appdir}/include/db_access.php
219 %{_appdir}/include/jsrsServer.inc.php
220 %attr(640,http,root) %{_appdir}/include/private_key.php
221
222 %dir %attr(750,http,root) %{_appdir}/templates_c
223
224 %files setup
225 %defattr(644,root,root,755)
226 %{_appdir}/setup
This page took 0.037667 seconds and 3 git commands to generate.