2 # - SECURITY: http://securitytracker.com/alerts/2004/Jul/1010681.html
3 # - SECURITY: http://security.gentoo.org/glsa/glsa-200507-12.xml
7 %include /usr/lib/rpm/macros.perl
8 Summary: Bug tracking system
9 Summary(pl): System ¶ledzenia b³êdów
12 Release: 0.%{_rcver}.3
14 Group: Applications/WWW
15 Source0: http://ftp.mozilla.org/pub/mozilla.org/webtools/%{name}-%{version}%{_rcver}.tar.gz
16 # Source0-md5: aadd24a0177a7b44ef7b2785c0d6740f
18 Patch0: %{name}-httpd_user.patch
19 Patch1: %{name}-chdir.patch
20 URL: http://www.bugzilla.org/
21 BuildRequires: perl-base
22 Requires(post,postun): apache
23 Requires(post,postun): grep
24 Requires(postun): fileutils
26 Requires: mysql >= 3.23.41
27 Requires: perl-DBD-mysql
28 Requires: perl-DBI >= 1.36
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 %define _noautoreq 'perl(localconfig)' 'perl(data::params)' 'perl(data::versioncache)'
33 %define _bugzilladir /usr/share/bugzilla
39 System ¶ledzenia b³êdów.
42 %setup -q -n %{name}-%{version}%{_rcver}
47 perl -pi -e 's@#\!%{_prefix}/bonsaitools/bin/perl@#\!%{_bindir}/perl@' *cgi *pl Bug.pm processmail syncshadowdb
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/httpd,%{_bugzilladir}/{Bugzilla/{Auth,Template/Plugin},css,docs/{html,images},template},/var/lib/%{name}/{data,graphs}}
53 install *.{cgi,gif,html,jpg,js,pl,pm,txt} $RPM_BUILD_ROOT%{_bugzilladir}
54 install Bugzilla/*.pm $RPM_BUILD_ROOT%{_bugzilladir}/Bugzilla
55 install Bugzilla/Auth/*.pm $RPM_BUILD_ROOT%{_bugzilladir}/Bugzilla/Auth
56 install Bugzilla/Template/Plugin/*.pm $RPM_BUILD_ROOT%{_bugzilladir}/Bugzilla/Template/Plugin
57 install css/*.css $RPM_BUILD_ROOT%{_bugzilladir}/css
58 install docs/html/*.html $RPM_BUILD_ROOT%{_bugzilladir}/docs/html
59 install docs/images/*.gif $RPM_BUILD_ROOT%{_bugzilladir}/docs/images
61 cp -r template/en $RPM_BUILD_ROOT%{_bugzilladir}/template
62 find -name CVS -type d | xargs rm -rf
64 ln -s /var/lib/%{name}/data $RPM_BUILD_ROOT%{_bugzilladir}
65 ln -s /var/lib/%{name}/graphs $RPM_BUILD_ROOT%{_bugzilladir}
67 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf
70 rm -rf $RPM_BUILD_ROOT
73 if [ -f /etc/httpd/httpd.conf ] && \
74 ! grep -q "^Include.*/bugzilla.conf" /etc/httpd/httpd.conf; then
75 echo "Include /etc/httpd/bugzilla.conf" >> /etc/httpd/httpd.conf
77 if [ -d /etc/httpd/httpd.conf ]; then
78 mv -f /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
80 if [ -f /var/lock/subsys/httpd ]; then
81 /usr/sbin/apachectl restart 1>&2
85 if [ "$1" = "0" ]; then
87 if [ -d /etc/httpd/httpd.conf ]; then
88 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
90 grep -v "^Include.*bugzilla.conf" /etc/httpd/httpd.conf/10_httpd.conf > \
91 /etc/httpd/httpd.conf.tmp
92 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
93 if [ -f /var/lock/subsys/httpd ]; then
94 /usr/sbin/apachectl restart 1>&2
100 %defattr(644,root,root,755)
101 %doc README UPGRADING UPGRADING-pre-2.8 docs/rel_notes.txt docs/txt/Bugzilla-Guide.txt
102 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd/%{name}.conf
106 %{_bugzilladir}/template
108 %{_bugzilladir}/graphs
109 %{_bugzilladir}/Bugzilla
110 %attr(755,root,root) %{_bugzilladir}/*.cgi
111 %attr(640,root,http) %config(noreplace) %verify(not size mtime md5) %{_bugzilladir}/globals.pl
112 %{_bugzilladir}/[!g]*.pl
114 %{_bugzilladir}/*.html
116 %{_bugzilladir}/*.gif
117 %{_bugzilladir}/*.jpg
118 %{_bugzilladir}/*.txt
119 %dir /var/lib/%{name}
120 %attr(770,root,http) /var/lib/%{name}/data
121 %attr(775,root,http) /var/lib/%{name}/graphs