# $Id: ITO.spec,v 1.10 2012/08/21 22:02:21 ksb Exp $ # $KeyFile: ${echo:-echo} haveip.pl.host %define _tmpdir /tmp %define _local_prefix /usr/local %define _local_bindir %{_local_prefix}/bin %define _local_mandir %{_local_prefix}/man/man1 # for signing of packages #%_signature gpg #%_gpg_name FIXME@example.org # %dist should be defined on the target but in case it isn't we can guess one %define distguess %(cat /etc/{redhat,fedora,suse,ubuntu}-release | sed -e 's/Fedora Core/fc@/; s/Fedora/f@/; s/Red Hat[^0-9]*\(Enterprise|Server\)*[^0-9]*/rhel@/; s/Red Hat[^0-9]*/rh/; s/.*Suse[^0-9]*/se@/; s/Ubuntu[^0-9]*/ubuntu@/; s/@[^0-9]*//;s/\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)/\1_\2/; s/[^0-9]*$//') %{!?dist:%define dist .%{distguess}} # Do not generate debugging packages by default - older versions of rpmbuild # (like RehHat 6.2) choke on the line with the percent in the macro name: # We need a sed spell on RH6.x to "s/\(^.define \)%d/\1d/", Sigh. -- ksb %define debug_package %{nil} Name: haveip Version: 1.13 Release: 2%{?dist} BuildRoot: %{_tmpdir}/%{name}-%{version}-%{release} Vendor: NPCGuild.org Summary: NPC tool for limiting recurring tasks scope based on IP floating addresses Group: Utilities License: BSD URL: http://patch.sac.fedex.com/RPMS Source: http://patch.sac.fedex.com/tarball/%{name}-%{version}.tgz BuildRequires: gcc m4 msrc_base install_base perl perl-IO-Interface Autoreq: 1 Requires: perl perl-IO-Interface %description When a floating VIP migrates from host to host we want some cron-based (viz. cron, at, batch, or kicker based) task to float with it. So we run the task on every host that might aquire the vip, and guard the execution with this program. If the VIP ip is presented by and interface on this host then haveip succeeds, so a shell if-statement or control operator may take action as appropriate. %prep %setup -q %build %install umask 022 mkdir -p %{buildroot}/%{_local_bindir} mkdir -p %{buildroot}/%{_local_mandir} F=`mktemp -d /tmp/bmHMXXXXXX` mmsrc -y INTO=$F -Cauto.cf -- make DESTDIR=%{buildroot} install mk -mInstall -D DESTDIR=%{buildroot} *.man rm -rf $F find %{buildroot} -depth -type d -name OLD -exec rm -rf \{\} \; %clean # Do not confilct with the next user of the fixed-path build directory rm -rf %{buildroot} %files %defattr(-,root,root) %{_local_bindir}/%{name} %doc %{_local_mandir}/ %changelog * Tue Aug 21 2012 KS Braunsdorf - fixed manual page a lot * Fri Apr 9 2010 KS Braunsdorf - more portable on HPUX11 where /usr/sbin is not in anyone's PATH * Mon Nov 24 2008 KS Braunsdorf - Built the RPM spec file and added it to the msrc cache