Ahh... well that at least explains why everything is hardcoded.
I suppose from the way you that was worded that no one is likely to
discuss that process... dare I ask why it's done that way?
If it isn't up for debate, can I suggest not distributing the
heartbeat.spec file at all, but instead only the heartbeat.spec.in, as
there is no way for someone to know that the spec file is indended to
only be generated from the packaging.
Also... (ok, I guess I am arguing now. sorry, I know I'm new on the
list) the source RPM does not work if you do things this way. The spec
file distributed isn't flexible enough since it was generated from
someone's ConfigureMe script. So where you think you could do a
rpmbuild --rebuild heartbeat-2.0.7-1.src.rpm, you will be sorely
disappointed on any 32-bit machine. I would argue that this is a
broken SRPM.
Configure should configure the software. An rpm spec file should run
configure to configure the software based on the system-wide RPM
settings.
I'd be happy to work on (or help work on) a way to make a spec file
that works out of the box, but also could still be used with the
ConfigureMe workflow you are using now, if that's important. I'm sure
it could be accomplished with some macros at the top of the spec.in.
Oh, lest I be though completely rude, thanks for the fantastic
software! I install and use it with new people every week, otherwise I
wouldn't feel quite so strongly one way or the other. :)
Even if it is unlikely to get applied - here's a version of the patch
going the right way.
Monty
On 8/17/06, Andrew Beekhof <[EMAIL PROTECTED]> wrote:
On 8/17/06, Monty Taylor <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I just realized that I may have replied to an old message and caused
> what I sent to get buried in the past of a threaded client. :) So here
> it is again... sorry for the repost if you had already seen it. I've
> been seeing discussion of spec file work, so I thought I'd jump and
> down a little before I have more merging work to do.
>
> I've been hacking on the spec file for a little while and figured I
> should maybe start sharing. I wind up building RPMs at client sites
> almost every week. (I know - I could just set up a repository - but
> where's the fun in that)
>
> I had a problem building on 32-bit installs, since the /usr/lib64
> location is hardcoded in to several places. So I replaced most of the
> locations with location macros. The spec file I've been using is
> expecting redhat-rpm-config to be installed... which obviously won't
> be on SuSE, but I'm not sure what, if any equivilent package SuSE has.
> So I'd love feedback on that. (I tried to instal SuSE in a VMWare, but
> apparently doing an internet-basd single CD install isn't so easy with
> SuSE... so I'll do it later) There is still a bug I'm trying to track
> down where I don't think some of the files are being installed by make
> install into the build root, but are actually going into the normal
> tree. But I haven't found it yet. You only notice it the second time
> you try to build on a box.
>
> I also did some more magic with the snmp subagent and the mgmt client.
> They both now support a --with option to rpmbuild. So you can do
> rpmbuild --with snmp -ba heartbeat.spec. I defaulted snmp to on and
> mgmt to off, just because that's what works for me in most places. I
> did my best to make the prereqs and reqs change with that choice,
> although I haven't tested that 100% in a jail or anything.
>
> Some of the magic is still a little ugly. I think there are too many
> macros up there... not for functionality, but just stylistically, it
> looks really ugly. I'll try to clean that up some. But it works and
> has the intended behavior.
>
> I agree that the glib-devel and glib2-devel thing is odd - but I
> haven't tested that yet, either. It's on the list.
>
> I'd love feedback... this all works for me, but if there is a reason
> we don't want to do this, I'd love to understand it.
>
> AND - I just realized that I diffed in the wrong direction. :( I'll
> fix that in just a bit - I'm on the wrong machine ATM.
Nod - took me a few minutes to figure that out.
Seemed like an odd patch otherwise... replacing variables with
hardcoded values :-)
While I heartily agree with the patch in principle, the policy of the
project is to generate the .spec file with configure (which, um, then
calls configure - go figure).
So your patch is unlikely to be applied I'm afraid :(
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--- heartbeat-2.0.7/heartbeat.spec 2006-08-14 00:38:40.000000000 -0400
+++ heartbeat.spec 2006-08-16 12:43:20.000000000 -0400
@@ -1,9 +1,38 @@
-# $Id: heartbeat.spec.in,v 1.196 2006/08/14 04:22:04 alan Exp $
+# $Id: heartbeat.spec.in,v 1.188 2006/07/13 16:32:18 alan Exp $
%define _unpackaged_files_terminate_build 1
%define _missing_doc_files_terminate_build 1
-%define ENABLE_MGMT 1
-%define ENABLE_SNMP_SUBAGENT 1
+
+# Setup defaults
+%{!?_with_mgmt: %{!?_without_mgmt: %define _without_mgmt --disable-mgmt}}
+%{!?_with_snmp: %{!?_without_snmp: %define _with_snmp --enable-snmp-subagent}}
+
+%{?_without_snmp: %define _without_snmp --disable-snmp-subagent}
+%{?_with_mgmt: %define _with_mgmt --enable-mgmt}
+
+# use "rpmbuild --with mgmt" or "rpm --define '_with_mgmt 1'" (for RPM 3.x)
+# to enable GUI Management Client (disabled by default)
+%{?_with_mgmt:%define ENABLE_MGMT 1}
+%{!?_with_mgmt:%define ENABLE_MGMT 0}
+
+# use "rpmbuild --without snmp" or "rpm --define '_without_snmp 1'" (for RPM 3.x)
+# to enable SNMP Subagent (enabled by default)
+%{?_with_snmp:%define ENABLE_SNMP_SUBAGENT 1}
+%{!?_with_snmp:%define ENABLE_SNMP_SUBAGENT 0}
+
+%if %{ENABLE_SNMP_SUBAGENT}
+%define snmp_prereq net-snmp-devel, bzip2-devel, lm_sensors-devel, libselinux-devel
+%define snmp_req net-snmp, bzip2, lm_sensors, libselinux
+%else
+%define snmp_req ,
+%define snmp_prereq ,
+%endif
+
+%if %{ENABLE_MGMT}
+%define mgmt_req libglade2, python-gtk
+%else
+%define mgmt_req ,
+%endif
Summary: heartbeat - The Heartbeat Subsystem for High-Availability Linux
Name: heartbeat
@@ -13,11 +42,12 @@
URL: http://linux-ha.org/
Group: Utilities
Packager: Alan Robertson <[EMAIL PROTECTED]>
-Source: http://linux-ha.org/download/heartbeat-2.0.7.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
-BuildPrereq: glib-devel, , perl, iputils, /usr/bin/ssh, openssl-devel, libnet
+Source: http://linux-ha.org/download/heartbeat-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildPrereq: glib-devel, perl, iputils, /usr/bin/ssh, openssl-devel, libnet, pkgconfig, glib2-devel, ncurses-devel, python-devel, gnutls-devel, %{snmp_prereq}
+
# libnet available from www.ultramonkey.org and others
-Requires: sysklogd, heartbeat-stonith = %{version}-%{release}, heartbeat-pils = %{version}-%{release}, libglade2, python-gtk
+Requires: sysklogd, heartbeat-stonith = %{version}-%{release}, heartbeat-pils = %{version}-%{release}, gnutls, ncurses, libnet, %{mgmt_req}, %{snmp_req}
BuildRequires: libgcrypt-devel
%package ldirectord
@@ -149,7 +179,6 @@
themselves and don't appear to be harmful. They typically
include a message something like this:
WARN: Ignoring HA message (op=vote) from XXX: not in our membership list
-
* Thu Jul 13 2006 Alan Robertson <[EMAIL PROTECTED]> (see doc/AUTHORS file)
+ Version 2.0.6 - bug fix and a few enhancements release
+ Added the ability to start/stop groups from the GUI
@@ -1326,7 +1355,23 @@
#
#CFLAGS="${RPM_OPT_FLAGS}" \
# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
-./configure '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--with-group-id=90' '--with-ccmuser-id=90' '--libexecdir=/usr/lib64' '--libdir=/usr/lib64' '--disable-ansi' '--enable-mgmt' '--enable-bundled_ltdl' '--enable-snmp-subagent' 'CFLAGS= -fno-unit-at-a-time' --enable-ltdl-convenience
+%if %{ENABLE_MGMT}
+config_flags="${config_flags} --enable-mgmt "
+%else
+config_flags="${config_flags} --disable-mgmt "
+%endif
+
+%if %{ENABLE_SNMP_SUBAGENT}
+config_flags="${config_flags} --enable-snmp-subagent "
+%else
+config_flags="${config_flags} --disable-snmp-subagent "
+%endif
+
+CFLAGS="${RPM_OPT_FLAGS} -fno-unit-at-a-time" \
+%configure '--with-group-id=90' '--with-ccmuser-id=90' '--disable-ansi' '--enable-bundled_ltdl' '--enable-ltdl-convenience' ${config_flags}
+#./configure '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--with-group-id=90' '--with-ccmuser-id=90' '--libexecdir=/usr/lib64' '--libdir=/usr/lib64' '--disable-ansi' '--enable-mgmt' '--enable-bundled_ltdl' '--enable-snmp-subagent' 'CFLAGS= -fno-unit-at-a-time' --enable-ltdl-convenience
+
+CFLAGS="${RPM_OPT_FLAGS} -fno-unit-at-a-time" \
make
###########################################################
@@ -1335,97 +1380,97 @@
#make DESTDIR=$RPM_BUILD_ROOT install-strip
make DESTDIR=$RPM_BUILD_ROOT install
(
- cd $RPM_BUILD_ROOT/etc/ha.d/resource.d
- ln -s /usr/sbin/ldirectord ldirectord
+ cd $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
+ ln -s %{_sbindir}/ldirectord ldirectord
)
%if %{ENABLE_MGMT}
-ln -s /usr/lib64/heartbeat/haclient.py $RPM_BUILD_ROOT/usr/bin/hb_gui
+ln -s %{_libdir}/heartbeat/haclient.py $RPM_BUILD_ROOT/usr/bin/hb_gui
%endif
###########################################################
%files
###########################################################
%defattr(-,root,root)
-%dir /etc/ha.d
-/etc/ha.d/harc
-/etc/ha.d/shellfuncs
-/etc/ha.d/rc.d
-/etc/ha.d/README.config
-/usr/lib64/heartbeat
-/usr/lib64/libapphb.*
-/usr/lib64/libccmclient.*
-/usr/lib64/libcib.*
-/usr/lib64/libclm.*
-/usr/lib64/libcrmcommon.*
-/usr/lib64/libtransitioner.*
-/usr/lib64/libhbclient.*
-/usr/lib64/liblrm.*
-/usr/lib64/libpengine.*
-/usr/lib64/libplumb.*
-/usr/lib64/libplumbgpl.*
-/usr/lib64/librecoverymgr.*
-/usr/lib64/libstonithd.*
-/usr/lib64/libpe_rules.*
-/usr/lib64/libpe_status.*
-/usr/lib/ocf
-/usr/include/heartbeat
-/usr/include/clplumbing
-/usr/include/saf
-/usr/include/ocf
-/etc/ha.d/resource.d/
-%config /etc/init.d/heartbeat
-%config /etc/logrotate.d/heartbeat
-%dir /var/lib/heartbeat
-%dir /var/lib/heartbeat/cores
-%dir %attr (0700, root, -) /var/lib/heartbeat/cores/root
-%dir %attr (0700, nobody, -) /var/lib/heartbeat/cores/nobody
-%dir %attr (0700, hacluster, -) /var/lib/heartbeat/cores/hacluster
-%dir /var/run
-%dir /var/run/heartbeat
-%attr (2555, hacluster, haclient) /usr/bin/cl_status
-/usr/bin/cl_respawn
-/usr/sbin/crmadmin
-/usr/sbin/cibadmin
-/usr/sbin/ccm_tool
-/usr/sbin/crm_diff
-/usr/sbin/crm_uuid
-/usr/sbin/crm_mon
-/usr/sbin/iso8601
-/usr/sbin/crm_master
-/usr/sbin/crm_standby
-/usr/sbin/crm_attribute
-/usr/sbin/crm_resource
-/usr/sbin/crm_verify
-/usr/sbin/attrd_updater
-/usr/sbin/crm_failcount
-/usr/sbin/crm_primitive.py
-%dir %attr (755, hacluster, haclient) /var/run/heartbeat/ccm
-%dir %attr (750, hacluster, haclient) /var/run/heartbeat/crm
-%dir %attr (750, hacluster, haclient) /var/lib/heartbeat/crm
-%dir %attr (750, hacluster, haclient) /var/lib/heartbeat/pengine
-%doc /usr/man/man1/cl_status.1*
-%doc /usr/man/man1/ha_logger.1*
-%doc /usr/man/man1/hb_standby.1*
-%doc /usr/man/man1/hb_takeover.1*
-%doc /usr/man/man1/hb_addnode.1*
-%doc /usr/man/man1/hb_delnode.1*
-%doc /usr/man/man8/heartbeat.8*
-%doc /usr/man/man8/apphbd.8*
-%doc /usr/man/man8/ha_logd.8*
-%doc /usr/man/man8/cibadmin.8*
-%doc /usr/share/doc/heartbeat-2.0.7
+%dir %{_sysconfdir}/ha.d
+%{_sysconfdir}/ha.d/harc
+%{_sysconfdir}/ha.d/shellfuncs
+%{_sysconfdir}/ha.d/rc.d
+%{_sysconfdir}/ha.d/README.config
+%{_libdir}/heartbeat
+%{_libdir}/libapphb.*
+%{_libdir}/libccmclient.*
+%{_libdir}/libcib.*
+%{_libdir}/libclm.*
+%{_libdir}/libcrmcommon.*
+%{_libdir}/libtransitioner.*
+%{_libdir}/libhbclient.*
+%{_libdir}/liblrm.*
+%{_libdir}/libpengine.*
+%{_libdir}/libplumb.*
+%{_libdir}/libplumbgpl.*
+%{_libdir}/librecoverymgr.*
+%{_libdir}/libstonithd.*
+%{_libdir}/libpe_rules.*
+%{_libdir}/libpe_status.*
+%{_libdir}/ocf
+%{_includedir}/heartbeat
+%{_includedir}/clplumbing
+%{_includedir}/saf
+%{_includedir}/ocf
+%{_sysconfdir}/ha.d/resource.d/
+%config %{_sysconfdir}/init.d/heartbeat
+%config %{_sysconfdir}/logrotate.d/heartbeat
+%dir %{_localstatedir}/lib/heartbeat
+%dir %{_localstatedir}/lib/heartbeat/cores
+%dir %attr (0700, root, -) %{_localstatedir}/lib/heartbeat/cores/root
+%dir %attr (0700, nobody, -) %{_localstatedir}/lib/heartbeat/cores/nobody
+%dir %attr (0700, hacluster, -) %{_localstatedir}/lib/heartbeat/cores/hacluster
+%dir %{_localstatedir}/run
+%dir %{_localstatedir}/run/heartbeat
+%attr (2555, hacluster, haclient) %{_bindir}/cl_status
+%{_bindir}/cl_respawn
+%{_sbindir}/crmadmin
+%{_sbindir}/cibadmin
+%{_sbindir}/ccm_tool
+%{_sbindir}/crm_diff
+%{_sbindir}/crm_uuid
+%{_sbindir}/crm_mon
+%{_sbindir}/iso8601
+%{_sbindir}/crm_master
+%{_sbindir}/crm_standby
+%{_sbindir}/crm_attribute
+%{_sbindir}/crm_resource
+%{_sbindir}/crm_verify
+%{_sbindir}/attrd_updater
+%{_sbindir}/crm_failcount
+%{_sbindir}/crm_primitive.py
+%dir %attr (755, hacluster, haclient) %{_localstatedir}/run/heartbeat/ccm
+%dir %attr (750, hacluster, haclient) %{_localstatedir}/run/heartbeat/crm
+%dir %attr (750, hacluster, haclient) %{_localstatedir}/lib/heartbeat/crm
+%dir %attr (750, hacluster, haclient) %{_localstatedir}/lib/heartbeat/pengine
+%doc %{_mandir}/man1/cl_status.1*
+%doc %{_mandir}/man1/ha_logger.1*
+%doc %{_mandir}/man1/hb_standby.1*
+%doc %{_mandir}/man1/hb_takeover.1*
+%doc %{_mandir}/man1/hb_addnode.1*
+%doc %{_mandir}/man1/hb_delnode.1*
+%doc %{_mandir}/man8/heartbeat.8*
+%doc %{_mandir}/man8/apphbd.8*
+%doc %{_mandir}/man8/ha_logd.8*
+%doc %{_mandir}/man8/cibadmin.8*
+%doc %{_defaultdocdir}/doc/heartbeat-%{version}
%if %{ENABLE_SNMP_SUBAGENT}
- /usr/share/snmp/mibs/LINUX-HA-MIB.mib
+ %{_datadir}/snmp/mibs/LINUX-HA-MIB.mib
%endif
%if %{ENABLE_MGMT}
- /usr/lib64/libhbmgmt.*
- /usr/lib64/libhbmgmtclient.*
- /usr/lib64/libhbmgmtcommon.*
- /usr/lib64/libhbmgmttls.*
- /etc/pam.d/hbmgmtd
- /usr/bin/hb_gui
- /usr/share/locale/zh_CN/LC_MESSAGES/haclient.mo
+ %{_libdir}/libhbmgmt.*
+ %{_libdir}/libhbmgmtclient.*
+ %{_libdir}/libhbmgmtcommon.*
+ %{_libdir}/libhbmgmttls.*
+ %{_sysconfdir}/pam.d/hbmgmtd
+ %{_bindir}/hb_gui
+ %{_datadir}/locale/zh_CN/LC_MESSAGES/haclient.mo
%endif
###########################################################
@@ -1433,14 +1478,14 @@
%files ldirectord
###########################################################
%defattr(-,root,root)
-/etc/ha.d/conf
-/usr/sbin/ldirectord
-/usr/sbin/supervise-ldirectord-config
-/etc/logrotate.d/ldirectord
-/etc/init.d/ldirectord
-/etc/ha.d/resource.d/ldirectord
-%doc /usr/man/man8/ldirectord.8*
-%doc /usr/man/man8/supervise-ldirectord-config.8*
+%{_sysconfdir}/ha.d/conf
+%{_sbindir}/ldirectord
+%{_sbindir}/supervise-ldirectord-config
+%{_sysconfdir}/logrotate.d/ldirectord
+%{_sysconfdir}/init.d/ldirectord
+%{_sysconfdir}/ha.d/resource.d/ldirectord
+%doc %{_mandir}/man8/ldirectord.8*
+%doc %{_mandir}/man8/supervise-ldirectord-config.8*
%doc ldirectord/ldirectord.cf
###########################################################
@@ -1448,23 +1493,23 @@
%files stonith
###########################################################
%defattr(-,root,root)
-/usr/include/stonith
-/usr/lib64/libstonith.*
-/usr/lib64/stonith
-/usr/sbin/stonith
-/usr/sbin/meatclient
-%doc /usr/man/man8/stonith.8*
-%doc /usr/man/man8/meatclient.8*
+%{_includedir}/stonith
+%{_libdir}/libstonith.*
+%{_libdir}/stonith
+%{_sbindir}/stonith
+%{_sbindir}/meatclient
+%doc %{_mandir}/man8/stonith.8*
+%doc %{_mandir}/man8/meatclient.8*
###########################################################
# Files for the PILS library
%files pils
###########################################################
%defattr(-,root,root)
-/usr/include/pils
-/usr/lib64/libpils.*
-/usr/lib64/pils/plugins
-#/usr/lib64/pils
+%{_includedir}/pils
+%{_libdir}/libpils.*
+%{_libdir}/pils/plugins
+#%{_libdir}/pils
###########################################################
%clean
@@ -1474,7 +1519,7 @@
then
rm -rf $RPM_BUILD_ROOT
fi
-rm -rf $RPM_BUILD_DIR/heartbeat-2.0.7
+rm -rf $RPM_BUILD_DIR/heartbeat-%{version}
###########################################################
%pre
@@ -1490,11 +1535,11 @@
else
GROUPOPT="-g 90"
if
- /usr/sbin/groupadd $GROUPOPT haclient 2>/dev/null
+ %{_sbindir}/groupadd $GROUPOPT haclient 2>/dev/null
then
: OK we were able to add group haclient
else
- /usr/sbin/groupadd haclient
+ %{_sbindir}/groupadd haclient
fi
fi
@@ -1503,13 +1548,13 @@
then
: OK user hacluster already present
else
- USEROPT="-g haclient -u 90 -d /var/lib/heartbeat/cores/hacluster"
+ USEROPT="-g haclient -u 90 -d %{_localstatedir}/lib/heartbeat/cores/hacluster"
if
- /usr/sbin/useradd $USEROPT hacluster 2>/dev/null
+ %{_sbindir}/useradd $USEROPT hacluster 2>/dev/null
then
: OK we were able to add user hacluster
else
- /usr/sbin/useradd hacluster
+ %{_sbindir}/useradd hacluster
fi
fi
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/