ganglia-web/ganglia-web.spec

115 lines
3.0 KiB
RPMSpec
Raw Permalink Normal View History

%define serverdir %(apxs -q htdocsdir 2>/dev/null)
# To create a customized installation:
# autospec -u ganglia-web -a5 \
# -d "installdir=%serverdir/../www.example.com, \
# sitename=example, \
# adminmail=webmaster@example.com"
%if "%{?installdir}" == ""
%define installdir %{serverdir}/ganglia-web
%endif
%if "%{?sitename}" != ""
%if "%{?servername}" == ""
%define servername %(basename %installdir 2>/dev/null)
%endif
%define serverlogdir %(apxs -q logfiledir 2>/dev/null)
%else
%if "%{?aliasdir}" == ""
%define aliasdir /ganglia-web
%endif
%endif
Name: %{?sitename:%sitename-website-}ganglia-web
Version: 3.7.6
Release: 1mamba
Summary: A PHP web interface for Ganglia
Group: Applications/Web
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://sourceforge.net/projects/ganglia/
Source: https://github.com/ganglia/ganglia-web.git/%{version}/ganglia-web-%{version}.tar.bz2
#Source: http://downloads.sourceforge.net/project/ganglia/ganglia-web/%{version}/ganglia-web-%{version}.tar.gz
License: BSD
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildArch: noarch
%description
A PHP web interface for Ganglia.
%prep
%setup -q
%build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d %{buildroot}%{installdir}
cp -a * %{buildroot}%{installdir}
install -d %{buildroot}%{_sysconfdir}/httpd/httpd.d
%if "%{?sitename}" != ""
cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{servername}.conf << EOF
%else
cat > %{buildroot}%{_sysconfdir}/httpd/httpd.d/%{name}.conf << EOF
%endif
%if "%{?sitename}" == ""
%if "%(dirname %installdir)" != "%{serverdir}"
Alias %{aliasdir} %{installdir}
%endif
%endif
<Directory %{installdir}>
AllowOverride All
RewriteEngine On
Order allow,deny
Allow from All
</Directory>
%if "%{?sitename}" != ""
%if "%(dirname %installdir)" != "%{serverdir}"
<VirtualHost *:80>
%{?adminmail:ServerAdmin %adminmail}
DocumentRoot %{installdir}
ServerName %{servername}
ErrorLog %{serverlogdir}/%{servername}-error_log
CustomLog %{serverlogdir}/%{servername}-access_log common
</VirtualHost>
%endif
%endif
EOF
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
#% post
#if [ $1 -ge 1 ]; then
#[ -e %{_localstatedir}/lock/subsys/httpd ] && service httpd reload || :
#fi
#:
%files
%defattr(-,root,root)
%if "%{?sitename}" != ""
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{servername}.conf
%else
%config(noreplace) %{_sysconfdir}/httpd/httpd.d/%{name}.conf
%endif
%dir %{installdir}
%{installdir}/*
%doc AUTHORS COPYING
## note: eventually add the remaining documents (if any)
# %doc README TODO
%changelog
* Mon Mar 11 2024 Automatic Build System <autodist@openmamba.org> 3.7.6-1mamba
- automatic version update by autodist
* Sun Jan 01 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.5-1mamba
- update to 3.7.5
* Wed Nov 27 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 3.5.10-1mamba
- package created using the webbuild interface