]> git.pld-linux.org Git - packages/trac.git/blob - trac.spec
multi apache version config
[packages/trac.git] / trac.spec
1 # TODO
2 # - localization fix in files
3 # - 21:07:41  jtiai> set htdocs_location in trac ini to for example /trac-htdocs/
4 Summary:        Integrated SCM, Wiki, Issue tracker and project environment
5 Summary(pl.UTF-8):      Zintegrowane scm, wiki, system śledzenia problemów i środowisko projektowe
6 Name:           trac
7 # NOTE 1.x is on DEVEL branch, finish it there and then merge
8 Version:        0.12.5
9 Release:        5
10 License:        BSD-like
11 Group:          Applications/WWW
12 Source0:        http://ftp.edgewall.com/pub/trac/Trac-%{version}.tar.gz
13 # Source0-md5:  9ff5adef035fc8f88cc54a714288ee9b
14 Source1:        %{name}-apache.conf
15 Source2:        %{name}-lighttpd.conf
16 Source3:        %{name}.ico
17 Source4:        %{name}.ini
18 Source5:        %{name}-enableplugin.py
19 Source6:        %{name}-upgrade.py
20 Patch0:         %{name}-root2http.patch
21 Patch1:         %{name}-defaults.patch
22 Patch2:         inherit-global-%{name}.ini.patch
23 Patch3:         silvercity-javascript-mimetypes.patch
24 URL:            http://trac.edgewall.org/
25 BuildRequires:  python >= 1:2.1
26 BuildRequires:  python-babel >= 0.9.5
27 BuildRequires:  python-devel >= 1:2.1
28 BuildRequires:  python-distribute
29 BuildRequires:  python-genshi
30 BuildRequires:  rpm-pythonprov
31 BuildRequires:  rpmbuild(macros) >= 1.268
32 BuildRequires:  sed >= 4.0
33 #Requires:      apache(mod_env) || lighttpd-mod_fastcgi
34 Requires:       group(http)
35 Requires:       jquery
36 Requires:       python-clearsilver >= 0.9.3
37 Requires:       python-trac = %{version}-%{release}
38 Requires:       webapps
39 Requires:       webserver(access)
40 Requires:       webserver(alias)
41 Requires:       webserver(auth)
42 Requires:       webserver(cgi)
43 Requires:       webserver(mime)
44 Requires:       webserver(rewrite)
45 # TODO
46 # If apache is the webserver, apache-mod_python is required! What can do?
47 #Suggests:      apache-mod_python >= 3.1.3
48 #Suggests:      lighttpd-mod_fastcgi
49 #Suggests:      python-textile >= 2.0
50 Obsoletes:      trac-plugin-webadmin
51 BuildArch:      noarch
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %define         _appdir         %{_datadir}/%{name}
55 %define         _webapps        /etc/webapps
56 %define         _webapp         %{name}
57 %define         _sysconfdir     %{_webapps}/%{_webapp}
58
59 %description
60 Trac is a minimalistic web-based software project management and
61 bug/issue tracking system. It provides an interface to the Subversion
62 revision control systems, an integrated wiki, flexible issue tracking
63 and convenient report facilities.
64
65 %description -l pl.UTF-8
66 Trac to minimalistyczny, oparty na WWW zarządca projektów i system
67 śledzenia błędów/problemów. Dostarcza interfejs do systemu kontroli
68 wersji Subversion, zintegrowane wiki, elastyczne śledzenie problemów i
69 wygodne ułatwienia do raportowania.
70
71 %package -n python-trac
72 Summary:        Trac Python modules
73 Group:          Development/Languages/Python
74 Requires:       python >= 1:2.4
75 # python-distribute for pkg_resources module
76 Requires:       python-distribute
77 Requires:       python-genshi >= 0.6
78 Requires:       python-sqlite >= 2.5.5
79 Requires:       python-subversion >= 1.2.0
80 Suggests:       python-babel >= 0.9.5
81 Suggests:       python-docutils >= 0.6
82 Suggests:       python-pygments >= 0.6
83 Suggests:       python-pytz
84 Conflicts:      trac < 0.11.7-3
85
86 %description -n python-trac
87 Trac Python modules.
88
89 %prep
90 %setup -q -n Trac-%{version}
91 %patch0 -p1
92 %patch1 -p1
93 %patch2 -p1
94 %patch3 -p1
95
96 # using system jquery package
97 rm trac/htdocs/js/jquery.js
98
99 %build
100 %{__python} setup.py build
101
102 %install
103 rm -rf $RPM_BUILD_ROOT
104 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/var/lib/%{name},%{_datadir}/%{name}/{plugins,templates}}
105
106 %{__python} setup.py install \
107         --skip-build \
108         --optimize=2 \
109         --root=$RPM_BUILD_ROOT
110
111 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
112 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
113 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
114
115 # utility script to enable extra plugins
116 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/%{name}-enableplugin
117 # handle upgrades
118 install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/%{name}-upgrade
119
120 # keep paths from 0.10 install, we want fixed paths so we do not have to update
121 # webserver config each time with the upgrade.
122 install -d $RPM_BUILD_ROOT%{_appdir}/cgi-bin
123 mv $RPM_BUILD_ROOT{%{py_sitescriptdir}/trac,%{_appdir}}/htdocs
124
125 rm $RPM_BUILD_ROOT%{_appdir}/htdocs/README
126
127 install -p cgi-bin/trac.*  $RPM_BUILD_ROOT%{_appdir}/cgi-bin
128
129 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/trac.ini
130 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_appdir}/htdocs/%{name}.ico
131 > $RPM_BUILD_ROOT%{_sysconfdir}/htpasswd
132
133 # remove .py files, leave just compiled ones.
134 %py_postclean
135
136 # we don't need these runtime
137 rm -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/trac/tests
138
139 # collect lang files
140 echo "%dir %{_appdir}/htdocs/js/messages" > %{name}.lang
141 for a in $RPM_BUILD_ROOT%{_appdir}/htdocs/js/messages/*.js; do
142         f=${a##*/}
143         l=${f%.js}
144         echo "%lang($l) ${a#$RPM_BUILD_ROOT}"
145 done >> %{name}.lang
146
147 # TODO: move to /usr/share/locale as trac.mo catalog
148 echo "%dir %{py_sitescriptdir}/trac/locale" >> %{name}.lang
149 for a in $RPM_BUILD_ROOT%{py_sitescriptdir}/trac/locale/*/LC_MESSAGES/*.mo; do
150         d=${a%%/LC_MESSAGES*}
151         l=${d##*/}
152         echo "%lang($l) ${d#$RPM_BUILD_ROOT}"
153 done >> %{name}.lang
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %triggerin -- apache1 < 1.3.37-3, apache1-base
159 %webapp_register apache %{_webapp}
160
161 %triggerun -- apache1 < 1.3.37-3, apache1-base
162 %webapp_unregister apache %{_webapp}
163
164 %triggerin -- apache < 2.2.0, apache-base
165 %webapp_register httpd %{_webapp}
166
167 %triggerun -- apache < 2.2.0, apache-base
168 %webapp_unregister httpd %{_webapp}
169
170 %triggerin -- lighttpd
171 %webapp_register lighttpd %{_webapp}
172
173 %triggerun -- lighttpd
174 %webapp_unregister lighttpd %{_webapp}
175
176 %post
177 if [ "$1" = 1 ]; then
178 %banner %{name} -e <<EOF
179
180 To create new trac environment run as root:
181 # trac-admin /var/lib/trac/project initenv
182 and chown -R it to webserver user (http).
183
184 EOF
185 #'
186
187 # NOTE(s)
188 #- we made the parent directory (/var/lib/trac) g+s, but db/* files
189 #  needed to be really writable for web user, so better suggest
190 #  chown -R than chmod single file(s)?
191
192 fi
193
194 %files -f %{name}.lang
195 %defattr(644,root,root,755)
196 %doc AUTHORS ChangeLog INSTALL README THANKS UPGRADE
197 %doc contrib
198 %dir %attr(750,root,http) %{_sysconfdir}
199 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
200 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
201 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
202 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/htpasswd
203 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/trac.ini
204
205 %attr(755,root,root) %{_sbindir}/trac-enableplugin
206 %attr(755,root,root) %{_sbindir}/trac-upgrade
207 %attr(755,root,root) %{_bindir}/tracd
208
209 #%{_mandir}/man1/trac*.1*
210
211 %dir %{_appdir}
212 %dir %{_appdir}/cgi-bin
213 %attr(755,root,root) %{_appdir}/cgi-bin/trac.cgi
214 %attr(755,root,root) %{_appdir}/cgi-bin/trac.fcgi
215 %dir %{_appdir}/htdocs
216 %dir %{_appdir}/plugins
217 %dir %{_appdir}/templates
218 %{_appdir}/htdocs/*.gif
219 %{_appdir}/htdocs/*.ico
220 %{_appdir}/htdocs/*.png
221 %{_appdir}/htdocs/css
222 %{_appdir}/htdocs/guide
223
224 %dir %{_appdir}/htdocs/js
225 %{_appdir}/htdocs/js/*.js
226
227 # keep upgrade data in main pkg only
228 %{py_sitescriptdir}/trac/upgrades
229
230 # project data is stored there
231 %attr(2770,root,http) %dir /var/lib/trac
232
233 %files -n python-trac
234 %defattr(644,root,root,755)
235 %attr(755,root,root) %{_bindir}/trac-admin
236
237 %dir %{py_sitescriptdir}/%{name}
238 %{py_sitescriptdir}/trac/*.py[co]
239 %dir %{py_sitescriptdir}/trac/locale
240 %{py_sitescriptdir}/trac/admin
241 %{py_sitescriptdir}/trac/db
242 %{py_sitescriptdir}/trac/mimeview
243 %{py_sitescriptdir}/trac/prefs
244 %{py_sitescriptdir}/trac/search
245 %{py_sitescriptdir}/trac/templates
246 %{py_sitescriptdir}/trac/ticket
247 %{py_sitescriptdir}/trac/timeline
248 %{py_sitescriptdir}/trac/util
249 %{py_sitescriptdir}/trac/versioncontrol
250 %{py_sitescriptdir}/trac/web
251 %{py_sitescriptdir}/trac/wiki
252
253 %{py_sitescriptdir}/%{name}opt
254 %{py_sitescriptdir}/Trac-*.egg-info
This page took 0.133246 seconds and 3 git commands to generate.