Eric Shubert wrote:
Greetings everyone. Steve Huff steered me here.

I'd like to help get the latest ganglia package(s) on rpmforge. I found ones that aren't quite up to date on EPEL, but I'd like to have the latest release available on rpmforge.

I 'borrowed' the spec file from epel and tailored it a bit for the latest ganglia release. It required the libconfuse (not as confusing as it looks) package, so I've included that spec file as well. I've built both packages on CentOS5.4, and they've built cleanly (with a little help from the ganglia-devel list). I'm going to continue with testing them.

I have not added anything that may be specifically needed for RF packaging. I hope that's ok.

I attempted to build the latest version on CentOS4.8, but the latest ganglia also requires apr-1, and CentOS4 has apr-0, so I'm guessing that the latest ganglia simply isn't going to work on COS4, at least not easily enough for me.

If there's anything more I can do to help the process along, please let me know. I'm new to this list, although I've used RF packages for quite some time. 'bout time I chipped in I suppose. ;)

Thanks.


------------------------------------------------------------------------

As a consequence of actually using this 3.1.2 version a bit, I discovered that a couple configuration file locations were changed beginning in 3.1. I've attached an updated spec that takes this into account. Note, I did not include any configuration file conversion processing, as there is no earlier version of ganglia on RF. People using this version to upgrade will need to handle configuration conversion themselves. Is that acceptable?

--
-Eric 'shubes'
Name:               ganglia
Version:            3.1.2
Release:            2.qtp
Summary:            Ganglia Distributed Monitoring System

Group:              Applications/Internet
License:            BSD
URL:                http://ganglia.sourceforge.net/
Source0:            
http://downloads.sourceforge.net/project/%{name}/%{name}%20monitoring%20core/%{version}\%20(Langley\)/%{name}-%{version}.tar.gz
Buildroot:          %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} 
-n)

BuildRequires:      rrdtool-devel, apr-devel

%description
Ganglia is a scalable, real-time monitoring and execution environment
with all execution requests and statistics expressed in an open
well-defined XML format.

%package web
Summary:            Ganglia Web Frontend
Group:              Applications/Internet
Requires:           rrdtool, php, php-gd
Requires:           %{name}-gmetad = %{version}-%{release}

%description web
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 PHP4 language.

%package gmetad
Summary:            Ganglia Metadata collection daemon
Group:              Applications/Internet
Requires:           %{name} = %{version}-%{release}
Requires(post):     /sbin/chkconfig
Requires(preun):    /sbin/chkconfig
Requires(preun):    /sbin/service

%description gmetad
Ganglia is a scalable, real-time monitoring and execution environment
with all execution requests and statistics expressed in an open
well-defined XML format.

This gmetad daemon aggregates monitoring data from several clusters
to form a monitoring grid. It also keeps metric history using rrdtool.

%package gmond
Summary:            Ganglia Monitoring daemon
Group:              Applications/Internet
Requires:           %{name} = %{version}-%{release}
Requires(post):     /sbin/chkconfig
Requires(preun):    /sbin/chkconfig
Requires(preun):    /sbin/service

%description gmond
Ganglia is a scalable, real-time monitoring and execution environment
with all execution requests and statistics expressed in an open
well-defined XML format.

This gmond daemon provides the ganglia service within a single cluster or
Multicast domain.

%package devel
Summary:            Ganglia Library
Group:              Applications/Internet
Requires:           %{name} = %{version}-%{release}

%description devel
The Ganglia Monitoring Core library provides a set of functions that
programmers can use to build scalable cluster or grid applications

