Hi Michael:

Can you actually send it as a diff from SVN?  Either send me the
output of 'svn diff' or 'diff -ru <SVN ganglia.spec file> <your spec
file>.

This will make it easier for me to tell the difference.

Thanks,

Bernard

On 4/2/07, Michael Perzl <[EMAIL PROTECTED]> wrote:
Hi Bernard,

ok, here you go.... the SPEC file as attachment.

Some remarks still:

a) Lines #39-#41 I couldn't get RPM v3.0.5 on AIX get to understand that
"%if" directive, also when I googled I think that the "%if" statement is
not supported with RPM v.3.05, so I commented those 3 lines for the moment.
b) Line #387 ("%config(noreplace) %{web_prefixdir}/conf.php") gave me
always "file listed twice" RPM errors so I commented it for the moment.

Regards,
Michael

Bernard Li wrote:
> Hi Michael:
>
> Filing a bug and attaching the patch would be nice.  Or you could just
> post it here.
>
> Thanks,
>
> Bernard
>
> On 4/2/07, Michael Perzl <[EMAIL PROTECTED]> wrote:
>> Hi Bernard,
>>
>> I now have a consolidated SPEC file (I think it is ugly :-) ), so how do
>> you want me to send it to you (I guess not posting to the mailing list
>> :-) ) ?
>>
>> Regards,
>> Michael
>>
>> Bernard Li wrote:
>> > Hi Michael:
>> >
>> > Thanks for looking into this.  Yes, I am aware the spec file may get
>> > bloated but I think ultimately this will be better for one (or more
>> > person) to manage (as opposed to managing multiple files).
>> >
>> > What do other devs/users think?
>> >
>> > BTW, I'm cc: Marcus to see if he has any specific insights on this :-)
>> >
>> > Cheers,
>> >
>> > Bernard
>> >
>> > On 4/2/07, Michael Perzl <[EMAIL PROTECTED]> wrote:
>> >> Hi Bernard,
>> >>
>> >> I took a closer look and though I think it could be done it might be
>> >> very ugly for the following reasons:
>> >>
>> >> - AIX is still using RPM version 3.0.5 and I am not aware of any
>> >> intentions to upgrade anytime soon
>> >> - Like I said I think it could be consolidated, however, that would
>> >> probably require tons of "%ifarch ppc" and "%ifnarch ppc" defines
>> which
>> >> would make the SPEC file rather hard to read
>> >> - AIX RPM is installing all the software under the /opt/freeware
>> >> directory hierarchy (to better distinguish from the AIX base
>> filesets),
>> >> therefore lots of different file locations in the SPEC file would
>> have
>> >> to "ifdef'ed" as mentioned above.
>> >> - All the Linux specific stuff like "chkconfig" would have to be
>> >> "%ifdef'ed" appropriately.
>> >>
>> >> A quick solution would probably to just rename the committed
>> >> ganglia.aix.spec to maybe ganglia.spec.aix so your rpmbuild command
>> >> doesn't get mixed up.
>> >>
>> >> I'll give it a try and see how far I get along but the end result
>> might
>> >> be ugly :-)
>> >>
>> >> Regards,
>> >> Michael
>> >>
>> >> Bernard Li wrote:
>> >> > Hi Michael:
>> >> >
>> >> > Any chance you can also work on merging the ganglia.aix.spec
>> file back
>> >> > to the mainstream .spec file?  I'm about to change configure.in to
>> >> > only include the specific spec file depending on the OS, but I
>> think
>> >> > the better solution is just to merge the two.  Right now I
>> cannot just
>> >> > generate the distribution tarball and run 'rpmbuild -ta' since
>> there
>> >> > are 2 spec files.
>> >> >
>> >> > Thanks in advance,
>> >> >
>> >> > Bernard
>> >> >
>> >> > On 4/2/07, Michael Perzl <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >>  Hi Martin,
>> >> >>
>> >> >>  if possible I would like to somehow take my version (after some
>> >> >> reviewing)
>> >> >> :-)    , as it contains all the new POWER5 stuff already.
>> >> >>
>> >> >>  My understanding is - as it would require some changes to
>> protocol.x
>> >> >> - that
>> >> >> my changes won't have a chance to get into the core Ganglia source
>> >> code
>> >> >> until version 3.1 comes along.
>> >> >>
>> >> >>  This code and everything else (RPMs) can be found on my website
>> >> >> http://www.perzl.org/ganglia/.
>> >> >>
>> >> >>  This stuff is actually in use at quite many customer sites
>> already
>> >> >> (runs on
>> >> >> AIX 4.3.3, 5.1, 5.2 and 5.3) so I would like to keep that
>> >> >> POWER5-stuff in if
>> >> >> possible. Actually, an AIX gmond implementation without the
>> >> POWER5-stuff
>> >> >> based on my implementation could be done very easy (just stripping
>> >> >> off the
>> >> >> POWER5-addons).
>> >> >>
>> >> >>  Regards,
>> >> >>  Michael
>> >> >>
>> >> >>  Martin Knoblauch wrote:
>> >> >>  Michael, Andreas,
>> >> >>
>> >> >>  any chance that you could consolidate the two versions of the AIX
>> >> >> metrics that seem to be around? Seem you are the ones who have
>> worked
>> >> >> most recently on the AIX implementation.
>> >> >>
>> >> >> Cheers
>> >> >> Martin
>> >> >>
>> >> >> --- Michael Perzl <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >>
>> >> >>
>> >> >>  Andreas,
>> >> >>
>> >> >> thank you for taking the blame but you are off the hook here. ;-)
>> >> >>
>> >> >> If I understood David correctly, he is using my AIX Ganglia RPM
>> >> >> packages
>> >> >> with POWER5 extensions. Here most if not all implementation of how
>> >> >> the
>> >> >> metrics are collected under AIX have been changed. Everything is
>> >> >> documented on my homepage (http://www.perzl.org/ganglia/) though.
>> >> >> So everything what goes wrong here is entiremy my fault :-[
>> >> >>
>> >> >> After some investigating and some discussions with Nigel I have
>> come
>> >> >> to
>> >> >> terms with the following facts regarding the bytes_in/bytes_out
>> >> >> problem:
>> >> >> - libperfstat (the library on AIX which obtains all the system
>> >> >> performance data) uses u_longlong_t data types (these are
>> definitely
>> >> >> 64-bit large).
>> >> >> - The AIX kernel internally, though, may probably not be using
>> 64-bit
>> >> >>
>> >> >> data types - more realistic is probably unsigned 32-bit - in order
>> >> >> not
>> >> >> to break compatibility (my personal opinion)
>> >> >> - The consequence now is that integer overrun may occur much
>> easier
>> >> >> with
>> >> >> 32-bit data types than with 64-bit data types (we all probably
>> don't
>> >> >> live long enough to see that happen).
>> >> >>
>> >> >> Please take a look at my implementation of the bytes_in metric
>> (the
>> >> >> bytes_out implementation is accordingly):
>> >> >>
>> >> >> 01 g_val_t
>> >> >> 02 bytes_in_func( void )
>> >> >> 03 {
>> >> >> 04 g_val_t val;
>> >> >> 05 perfstat_netinterface_total_t n;
>> >> >> 06 static u_longlong_t last_bytes_in = 0, bytes_in;
>> >> >> 07 static double last_time = 0.0;
>> >> >> 08 double now, delta_t;
>> >> >> 09 struct timeval timeValue;
>> >> >> 10 struct timezone timeZone;
>> >> >> 11
>> >> >> 12 gettimeofday( &timeValue, &timeZone );
>> >> >> 13
>> >> >> 14 now = (double) (timeValue.tv_sec - boottime) +
>> >> >> (timeValue.tv_usec
>> >> >> / 1000000.0);
>> >> >> 15
>> >> >> 16 if (perfstat_netinterface_total( NULL, &n, sizeof(
>> >> >> perfstat_netinterface_total_t ), 1 ) == -1)
>> >> >> 17 val.f = 0.0;
>> >> >> 18 else
>> >> >> 19 {
>> >> >> 20 bytes_in = n.ibytes;
>> >> >> 21
>> >> >> 22 delta_t = now - last_time;
>> >> >> 23
>> >> >> 24 if ( delta_t )
>> >> >> 25 val.f = (double) (bytes_in - last_bytes_in) / delta_t;
>> >> >> 26 else
>> >> >> 27 val.f = 0.0;
>> >> >> 28
>> >> >> 29 last_bytes_in = bytes_in;
>> >> >> 30 }
>> >> >> 31
>> >> >> 32 last_time = now;
>> >> >> 33
>> >> >> 34 return( val );
>> >> >> 35 }
>> >> >>
>> >> >> In my opinion the overrun occurs in line #25 when "bytes_in <
>> >> >> last_bytes_in".
>> >> >> In my naivity I had assumed as both are of type u_longlong_t
>> that an
>> >> >> integer overrun might never happen.
>> >> >>
>> >> >> So to solve the overrun a check for "bytes_in < last_bytes_in"
>> must
>> >> >> be
>> >> >> introduced, something like:
>> >> >>
>> >> >> u_longlong_t d;
>> >> >> d = bytes_in - last_bytes_in;
>> >> >> if (d < 0) d += ULONG_MAX;
>> >> >>
>> >> >> and line #25 would essentially become
>> >> >> 25 val.f = (double) d / delta_t;
>> >> >>
>> >> >> Comments ?
>> >> >>
>> >> >> Regards,
>> >> >> Michael
>> >> >>
>> >> >> PS: David, the reason why you don't see it happen with pkts_in and
>> >> >> pkts_out is that probably no overrun so far has occurred but at
>> some
>> >> >> point it will also happen.
>> >> >>
>> >> >> PPS: David, if this is a solution (I want some comments on that
>> >> >> before,
>> >> >> though) then I would be building new RPMs with the then hopefully
>> >> >> correct code.
>> >> >>
>> >> >> Andreas Schoenfeld wrote:
>> >> >>
>> >> >>
>> >> >>  Hi David and Martin,
>> >> >>
>> >> >> I suppose the network code is still the code I wrote, so there are
>> >> >>
>> >> >>  two
>> >> >>
>> >> >>
>> >> >>  problems I know of:
>> >> >> 1. yes there is a problem with owerflows
>> >> >> 2. the shown network traffic is the sum of all network interfaces
>> >> >> including local loopback devices (lo0...).
>> >> >>
>> >> >> Both Problems could lead to astonishing data transfer rate in
>> >> >>
>> >> >>  ganglia.
>> >> >>
>> >> >>
>> >> >>  Sorry I had promised to fix the problems, but there was to much
>> >> >>
>> >> >>  other
>> >> >>
>> >> >>
>> >> >>  work ...
>> >> >>
>> >> >> Best regards
>> >> >>  Andreas
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  Date: Thu, 29 Mar 2007 08:21:38 -0700 (PDT)
>> >> >> From: Martin Knoblauch <[EMAIL PROTECTED]>
>> >> >> Subject: Re: [Ganglia-general] Help! I have a petabyte/s network
>> >> >> To: David Wong <[EMAIL PROTECTED]>,
>> >> >>
>> >> >>  [EMAIL PROTECTED],
>> >> >>
>> >> >>
>> >> >>
>> >> >>  [EMAIL PROTECTED]
>> >> >> Message-ID: <[EMAIL PROTECTED]>
>> >> >> Content-Type: text/plain; charset=iso-8859-1
>> >> >>
>> >> >> David,
>> >> >>
>> >> >>  good catch. I will have to look at it for a bit.
>> >> >>
>> >> >> Cheers
>> >> >> Martin
>> >> >> --- David Wong <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  I don't write much code nowadays, so I'm going to need a lot of
>> >> >>
>> >> >>  help
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  with this.
>> >> >>
>> >> >> I dug through the ganglia code and I found this interesting
>> >> >>
>> >> >>  tidbit in
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  libmetrics/aix/metrics.c which may be indicative of the problem.
>> >> >>
>> >> >> There's an assignment from cur_ninfo.ibytes to
>> >> >>
>> >> >>  cur_net_stat.ibytes,
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  but
>> >> >> the types of the two variables are different.
>> >> >>
>> >> >> net_stat::ibytes is a double:
>> >> >>
>> >> >> struct net_stat{
>> >> >>  double ipackets;
>> >> >>  double opackets;
>> >> >>  double ibytes;
>> >> >>  double obytes;
>> >> >> } cur_net_stat;
>> >> >>
>> >> >> and we have *ninfo declared here:
>> >> >>
>> >> >> perfstat_netinterface_total_t ninfo[2],*last_ninfo, *cur_ninfo ;
>> >> >>
>> >> >> libperfstat.h has perfstat_netinterface_total_t::ibytes as
>> >> >> u_longlong_t.
>> >> >>
>> >> >> Does this code try to do what I think it is doing, i.e. assign
>> >> >>
>> >> >>  an
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  unsigned 64 bit integer to a signed 64bit integer?
>> >> >>
>> >> >> I'm willing to test the code if someone who's more adept at
>> >> >>
>> >> >>  coding
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  and
>> >> >> building will take on the challenge.
>> >> >>
>> >> >> It looks to me that the type mismatch will have to fixed in a
>> >> >>
>> >> >>  few
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  places, such as CALC_NETSTAT, and we'll have to add an unsigned
>> >> >>
>> >> >>  long
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>  long to g_val_t too. Those are the ones I can see so far.
>> >> >>
>> >> >> David Wong
>> >> >> Senior Systems Engineer
>> >> >> Management Dynamics, Inc.
>> >> >> Phone: 201-804-6127
>> >> >> [EMAIL PROTECTED]
>> >> >>
>> >> >> -----Original Message-----
>> >> >> From: Martin Knoblauch [mailto:[EMAIL PROTECTED]
>> >> >> Sent: Wednesday, March 28, 2007 12:00 PM
>> >> >> To: David Wong; [EMAIL PROTECTED]
>> >> >> Subject: Re: [Ganglia-general] Help! I have a petabyte/s network
>> >> >>
>> >> >> David,
>> >> >>
>> >> >>  as far as I remember, the AIX metrics code had an
>> >> >> overflow/wrap-around
>> >> >> problem prior to 3.0.4. Maybe the fixes are not thorough enough.
>> >> >>
>> >> >>  The packets/sec are of course less affected.
>> >> >>
>> >> >> Cheers
>> >> >> Martin
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> ------------------------------------------------------
>> >> >> Martin Knoblauch
>> >> >> email: k n o b i AT knobisoft DOT de
>> >> >> www: http://www.knobisoft.de
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> -------------------------------------------------------------------------
>>
>> >>
>> >> >>
>> >> >> Take Surveys. Earn Cash. Influence the Future of IT
>> >> >> Join SourceForge.net's Techsay panel and you'll get the chance to
>> >> >> share your
>> >> >> opinions on IT & business topics through brief surveys-and earn
>> cash
>> >> >>
>> >>
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>
>> >>
>> >> >>
>> >> >> _______________________________________________
>> >> >> Ganglia-developers mailing list
>> >> >> Ganglia-developers@lists.sourceforge.net
>> >> >> https://lists.sourceforge.net/lists/listinfo/ganglia-developers
>> >> >>
>> >> >>
>> >> >
>> >>
>> >
>>
>

#
# $Id: ganglia.spec.in 689 2006-12-01 14:05:16Z efocht $
#
# ganglia.spec.  Generated from ganglia.spec.in by configure.
#
# IMPORTANT NOTE:
# This spec file has a noarch section.  RPM is braindead in that it cannot
# build mixed architecture packages.  As a workaround, you must build
# the RPMs using the following commandline
#
# % rpmbuild -ta --target noarch,i386 ganglia-3.0.4.tar.gz
#
Summary: Ganglia Distributed Monitoring System
Name: ganglia
Version: 3.0.4
URL: http://ganglia.info/
Release: 1
License: BSD
Vendor: Ganglia Development Team <ganglia-developers@lists.sourceforge.net>
Group: System Environment/Base

Source: %{name}-%{version}.tar.gz
%ifarch ppc
Source1: gmond.aix.init
Source2: gmetad.aix.init
%endif

Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root

%ifarch ppc
Prefix: /opt/freeware
%else
Prefix: /usr
%endif

%ifnarch noarch
%ifnarch ppc
BuildRequires: libpng-devel, libart_lgpl-devel, gcc-c++
##%if %{?suse_version:1}0
##BuildRequires: rrdtool, freetype2-devel
##%endif
%endif
%ifarch ppc
BuildRequires: rrdtool-devel
%else
BuildRequires: rrdtool-devel, freetype-devel
%endif
%endif

%description
Ganglia is a scalable, real-time monitoring and execution environment

######################################################################
################## noarch section ####################################
######################################################################
%ifarch noarch
%package web
Summary: Ganglia Web Frontend
Group: System Environment/Base
Obsoletes: ganglia-webfrontend
Provides: ganglia-webfrontend
# We should put rrdtool as a Requires too but rrdtool rpm support is very weak
# so most people install from source
#Requires: ganglia-gmetad >=  3.0.4
%define web_prefixdir /var/www/html/ganglia
Prefix: %{web_prefixdir}

%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.

#######################################################################
#######################################################################
%else

%package gmetad
Summary: Ganglia Meta daemon http://ganglia.sourceforge.net/
Group: System Environment/Base
Obsoletes: ganglia-monitor-core-gmetad ganglia-monitor-core

%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 Monitor daemon http://ganglia.sourceforge.net/
Group: System Environment/Base
Obsoletes: ganglia-monitor-core-gmond ganglia-monitor-core

%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 http://ganglia.sourceforge.net/
Group: System Environment/Base
Obsoletes: ganglia-monitor-core-lib

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

%endif

##
## PREP
##

%prep
%setup

##
## BUILD
##
%build
%ifarch x86_64
./configure --prefix=/usr --with-gmetad --libdir=/usr/lib64
%endif
%ifarch ppc
export CC=xlc_r
export CFLAGS="-O"
./configure --prefix=/opt/freeware --disable-shared --enable-static 
CFLAGS="-I/opt/freeware/include" CPPFLAGS="-I/opt/freeware/include" 
LDFLAGS="-L/opt/freeware/lib" --with-gmetad
make
## this is necessary to get around the stupid gmetad shared library link to expa
t
cd srclib/expat
make clean
./configure --prefix=/opt/freeware --disable-shared --enable-static
cd ../..
cd gmetad
make clean
cd ..
%else
./configure --prefix=/usr --with-gmetad
%endif
%ifnarch noarch
make
%endif

##
## PRE
##
%pre

%ifnarch noarch
##
## POST GMETA
##
%post gmetad
%ifnarch ppc
/sbin/chkconfig --add gmetad

if [ "$1" == "1" ]; then
   # Installing new package - start gmetad
   /etc/init.d/gmetad start
elif [ "$1" -gt "1" ]; then
   # Upgrading ganglia package - restart gmetad
   /etc/init.d/gmetad restart
fi
%endif


##
## POST GMOND
##
%post gmond
%ifnarch ppc
/sbin/chkconfig --add gmond

if [ "$1" == "1" ]; then
   # Installing new package - start gmond
   /etc/init.d/gmond start
elif [ "$1" -gt "1" ]; then
   # Upgrading ganglia package - restart gmond
   /etc/init.d/gmond restart
fi

`rpm -q ganglia-monitor-core-gmond| grep "is not installed" > /dev/null 2>&1`
if [[ $? != 0 ]]; then
  # They have an old configuration file format
  echo "-----------------------------------------------------------"
  echo "IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT"
  echo "-----------------------------------------------------------"
  echo "It appears that you are upgrading from ganglia gmond version"
  echo "2.5.x.  The configuration file has changed and you need to "
  echo "convert your old 2.5.x configuration file to the new format."
  echo ""
  echo "To convert your old configuration file to the new format"
  echo "simply run the command:"
  echo ""
  echo "% gmond --convert old.conf > new.conf"
  echo ""
  echo "This conversion was not made automatic to prevent unknowningly"
  echo "altering your configuration without your notice."
fi
%endif


##
## PREUN GMETA
##
%preun gmetad
if [ "$1" = 0 ]
then
%ifnarch ppc
   /etc/init.d/gmetad stop
   /sbin/chkconfig --del gmetad
%else
   /etc/rc.d/init.d/gmetad stop
%endif
fi

##
## PREUN GMON
##
%preun gmond
if [ "$1" = 0 ]
then
%ifnarch ppc
   /etc/init.d/gmond stop
   /sbin/chkconfig --del gmond
%else
   /etc/rc.d/init.d/gmond stop
%endif
fi

#ifnarch noarch
%endif

##
## INSTALL
##
%install
## Flush any old RPM build root
%__rm -rf $RPM_BUILD_ROOT

%ifarch noarch

%__mkdir -p $RPM_BUILD_ROOT/%{web_prefixdir}
%__cp -rf %{_builddir}/%{name}-%{version}/web/* $RPM_BUILD_ROOT/%{web_prefixdir}

%else

%ifnarch ppc

## Create the directory structure
%__mkdir -p $RPM_BUILD_ROOT/etc/init.d
%__mkdir -p $RPM_BUILD_ROOT/var/lib/ganglia/rrds
%__mkdir -p $RPM_BUILD_ROOT/usr/share/man/man5

## Move the files into the structure
if [ -f /etc/SuSE-release ]; then
   %__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.init.SuSE 
$RPM_BUILD_ROOT/etc/init.d/gmond
   %__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.init.SuSE 
$RPM_BUILD_ROOT/etc/init.d/gmetad
else
   %__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.init 
$RPM_BUILD_ROOT/etc/init.d/gmond
   %__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.init 
$RPM_BUILD_ROOT/etc/init.d/gmetad
fi

# We just output the default gmond.conf from gmond using the '-t' flag
%{_builddir}/%{name}-%{version}/gmond/gmond -t > $RPM_BUILD_ROOT/etc/gmond.conf
%__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.conf 
$RPM_BUILD_ROOT/etc/gmetad.conf

%__make DESTDIR=$RPM_BUILD_ROOT install
%__make -C gmond gmond.conf.5
%__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.conf.5 
$RPM_BUILD_ROOT/usr/share/man/man5/gmond.conf.5

%else

make DESTDIR=$RPM_BUILD_ROOT install

## Create the directory structure
%__mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
%__mkdir -p $RPM_BUILD_ROOT/var/lib/ganglia/rrds
%__mkdir -p $RPM_BUILD_ROOT/opt/freeware/man/man5

## Move the files into the structure
%__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.init $RPM_BUILD_ROOT/etc/rc
.d/init.d/gmond
%__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.init $RPM_BUILD_ROOT/etc/
rc.d/init.d/gmetad
# We just output the default gmond.conf from gmond using the '-t' flag
%{_builddir}/%{name}-%{version}/gmond/gmond -t > $RPM_BUILD_ROOT/etc/gmond.conf
%__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.conf $RPM_BUILD_ROOT/etc/
gmetad.conf

%__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.conf.5 $RPM_BUILD_ROOT/opt/
freeware/man/man5/gmond.conf.5

mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmond
install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad

mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/
ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/Sgmond
ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/Kgmond
ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/Sgmond
ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/Kgmond
ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/Sgmetad
ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/Kgmetad
ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/Sgmetad
ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/Kgmetad

%endif

%endif

%ifnarch noarch
##
## FILES GMETA
##

%files gmetad
%defattr(-,root,root)
%attr(0755,nobody,nobody)/var/lib/ganglia/rrds
%ifnarch ppc
/usr/sbin/gmetad
/etc/init.d/gmetad
%else
/opt/freeware/sbin/gmetad
/etc/rc.d/init.d/gmetad
/etc/rc.d/rc2.d/Sgmetad
/etc/rc.d/rc2.d/Kgmetad
/etc/rc.d/rc3.d/Sgmetad
/etc/rc.d/rc3.d/Kgmetad
%endif
%config(noreplace) /etc/gmetad.conf


##
## FILES GMOND
##
%files gmond
%defattr(-,root,root)
%ifnarch ppc
%attr(0500,root,root)/usr/bin/gmetric
%attr(0555,root,root)/usr/bin/gstat
/usr/sbin/gmond
/etc/init.d/gmond
%attr(0555,root,root)/usr/share/man/man5/gmond.conf.5*
%else
%attr(0500,root,root)/opt/freeware/bin/gmetric
%attr(0555,root,root)/opt/freeware/bin/gstat
/opt/freeware/sbin/gmond
%attr(0555,root,root)/opt/freeware/man/man5/gmond.conf.5*
%config(noreplace) /etc/gmond.conf
/etc/rc.d/init.d/gmond
/etc/rc.d/rc2.d/Sgmond
/etc/rc.d/rc2.d/Kgmond
/etc/rc.d/rc3.d/Sgmond
/etc/rc.d/rc3.d/Kgmond
%endif
%config(noreplace) /etc/gmond.conf

##
## FILES DEVEL
##
%files devel
%ifnarch ppc
/usr/include/ganglia.h
/usr/%{_lib}/libganglia*
/usr/bin/ganglia-config
%else
/opt/freeware/include/ganglia.h
/opt/freeware/lib/libganglia*
/opt/freeware/bin/ganglia-config
%endif

%else

##
## FILES WEB
##
%files web
%defattr(-,root,root)
%{web_prefixdir}
####%config(noreplace) %{web_prefixdir}/conf.php

%endif

##
## CLEAN
##
%clean
%__rm -rf $RPM_BUILD_ROOT

##
## CHANGELOG
##
%changelog
* Mon Aug 28 2006 Bernard Li <[EMAIL PROTECTED]>
- Added gcc-c++ to BuildRequires
* Sun Jul 23 2006 Bernard Li <[EMAIL PROTECTED]>
- Changed make install prefix=$RPM_BUILD_ROOT/usr to
  make DESTDIR=$RPM_BUILD_ROOT install (suggested by Jarod Wilson
  <[EMAIL PROTECTED]>)
* Mon Jun 05 2006 Bernard Li <[EMAIL PROTECTED]>
- Changed /etc/rc.d/init.d -> /etc/init.d
* Mon May 22 2006 Bernard Li <[EMAIL PROTECTED]>
- Add rrdtool/rrdtool-devel, freetype2-devel/freetype-devel,
  libart_lgpl-devel to BuildRequires
- Use /usr/lib64 for x86_64
* Sun May 21 2006 Bernard Li <[EMAIL PROTECTED]>
- Correct init scripts dir for SuSE
- Add BuildRequires for libpng-devel
* Fri Feb 25 2006 Bernard Li <[EMAIL PROTECTED]>
- Use SuSE specific init scripts if /etc/SuSE-release file exists
* Fri Dec 10 2004 Matt Massie <[EMAIL PROTECTED]>
- Updated the spec file for 2.6.0 release
* Tue Apr 13 2004 Brooks Davis <[EMAIL PROTECTED]>
- Use the autoconf variable varstatedir instead of /var/lib for consistancy.
* Thu Feb 19 2004 Matt Massie <[EMAIL PROTECTED]>
- Removed the /usr/include/ganglia directory from the lib rpm and
  changed the deprecated Copyright to License
* Mon Oct 14 2002 Federico Sacerdoti <[EMAIL PROTECTED]>
- Split package into -gmetad and -gmond subpackages for clarity,
  and separation of purpose/functionality.
* Thu Sep 19 2002 Federico Sacerdoti <[EMAIL PROTECTED]>
- Added config files, made /var/lib/ganglia for RRD storage.
* Mon Mar 11 2002 Matt Massie <[EMAIL PROTECTED]>
- Added support for libganglia, added Prefix: for RPM relocation
* Wed Feb 27 2002 Matt Massie <[EMAIL PROTECTED]>
- Merge gmetric and gmond together into one RPM.  Fix some small bugs.
* Fri Nov  2 2001 Matt Massie <[EMAIL PROTECTED]>
- initial release



Reply via email to