Hi Rick: On 10/12/07, Richard Mohr <[EMAIL PROTECTED]> wrote:
> See below. I don't know if this is the best way to do it, but I think > it should work. (I can't be 100% sure since I don't have a system at > the moment which has the necessary pre-reqs for building 3.1.0.) > > The patches were generated against the svn trunk. Also, these patches > will only work if you also apply your "spec clean-up" patch that you > posted to the mailing list. Otherwise, the references to % > {_buildroot}/%{name}-%{version} will cause problems. <snip> > --- configure.in.orig 2007-10-12 13:02:09.000000000 -0400 > +++ configure.in 2007-10-12 13:01:43.000000000 -0400 > @@ -75,6 +75,9 @@ > AC_SUBST(GANGLIA_MICRO_VERSION) > AC_SUBST(GANGLIA_VERSION) > AC_SUBST(GANGLIA_RELEASE_NAME) > +AC_SUBST(GANGLIA_SNAPSHOT) > +AC_SUBST(GANGLIA_SNAPSHOT_DATE) > + > > AC_SUBST(LIBGANGLIA_INTERFACE_AGE) > AC_SUBST(LIBGANGLIA_BINARY_AGE) > > --- ganglia.spec.in.orig 2007-10-12 13:05:59.000000000 -0400 > +++ ganglia.spec.in 2007-10-12 13:05:49.000000000 -0400 > @@ -10,15 +10,25 @@ > # > # % rpmbuild -ta --target noarch,i386 [EMAIL PROTECTED]@.tar.gz > # > + > +%define src_version @VERSION@ > +%define rpm_version @[EMAIL PROTECTED]@[EMAIL > PROTECTED]@GANGLIA_MICRO_VERSION@ > + > +%if %(test [EMAIL PROTECTED]@ = xyes && echo 1 || echo 0) > +%define rpm_release [EMAIL PROTECTED]@ > +%else > +%define rpm_release 1 > +%endif > + > Summary: Ganglia Distributed Monitoring System > Name: @PACKAGE@ > -Version: @VERSION@ > +Version: %{rpm_version} > URL: http://ganglia.info/ > -Release: 1 > +Release: %{rpm_release} > License: BSD > Vendor: Ganglia Development Team <ganglia-developers@lists.sourceforge.net> > Group: System Environment/Base > -Source: %{name}-%{version}.tar.gz > +Source: %{name}-%{src_version}.tar.gz > Buildroot: /tmp/%{name}-%{version}-buildroot > Prefix: /usr > BuildRequires: libpng-devel, libart_lgpl-devel, gcc-c++, python-devel > @@ -102,7 +112,7 @@ > ## > > %prep > -%setup > +%setup -n %{name}-%{src_version} > > ## > ## BUILD Thanks for the patch, here's my take on it which is quite similar except the logic is in configure.in rather than in the spec file: Index: configure.in =================================================================== --- configure.in (revision 861) +++ configure.in (working copy) @@ -64,10 +64,14 @@ if test "$GANGLIA_SNAPSHOT" != yes; then GANGLIA_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION +RPM_RELEASE=1 else GANGLIA_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION.$GANGLIA_SNAPSHOT_DATE +RPM_RELEASE=0.$GANGLIA_SNAPSHOT_DATE fi +RPM_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION + AM_INIT_AUTOMAKE(ganglia, $GANGLIA_VERSION) AC_SUBST(GANGLIA_MAJOR_VERSION) @@ -75,6 +79,8 @@ AC_SUBST(GANGLIA_MICRO_VERSION) AC_SUBST(GANGLIA_VERSION) AC_SUBST(GANGLIA_RELEASE_NAME) +AC_SUBST(RPM_VERSION) +AC_SUBST(RPM_RELEASE) AC_SUBST(LIBGANGLIA_INTERFACE_AGE) AC_SUBST(LIBGANGLIA_BINARY_AGE) Index: ganglia.spec.in =================================================================== --- ganglia.spec.in (revision 861) +++ ganglia.spec.in (working copy) @@ -12,13 +12,13 @@ # Summary: Ganglia Distributed Monitoring System Name: @PACKAGE@ -Version: @VERSION@ +Version: @RPM_VERSION@ URL: http://ganglia.info/ -Release: 1 +Release: @RPM_RELEASE@ License: BSD Vendor: Ganglia Development Team <ganglia-developers@lists.sourceforge.net> Group: System Environment/Base -Source: %{name}-%{version}.tar.gz +Source: [EMAIL PROTECTED]@.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: libpng-devel, libart_lgpl-devel, gcc-c++, python-devel, libconfuse-devel %if 0%{?suse_version} @@ -133,7 +133,7 @@ %endif %prep -%setup +%setup -n [EMAIL PROTECTED]@ %build %configure --with-gmetad --enable-python What do you think? BTW, Jarod, darix, please do comment on this patch and let me know if it makes sense. I have tested it with snapshot = yes and no, so it works both ways. The only downside is that the RPM Release is always 1, if it is an official release (i.e. non-snapshot). Cheers, Bernard ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers