Ticket #6425: trac.spec

File trac.spec, 4.4 KB (added by nielx, 11 years ago)

Test attachment notifications

Line 
1# Copyright (c) 2007-2010 Herbert Graeber
2# 2009-2010 Pascal Bleser
3# This file and all modifications and additions to the pristine
4# package are under the same license as the package itself.
5#
6# Please submit bugfixes or comments to herbert@links2linux.de
7# or pascal.bleser@opensuse.org
8
9# vim: set ts=4 sw=4 et:
10# norootforbuild
11
12Name: trac
13Version: 1.0
14Release: 1
15License: BSD 3-clause
16Group: Development/Tools/Other
17URL: http://trac.edgewall.com
18# http://ftp.edgewall.com/pub/trac/Trac-%{version}.tar.gz
19Source0: Trac-%{version}.tar.bz2
20Source1: tracd.init
21Source2: tracd.sysconfig
22Source3: trac.conf
23Source4: README.SUSE.html
24#disabled: see also http://trac.edgewall.org/ticket/2417
25#Patch1: trac-auth.patch
26Source99: trac-rpmlintrc
27Patch: allow-anonymous-form-posts-with-secure-auth-cookie.diff
28Patch1: configure-preview-limit-by-mimetype.diff
29Patch2: correct-wrapping-in-diff-stylesheet.diff
30%if 0%{?suse_version} > 1110
31BuildArch: noarch
32%endif
33BuildRoot: %{_tmppath}/%{name}-%{version}-build
34%if 0%{?suse_version} > 1020
35BuildRequires: fdupes
36%endif
37BuildRequires: python-babel >= 0.9.5
38BuildRequires: python-devel >= 2.3
39BuildRequires: python-genshi >= 0.6
40BuildRequires: python-setuptools >= 0.6
41%py_requires
42Requires: python-babel >= 0.9.5
43Requires: python-genshi >= 0.6
44Requires: python-pygments
45Requires: python-setuptools >= 0.6
46Requires: python-tz
47Provides: trac-webadmin = 0.1.2-7
48Obsoletes: trac-webadmin < 0.1.2-7
49Summary: Integrated SCM, Wiki, Issue Tracker and Project Environment
50
51%description
52Trac is a minimalistic web-based software project management and bug/issue
53tracking system. It provides an interface to the Subversion revision control
54systems, an integrated wiki, flexible issue tracking and convenient report
55facilities.
56
57%package server
58Group: Development/Tools/Other
59PreReq: %insserv_prereq %fillup_prereq
60Requires: %{name} = %{version}
61Summary: Trac standalone Server
62
63%description server
64The Trac standalone server. Do not use this for production.
65
66%prep
67%setup -q -n "Trac-%{version}"
68%patch
69%patch1
70#%patch1
71%patch2
72%__cp %{S:4} .
73%__sed -i 's/\r//' contrib/trac-svn-post-commit-hook.cmd
74
75%build
76CFLAGS="%{optflags}" %{__python} setup.py build
77CFLAGS="%{optflags}" %{__python} setup.py compile_catalog
78
79%install
80%__python setup.py install --root=%{buildroot} --prefix=%{_prefix} --record-rpm=INSTALLED_FILES
81%__install -Dm 0755 contrib/cgi-bin/trac.cgi %{buildroot}%{_datadir}/%{name}/cgi-bin/trac.cgi
82%__install -Dm 0755 contrib/cgi-bin/trac.fcgi %{buildroot}%{_datadir}/%{name}/cgi-bin/trac.fcgi
83%__install -Dm 0644 %{S:3} %{buildroot}%{_sysconfdir}/apache2/conf.d/trac.conf
84%__install -dm 0750 %{buildroot}/srv/trac
85%__install -Dm 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/tracd
86%__install -dm 0755 %{buildroot}%{_sbindir}
87%__ln_s %{_sysconfdir}/init.d/tracd %{buildroot}%{_sbindir}/rctracd
88%__install -Dm 0600 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.tracd
89
90%if 0%{?suse_version} > 1020
91%fdupes %{buildroot}
92%endif
93
94%pre
95# save the trac.ini from /usr/share/trac/conf if it exists...
96if [ "$1" -ge 2 ]; then
97 if [ \! -e %{_sysconfdir}/trac/trac.ini -a -r %{_datadir}/trac/conf/trac.ini ]; then
98 if [ \! -e %{_sysconfdir}/trac ]; then mkdir %{_sysconfdir}/trac; fi
99 mv %{_datadir}/trac/conf/trac.ini %{_sysconfdir}/trac/trac.ini.backup
100 fi
101fi
102
103%preun server
104%stop_on_removal tracd
105
106%postun server
107%restart_on_update tracd
108%insserv_cleanup
109
110%post
111# ... and save it as new try.ini in /etc/trac.ini if this doesn't exist
112if [ "$1" -ge 2 ]; then
113 if [ -r %{_sysconfdir}/trac/trac.ini.backup ]; then
114 mv %{_sysconfdir}/trac/trac.ini %{_sysconfdir}/trac/trac.ini.rpmnew
115 mv %{_sysconfdir}/trac/trac.ini.backup %{_sysconfdir}/trac/trac.ini
116 fi
117fi
118
119%post server
120%fillup_and_insserv -n tracd tracd
121
122%files -f INSTALLED_FILES
123%defattr(-,root,root,-)
124%doc AUTHORS ChangeLog COPYING README README.SUSE.html RELEASE THANKS UPGRADE contrib
125%exclude %{_bindir}/tracd
126%dir %{_sysconfdir}/apache2
127%dir %{_sysconfdir}/apache2/conf.d
128%config(noreplace) %{_sysconfdir}/apache2/conf.d/trac.conf
129%{_datadir}/%{name}
130%attr(0750,root,www) /srv/trac
131
132%files server
133%defattr(-,root,root)
134%{_sysconfdir}/init.d/tracd
135%{_bindir}/tracd
136%{_sbindir}/rctracd
137%{_var}/adm/fillup-templates/sysconfig.tracd
138