%prep 
%setup -q
## Hey, those shouldn't be executable...
chmod -x lib/*.{h,x}

%build
%configure \
    --with-gmetad \
    --with-shared
## Build currently fails if enabled
    #--disable-static \

## Default to run as user ganglia instead of nobody
%{__perl} -pi.orig -e 's|nobody|ganglia|g' \
    lib/libgmond.c gmetad/conf.c gmond/g25_config.c \
    gmetad/gmetad.conf gmond/gmond.conf.html ganglia.html \
    gmond/conf.pod ganglia.pod README

## Don't have initscripts turn daemons on by default
%{__perl} -pi.orig -e 's|2345|-|g' \
    gmond/gmond.init gmetad/gmetad.init

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

## Put web files in place
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
cp -rp %{_builddir}/%{name}-%{version}/web/* $RPM_BUILD_ROOT%{_datadir}/%{name}/
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php 
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}/
ln -s ../../..%{_sysconfdir}/%{name}/conf.php \
    $RPM_BUILD_ROOT%{_datadir}/%{name}/conf.php
cat << __EOF__ > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
  #
  # Ganglia monitoring system php web frontend
  #
  
  Alias /%{name} %{_datadir}/%{name}
__EOF__

## Create directory structures
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/rrds
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5
## Put files in place
cp -p %{_builddir}/%{name}-%{version}/gmond/gmond.init 
$RPM_BUILD_ROOT/etc/rc.d/init.d/gmond
cp -p %{_builddir}/%{name}-%{version}/gmetad/gmetad.init 
$RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad
cp -p %{_builddir}/%{name}-%{version}/gmond/gmond.conf.5 
$RPM_BUILD_ROOT%{_mandir}/man5/gmond.conf.5
cp -p %{_builddir}/%{name}-%{version}/gmetad/gmetad.conf 
$RPM_BUILD_ROOT/etc/%{name}/gmetad.conf
cp -p %{_builddir}/%{name}-%{version}/mans/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/
## Build default gmond.conf from gmond using the '-t' flag
%{_builddir}/%{name}-%{version}/gmond/gmond -t > 
$RPM_BUILD_ROOT/etc/%{name}/gmond.conf
## Install binaries
make install DESTDIR=$RPM_BUILD_ROOT
## House cleaning
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_datadir}/{Makefile.am,version.php.in}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
## Add the "ganglia" user
/usr/sbin/useradd -c "Ganglia Monitoring System" \
        -s /sbin/nologin -r -d %{_localstatedir}/lib/%{name} ganglia 2> 
/dev/null || :

%post gmond
/sbin/chkconfig --add gmond

%post gmetad
/sbin/chkconfig --add gmetad

%preun gmetad
if [ "$1" = 0 ]
then
  /sbin/service gmetad stop >/dev/null 2>&1 || :
  /sbin/chkconfig --del gmetad
fi

%preun gmond
if [ "$1" = 0 ]
then
  /sbin/service gmond stop >/dev/null 2>&1 || :
  /sbin/chkconfig --del gmond
fi

%post devel -p /sbin/ldconfig

%postun devel -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS README ChangeLog
%{_libdir}/libganglia*.so.*
%{_bindir}/ganglia-config

%files gmetad
%defattr(-,root,root,-)
%dir %{_localstatedir}/lib/%{name}
%attr(0755,ganglia,ganglia) %{_localstatedir}/lib/%{name}/rrds
%{_sbindir}/gmetad
%{_mandir}/man1/gmetad.1*
%{_sysconfdir}/rc.d/init.d/gmetad
%config(noreplace) %{_sysconfdir}/%{name}/gmetad.conf

%files gmond
%defattr(-,root,root,-)
%{_bindir}/gmetric
%{_bindir}/gstat
%{_sbindir}/gmond
%{_libdir}/%{name}/mod*.so
%{_sysconfdir}/rc.d/init.d/gmond
%{_mandir}/man5/gmond.conf.5*
%{_mandir}/man1/gmond.1*
%{_mandir}/man1/gstat.1*
%{_mandir}/man1/gmetric.1*
%dir %{_sysconfdir}/%{name}/conf.d
%config(noreplace) %{_sysconfdir}/%{name}/gmond.conf

%files devel
%defattr(-,root,root,-)
%{_includedir}/ganglia*.h
%{_includedir}/gm_*.h
%{_libdir}/libganglia*.so
%exclude %{_libdir}/libganglia.a

%files web
%defattr(-,root,root,-)
%doc web/AUTHORS web/COPYING
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/conf.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
%{_datadir}/%{name}

%changelog
* Wed Feb 10 2010 Eric Shubert <[email protected]> - 3.1.2-1
- New upstream release
- packaged for rpmforge

* Tue Jan 20 2009 Kostas Georgiou <[email protected]> - 3.0.7-1
- New upstream release
- [480236] fix for a buffer overflow and an off-by-one bug in gmetad

* Mon Dec 17 2007 Jarod Wilson <[email protected]> 3.0.6-1
- New upstream release (security fix for web frontend
  cross-scripting vulnerability)

* Wed Oct 24 2007 Jarod Wilson <[email protected]> 3.0.5-2
- Reorg packages to fix multilib conflicts (#341201)

* Wed Oct 03 2007 Jarod Wilson <[email protected]> 3.0.5-1
- New upstream release

* Fri May 18 2007 Jarod Wilson <[email protected]> 3.0.4-3
- Add missing Req: php-gd so people will see nifty pie charts

* Sat Mar 24 2007 Jarod Wilson <[email protected]> 3.0.4-2
- Own created directories (#233790)

* Tue Jan 02 2007 Jarod Wilson <[email protected]> 3.0.4-1
- New upstream release

* Thu Nov 09 2006 Jarod Wilson <[email protected]> 3.0.3-11
- gmond also needs ganglia user (#214762)

* Tue Sep 05 2006 Jarod Wilson <[email protected]> 3.0.3-10
- Rebuild for new glibc

* Fri Jul 28 2006 Jarod Wilson <[email protected]> 3.0.3-9
- Add missing Reqs on chkconfig and service
- Make %%preun sections match Fedora Extras standards
- Minor %%configure tweak

* Tue Jul 11 2006 Jarod Wilson <[email protected]> 3.0.3-8
- Add missing php req for ganglia-web
- Misc tiny spec cleanups

* Tue Jun 13 2006 Jarod Wilson <[email protected]> 3.0.3-7
- Clean up documentation

* Mon Jun 12 2006 Jarod Wilson <[email protected]> 3.0.3-6
- Remove misplaced execute perms on source files

* Thu Jun 08 2006 Jarod Wilson <[email protected]> 3.0.3-5
- Whack Obsoletes/Provides, since its never been in FE before
- Use mandir macro
- Check if service is running before issuing a stop in postun
- Remove shadow-utils Prereq, its on the FE exception list

* Mon Jun 05 2006 Jarod Wilson <[email protected]> 3.0.3-4
- Run things as user ganglia instead of nobody
- Don't turn on daemons by default

* Mon Jun 05 2006 Jarod Wilson <[email protected]> 3.0.3-3
- Kill off static libs
- Add URL for Source0

* Mon Jun 05 2006 Jarod Wilson <[email protected]> 3.0.3-2
- Move web-frontend from /var/www/html/ to /usr/share/
- Make everything arch-specific

* Thu Jun 01 2006 Jarod Wilson <[email protected]> 3.0.3-1
- Initial build for Fedora Extras, converting existing spec to
  (attempt to) conform with Fedora packaging guidelines
_______________________________________________
suggest mailing list
[email protected]
http://lists.rpmforge.net/mailman/listinfo/suggest

Reply via email to