| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- ##
- ## heartbeat.spec -- OpenPKG RPM Specification
- ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
- ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
- ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package information
- Name: heartbeat
- Summary: High-Availability Communication Daemon
- URL: http://www.linux-ha.org/heartbeat/
- Vendor: Alan Roberston
- Packager: The OpenPKG Project
- Distribution: OpenPKG
- Class: EVAL
- Group: System
- License: GPL
- Version: 1.2.3
- Release: 20040923
- # list of sources
- Source0: http://www.linux-ha.org/download/heartbeat-%{version}.tar.gz
- Source1: ha.cf
- Source2: haresources
- Source3: authkeys
- Source4: rc.heartbeat
- Patch0: heartbeat.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130, perl, pkgconfig, make, gcc
- PreReq: OpenPKG, openpkg >= 20040130, perl
- BuildPreReq: libnet, libxml, uuid, glib, snmp, curl, openssl, gettext, libiconv, getopt
- PreReq: libnet, libxml, uuid, glib, snmp, curl, openssl, gettext, libiconv, getopt
- AutoReq: no
- AutoReqProv: no
- %description
- The heartbeat program is one of the core components of the Linux
- High-Availability (Linux-HA) project. It provides "warm" failover
- between two nodes in either automatic or controll way. It uses
- redundant communication links via Ethernet or serial line in
- broadcast, multicast and unicast mode.
- %track
- prog heartbeat = {
- version = %{version}
- url = http://www.linux-ha.org/download/
- regex = heartbeat-(\d+\.[02468]\.\d+)\.tar\.gz
- }
- %prep
- # unpack and patch package
- %setup -q
- %patch -p0
- %{l_shtool} subst -s -q \
- -e 's;/ha\.d/;/;g' \
- -e 's;/ha\.d;;g' \
- `find . -type f -print`
- %build
- # configure package
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- CPPFLAGS="%{l_cppflags}" \
- LDFLAGS="%{l_ldflags}" \
- LIBS="-lintl -liconv -lgetopt" \
- ./configure \
- --prefix=%{l_prefix} \
- --sysconfdir=%{l_prefix}/etc/heartbeat \
- --libdir=%{l_prefix}/lib/heartbeat \
- --with-initdir=%{l_prefix}/etc/rc.d \
- --with-group-name=%{l_musr} \
- --with-group-id=%{l_muid} \
- --with-ccmuser-name=%{l_musr} \
- --with-ccmuser-id=%{l_muid} \
- --enable-static \
- --enable-shared
- # build package components
- %{l_make} %{l_mflags -O}
- %install
- # install package components
- rm -rf $RPM_BUILD_ROOT
- %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
- # strip down installation
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/README.config
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/*.sh
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/logrotate.d
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/conf
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/harc
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/heartbeat/cts
- rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/*ldirectord*.8
- rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/*ldirectord*
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/lib
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/run
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/heartbeat/plugins/*/*.a
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/stonith/plugins/*/*.a
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/pils/plugins/*/*.a
- # move executables into libexec and wrap them because of shared libraries
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/heartbeat
- for prog in \
- apphbd ha_config hb_standby hb_takeover checkpointd recoverymgrd \
- heartbeat ipfail meatclient stonith cl_status ccm ccm_testclient send_arp; do
- if [ -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prog ]; then
- mv $RPM_BUILD_ROOT%{l_prefix}/bin/$prog \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/heartbeat/$prog
- elif [ -f $RPM_BUILD_ROOT%{l_prefix}/sbin/$prog ]; then
- mv $RPM_BUILD_ROOT%{l_prefix}/sbin/$prog \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/heartbeat/$prog
- elif [ -f $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/heartbeat/$prog ]; then
- mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/heartbeat/$prog \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/heartbeat/$prog
- fi
- ( echo "#!/bin/sh"
- echo "LD_LIBRARY_PATH=\"%{l_prefix}/lib/heartbeat:%{l_prefix}/lib:/usr/lib:/lib\""
- echo "export LD_LIBRARY_PATH"
- echo "exec %{l_prefix}/libexec/heartbeat/$prog \"\$@\""
- ) >$RPM_BUILD_ROOT%{l_prefix}/sbin/$prog
- chmod 755 $RPM_BUILD_ROOT%{l_prefix}/sbin/$prog
- done
- # create run-time directory
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/heartbeat
- # install default configuration files
- l_hostname=`%{l_shtool} echo -e %h`
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- %{SOURCE ha.cf} %{SOURCE haresources} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/
- %{l_shtool} install -c -m 600 %{l_value -s -a} \
- %{SOURCE authkeys} $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/
- # install run-command script
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.heartbeat} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/heartbeat/ha.cf' \
- '%config %{l_prefix}/etc/heartbeat/haresources' \
- '%config %{l_prefix}/etc/heartbeat/authkeys'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
|