blob: e8e62f4c145d01465507bcbdf7be431a03c8f97e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
%define version @VERSION@
%define bzrelease @RELEASE@
%define bzinstallprefix /var/www/html
%define bzdatadir %{bzinstallprefix}/bugzilla/data
Epoch: 1
Summary: Red Hat Bug Tracking System
URL: http://www.bugzilla.org/
Name: rh-bugzilla
Version: %{version}
Group: Applications/Publishing
Release: %{bzrelease}
License: MPLv2.0
Source0: %{name}-%{version}-%{bzrelease}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Prefix: %{bzinstallprefix}/bugzilla
@BREQS@
@REQS@
# Filter out deps that we don't need or want.
%{?perl_default_filter}
%global __requires_exclude %__requires_exclude|^perl\\(DBD::Oracle\\)
%global __requires_exclude %__requires_exclude|^perl\\(sanitycheck.cgi\\)
%description
Bugzilla is a popular bug tracking system used by multiple open source
projects. It requires a database engine installed - either MySQL or
PostgreSQL. Without one of these database engines, Bugzilla will not work.
%prep
%setup -q -c
# Deal with changing /usr/local paths here instead of via patches
%{__perl} -pi -e 's|/usr/local/bin/python\b|%{__python}|' contrib/*.py
%{__perl} -pi -e 's|/usr/local/bin/ruby\b|%{_bindir}/ruby|' contrib/*.rb
grep -rl '/usr/lib/sendmail\b' contrib docs \
| xargs %{__perl} -pi -e 's|/usr/lib/sendmail\b|%{_sbindir}/sendmail|'
%build
# Remove the execute bit from files that don't start with #!
for file in `find -type f -perm /111`; do
if head -1 $file | grep -Ev '^\#!' &>/dev/null; then
chmod a-x $file
fi
done
# Ensure shebang shell scripts have executable bit set
for file in `find -type f -perm /664`; do
if head -1 $file | grep -E '^\#!' &>/dev/null; then
chmod a+x $file
fi
done
%{__perl} docs/makedocs.pl
%install
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}
mv extensions/RedHat/bin ${RPM_BUILD_ROOT}/%{_datadir}/%{name}/bin
mkdir -p ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla
cp -pr * ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla
cp -p .htaccess ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla
mkdir -p ${RPM_BUILD_ROOT}%{bzdatadir}
mkdir -p ${RPM_BUILD_ROOT}%{bzdatadir}/mining
mkdir -p ${RPM_BUILD_ROOT}%{bzdatadir}/duplicates
mkdir -p ${RPM_BUILD_ROOT}%{bzdatadir}/sanitycheck
mkdir -p ${RPM_BUILD_ROOT}%{bzdatadir}/template
mkdir -p ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/graphs
mkdir -p ${RPM_BUILD_ROOT}/lib/systemd/system
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/redhat
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/docs/en/txt
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/docs/en/rst
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/docs/lib
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/docs/makedocs.pl
rm -rf ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/extensions/*/docs/
rm ${RPM_BUILD_ROOT}%{bzinstallprefix}/bugzilla/bugzilla.spec
cat << 'EOF' > ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/README
This directory holds the configuration files for Red Hat Bugzilla. Files
in this directory are managed by puppet on production macines. On internal
machines, you will need to maintain these files yourself.
EOF
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,apache,apache,-)
%dir %attr(-,apache,apache)%{bzinstallprefix}/bugzilla
%{bzinstallprefix}/bugzilla
%exclude %{bzinstallprefix}/bugzilla/runtests.pl
%exclude %{bzinstallprefix}/bugzilla/Makefile
%{_datadir}/%{name}
# Apache config managed by cfengine
%config(noreplace) %attr(444,root,root) %{_sysconfdir}/%{name}/README
%changelog
* Tue Jan 16 2018 Jeff Fearn 11.11
- build rpm
|