-
Notifications
You must be signed in to change notification settings - Fork 170
/
ganglia-web.spec.in
90 lines (77 loc) · 2.79 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
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
Source1: apache.conf
Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
Obsoletes: ganglia-webfrontend
Requires: php >= 5, php-gd
%if 0%{?suse_version}
%define web_prefixdir /srv/www/htdocs/ganglia
%else
%define web_prefixdir %{custom_web_prefixdir}
%endif
%{!?custom_web_prefixdir: %define web_prefixdir /var/www/html/ganglia}
Prefix: %{web_prefixdir}
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 -n %{name}-%{version}
%__cp %{SOURCE1} .
%build
%install
# Flush any old RPM build root
%__rm -rf $RPM_BUILD_ROOT
%__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}
%__cp -rf * $RPM_BUILD_ROOT/%{web_prefixdir}
%__rm -rf $RPM_BUILD_ROOT/%{web_prefixdir}/conf
%__rm -rf $RPM_BUILD_ROOT/%{web_prefixdir}/apache.conf
%__install -d -m 0755 $RPM_BUILD_ROOT@vargwebdir@/filters
%__install -d -m 0755 $RPM_BUILD_ROOT@vargwebdir@/conf
%__cp -rf conf/* $RPM_BUILD_ROOT@vargwebdir@/conf
%__install -d -m 0755 $RPM_BUILD_ROOT@vargwebdir@/dwoo
%__install -d -m 0755 $RPM_BUILD_ROOT@vargwebdir@/dwoo/compiled
%__install -d -m 0755 $RPM_BUILD_ROOT@vargwebdir@/dwoo/cache
%__install -d -m 0755 $RPM_BUILD_ROOT@etcdir@
%__cp -f apache.conf $RPM_BUILD_ROOT@etcdir@/
%files
%defattr(-,root,root)
%attr(0755,nobody,nobody)@vargwebdir@/filters
%dir %attr(0755,@varapacheuser@,@varapacheuser@)@vargwebdir@/conf
%dir %attr(0755,@varapacheuser@,@varapacheuser@)@vargwebdir@/dwoo
%attr(0755,@varapacheuser@,@varapacheuser@)@vargwebdir@/dwoo/compiled
%attr(0755,@varapacheuser@,@varapacheuser@)@vargwebdir@/dwoo/cache
%{web_prefixdir}/
%config(noreplace) %{web_prefixdir}/conf_default.php
@vargwebdir@/conf/*
%config(noreplace) @etcdir@/apache.conf
%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 @etcdir@/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`" = "@etcdir@/apache.conf" ]; then
rm /etc/httpd/conf.d/ganglia-web.conf
fi
fi
%changelog
* 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