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
7 # NOTE 1.x is on DEVEL branch, finish it there and then merge
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
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
36 Requires: python-clearsilver >= 0.9.3
37 Requires: python-trac = %{version}-%{release}
39 Requires: webserver(access)
40 Requires: webserver(alias)
41 Requires: webserver(auth)
42 Requires: webserver(cgi)
43 Requires: webserver(mime)
44 Requires: webserver(rewrite)
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
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 %define _appdir %{_datadir}/%{name}
55 %define _webapps /etc/webapps
56 %define _webapp %{name}
57 %define _sysconfdir %{_webapps}/%{_webapp}
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.
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.
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
84 Conflicts: trac < 0.11.7-3
86 %description -n python-trac
90 %setup -q -n Trac-%{version}
96 # using system jquery package
97 rm trac/htdocs/js/jquery.js
100 %{__python} setup.py build
103 rm -rf $RPM_BUILD_ROOT
104 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},/var/lib/%{name},%{_datadir}/%{name}/{plugins,templates}}
106 %{__python} setup.py install \
109 --root=$RPM_BUILD_ROOT
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
115 # utility script to enable extra plugins
116 install -p %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/%{name}-enableplugin
118 install -p %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/%{name}-upgrade
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
125 rm $RPM_BUILD_ROOT%{_appdir}/htdocs/README
127 install -p cgi-bin/trac.* $RPM_BUILD_ROOT%{_appdir}/cgi-bin
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
133 # remove .py files, leave just compiled ones.
136 # we don't need these runtime
137 rm -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/trac/tests
140 echo "%dir %{_appdir}/htdocs/js/messages" > %{name}.lang
141 for a in $RPM_BUILD_ROOT%{_appdir}/htdocs/js/messages/*.js; do
144 echo "%lang($l) ${a#$RPM_BUILD_ROOT}"
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*}
152 echo "%lang($l) ${d#$RPM_BUILD_ROOT}"
156 rm -rf $RPM_BUILD_ROOT
158 %triggerin -- apache1 < 1.3.37-3, apache1-base
159 %webapp_register apache %{_webapp}
161 %triggerun -- apache1 < 1.3.37-3, apache1-base
162 %webapp_unregister apache %{_webapp}
164 %triggerin -- apache < 2.2.0, apache-base
165 %webapp_register httpd %{_webapp}
167 %triggerun -- apache < 2.2.0, apache-base
168 %webapp_unregister httpd %{_webapp}
170 %triggerin -- lighttpd
171 %webapp_register lighttpd %{_webapp}
173 %triggerun -- lighttpd
174 %webapp_unregister lighttpd %{_webapp}
177 if [ "$1" = 1 ]; then
178 %banner %{name} -e <<EOF
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).
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)?
194 %files -f %{name}.lang
195 %defattr(644,root,root,755)
196 %doc AUTHORS ChangeLog INSTALL README THANKS UPGRADE
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
205 %attr(755,root,root) %{_sbindir}/trac-enableplugin
206 %attr(755,root,root) %{_sbindir}/trac-upgrade
207 %attr(755,root,root) %{_bindir}/tracd
209 #%{_mandir}/man1/trac*.1*
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
224 %dir %{_appdir}/htdocs/js
225 %{_appdir}/htdocs/js/*.js
227 # keep upgrade data in main pkg only
228 %{py_sitescriptdir}/trac/upgrades
230 # project data is stored there
231 %attr(2770,root,http) %dir /var/lib/trac
233 %files -n python-trac
234 %defattr(644,root,root,755)
235 %attr(755,root,root) %{_bindir}/trac-admin
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
253 %{py_sitescriptdir}/%{name}opt
254 %{py_sitescriptdir}/Trac-*.egg-info