forked from ganglia/ganglia-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathganglia-web.spec.in
107 lines (91 loc) · 3.71 KB
/
ganglia-web.spec.in
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
104
105
106
107
# The following options are supported:
# --define 'httpd_user <username>' # defaults to: apache
# --define 'httpd_group <group>' # defaults to: apache
# --define 'web_prefixdir <path>' # defaults to: @GDESTDIR@
# --define 'gweb_statedir <path>' # defaults to: @vargwebdir@
# --define 'gweb_confdir <path>' # defaults to: @etcdir@
# example: rpmbuild -tb ganglia-web-3.5.12.tar.gz --define 'httpd_user www-data' --define 'httpd_group www-data' --define 'web_prefixdir /srv/www/ganglia'
# Default values for Above variables.
%if 0%{?suse_version}
%{!?web_prefixdir: %define web_prefixdir /srv/www/htdocs/ganglia}
%else
%{!?web_prefixdir: %define web_prefixdir /usr/share/ganglia-webfrontend}
%endif
%{!?httpd_user: %define httpd_user apache}
%{!?httpd_group: %define httpd_group apache}
%{!?gweb_statedir: %define gweb_statedir @vargwebdir@}
%{!?gweb_confdir: %define gweb_confdir @etcdir@}
Summary: Ganglia Web Frontend
Name: ganglia-web
Version: @GWEB_VERSION@
URL: http://ganglia.info
Release: 1
License: BSD
Vendor: Ganglia Development Team <[email protected]>
Group: System Environment/Base
Source: %{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
Obsoletes: ganglia-webfrontend
Requires: php >= 5, php-gd
BuildArchitectures: noarch
%description
This package provides a web frontend to display the XML tree published by
ganglia, and to provide historical graphs of collected metrics. This website is
written in the PHP5 language and uses the Dwoo templating engine.
%prep
%setup -q -n %{name}-%{version}
%build
# Update all needed files
%__make GDESTDIR=%{web_prefixdir} \
APACHE_USER=%{httpd_user} \
APACHE_GROUP=%{httpd_group} \
GWEB_STATEDIR=%{gweb_statedir} \
GCONFDIR=%{gweb_confdir}
%install
# Flush any old RPM build root
%__rm -rf $RPM_BUILD_ROOT
%__make install-files GDESTDIR=%{web_prefixdir} \
APACHE_USER=%{httpd_user} \
APACHE_GROUP=%{httpd_group} \
GWEB_STATEDIR=%{gweb_statedir} \
GCONFDIR=%{gweb_confdir} \
DESTDIR=$RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}
%dir %attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}/filters
%dir %attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}/conf
%{gweb_statedir}/conf/*
%dir %attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}/dwoo
%attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}/dwoo/compiled
%attr(0755,%{httpd_user},%{httpd_group})%{gweb_statedir}/dwoo/cache
%{web_prefixdir}/*
%config(noreplace) %{gweb_confdir}/apache.conf
%config(noreplace) %{gweb_confdir}/conf.php
%clean
%__rm -rf $RPM_BUILD_ROOT
%post
%triggerin -- httpd
if [ $1 -eq 1 -a $2 -eq 1 ]; then
if [ ! -e /etc/httpd/conf.d/ganglia-web.conf ] ; then
ln -s %{gweb_confdir}/apache.conf /etc/httpd/conf.d/ganglia-web.conf
fi
fi
%triggerun -- httpd
if [ $2 -eq 0 ]; then
if [ -h /etc/httpd/conf.d/ganglia-web -a "`readlink /etc/httpd/conf/httpd.conf`" = "%{gweb_confdir}/apache.conf" ]; then
rm /etc/httpd/conf.d/ganglia-web.conf
fi
fi
%changelog
* Fri Feb 28 2014 Olivier Lahaye <[email protected]>
- Added the ability to change Makefile variables using --define switch for the
following variables:
httpd_user, httpd_group, web_prefixdir, gweb_confdir, gweb_statedir
- Also fixed a bug that prevented to fix the web_prefixdir on SuSE Linux.
* Tue Jun 04 2013 Wesley Hirsch <[email protected]>
- Added default apache configuration
* Thu Mar 17 2011 Bernard Li <[email protected]>
- Renamed conf.php -> conf_default.php
* Fri Dec 17 2010 Bernard Li <[email protected]>
- Spec file for gweb which is split from ganglia-web subpackage