heartbeat.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ##
  2. ## heartbeat.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: heartbeat
  27. Summary: High-Availability Communication Daemon
  28. URL: http://www.linux-ha.org/heartbeat/
  29. Vendor: Alan Roberston
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: System
  34. License: GPL
  35. Version: 1.2.3
  36. Release: 20040923
  37. # list of sources
  38. Source0: http://www.linux-ha.org/download/heartbeat-%{version}.tar.gz
  39. Source1: ha.cf
  40. Source2: haresources
  41. Source3: authkeys
  42. Source4: rc.heartbeat
  43. Patch0: heartbeat.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, pkgconfig, make, gcc
  48. PreReq: OpenPKG, openpkg >= 20040130, perl
  49. BuildPreReq: libnet, libxml, uuid, glib, snmp, curl, openssl, gettext, libiconv, getopt
  50. PreReq: libnet, libxml, uuid, glib, snmp, curl, openssl, gettext, libiconv, getopt
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. The heartbeat program is one of the core components of the Linux
  55. High-Availability (Linux-HA) project. It provides "warm" failover
  56. between two nodes in either automatic or controll way. It uses
  57. redundant communication links via Ethernet or serial line in
  58. broadcast, multicast and unicast mode.
  59. %track
  60. prog heartbeat = {
  61. version = %{version}
  62. url = http://www.linux-ha.org/download/
  63. regex = heartbeat-(\d+\.[02468]\.\d+)\.tar\.gz
  64. }
  65. %prep
  66. # unpack and patch package
  67. %setup -q
  68. %patch -p0
  69. %{l_shtool} subst -s -q \
  70. -e 's;/ha\.d/;/;g' \
  71. -e 's;/ha\.d;;g' \
  72. `find . -type f -print`
  73. %build
  74. # configure package
  75. CC="%{l_cc}" \
  76. CFLAGS="%{l_cflags -O}" \
  77. CPPFLAGS="%{l_cppflags}" \
  78. LDFLAGS="%{l_ldflags}" \
  79. LIBS="-lintl -liconv -lgetopt" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --sysconfdir=%{l_prefix}/etc/heartbeat \
  83. --with-initdir=%{l_prefix}/etc/rc.d \
  84. --with-group-name=%{l_musr} \
  85. --with-group-id=%{l_muid} \
  86. --with-ccmuser-name=%{l_musr} \
  87. --with-ccmuser-id=%{l_muid} \
  88. --disable-shared
  89. # build package components
  90. %{l_make} %{l_mflags -O}
  91. %install
  92. # install package components
  93. rm -rf $RPM_BUILD_ROOT
  94. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  95. # strip down installation
  96. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  97. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/README.config
  98. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  99. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  100. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/lib*.*
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/*.sh
  102. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/logrotate.d
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/cts
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/*ldirectord*.8
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/*ldirectord*
  106. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/pils
  107. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/stonith
  108. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/plugins
  109. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/lib
  110. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/run
  111. mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/heartbeat \
  112. $RPM_BUILD_ROOT%{l_prefix}/sbin/heartbeat
  113. mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/apphbd \
  114. $RPM_BUILD_ROOT%{l_prefix}/sbin/apphbd
  115. mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/ipfail \
  116. $RPM_BUILD_ROOT%{l_prefix}/sbin/ipfail
  117. mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/hb_* \
  118. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  119. mv $RPM_BUILD_ROOT%{l_prefix}/lib/heartbeat/ha_* \
  120. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  121. # install default configuration files
  122. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  123. %{SOURCE ha.cf} %{SOURCE haresources} \
  124. $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/
  125. %{l_shtool} install -c -m 600 %{l_value -s -a} \
  126. %{SOURCE authkeys} $RPM_BUILD_ROOT%{l_prefix}/etc/heartbeat/
  127. # install run-command script
  128. %{l_shtool} mkdir -f -p -m 755 \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  130. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  131. %{SOURCE rc.heartbeat} \
  132. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  133. # determine installation files
  134. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  135. %files -f files
  136. %clean
  137. rm -rf $RPM_BUILD_ROOT