corosync.spec.in 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. %global alphatag @alphatag@
  2. %global numcomm @numcomm@
  3. %global dirty @dirty@
  4. # Conditionals
  5. # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
  6. # to disable or enable specific features
  7. %bcond_with testagents
  8. %bcond_with watchdog
  9. %bcond_with monitoring
  10. %bcond_with snmp
  11. %bcond_with dbus
  12. %bcond_with rdma
  13. %bcond_with systemd
  14. %bcond_with xmlconf
  15. Name: corosync
  16. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  17. Version: @version@
  18. Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
  19. License: BSD
  20. Group: System Environment/Base
  21. URL: http://ftp.corosync.org
  22. Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
  23. # Runtime bits
  24. Requires: corosynclib = %{version}-%{release}
  25. Requires(pre): /usr/sbin/useradd
  26. Requires(post): /sbin/chkconfig
  27. Requires(preun): /sbin/chkconfig
  28. Conflicts: openais <= 0.89, openais-devel <= 0.89
  29. # Build bits
  30. %define buildtrunk 0
  31. %{?_with_buildtrunk: %define buildtrunk 1}
  32. BuildRequires: libqb-devel
  33. BuildRequires: nss-devel
  34. %if %{buildtrunk}
  35. BuildRequires: autoconf automake
  36. %endif
  37. %if %{with rdma}
  38. BuildRequires: libibverbs-devel librdmacm-devel
  39. %endif
  40. %if %{with snmp}
  41. BuildRequires: net-snmp-devel
  42. %endif
  43. %if %{with dbus}
  44. BuildRequires: dbus-devel
  45. %endif
  46. %if %{with systemd}
  47. BuildRequires: systemd-units
  48. %endif
  49. %if %{with xmlconf}
  50. Requires: libxslt
  51. %endif
  52. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  53. %prep
  54. %setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  55. %build
  56. %if %{buildtrunk}
  57. ./autogen.sh
  58. %endif
  59. %if %{with rdma}
  60. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  61. export ibverbs_LIBS=-libverbs \
  62. export rdmacm_CFLAGS=-I/usr/include/rdma \
  63. export rdmacm_LIBS=-lrdmacm \
  64. %endif
  65. %{configure} \
  66. %if %{with testagents}
  67. --enable-testagents \
  68. %endif
  69. %if %{with watchdog}
  70. --enable-watchdog \
  71. %endif
  72. %if %{with monitoring}
  73. --enable-monitoring \
  74. %endif
  75. %if %{with snmp}
  76. --enable-snmp \
  77. %endif
  78. %if %{with dbus}
  79. --enable-dbus \
  80. %endif
  81. %if %{with rdma}
  82. --enable-rdma \
  83. %endif
  84. %if %{with systemd}
  85. --enable-systemd \
  86. %endif
  87. %if %{with xmlconf}
  88. --enable-xmlconf \
  89. %endif
  90. --with-initddir=%{_initrddir}
  91. make %{_smp_mflags}
  92. %install
  93. rm -rf %{buildroot}
  94. make install DESTDIR=%{buildroot}
  95. %if %{with dbus}
  96. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  97. install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  98. %endif
  99. ## tree fixup
  100. # drop static libs
  101. rm -f %{buildroot}%{_libdir}/*.a
  102. # drop docs and html docs for now
  103. rm -rf %{buildroot}%{_docdir}/*
  104. %clean
  105. rm -rf %{buildroot}
  106. %description
  107. This package contains the Corosync Cluster Engine Executive, several default
  108. APIs and libraries, default configuration files, and an init script.
  109. %post
  110. if [ $1 -eq 1 ]; then
  111. /sbin/chkconfig --add corosync || :
  112. fi
  113. %preun
  114. if [ $1 -eq 0 ]; then
  115. /sbin/service corosync stop &>/dev/null || :
  116. /sbin/chkconfig --del corosync || :
  117. fi
  118. %files
  119. %defattr(-,root,root,-)
  120. %doc LICENSE SECURITY
  121. %{_sbindir}/corosync
  122. %{_sbindir}/corosync-keygen
  123. %{_sbindir}/corosync-cmapctl
  124. %{_sbindir}/corosync-cfgtool
  125. %{_sbindir}/corosync-fplay
  126. %{_sbindir}/corosync-cpgtool
  127. %{_sbindir}/corosync-quorumtool
  128. %{_sbindir}/corosync-notifyd
  129. %{_bindir}/corosync-blackbox
  130. %if %{with xmlconf}
  131. %{_bindir}/corosync-xmlproc
  132. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  133. %dir %{_datadir}/corosync
  134. %dir %{_datadir}/corosync/xml2conf.xsl
  135. %{_mandir}/man8/corosync-xmlproc.8*
  136. %{_mandir}/man5/corosync.xml.5*
  137. %endif
  138. %dir %{_sysconfdir}/corosync
  139. %dir %{_sysconfdir}/corosync/uidgid.d
  140. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  141. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  142. %if %{with dbus}
  143. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  144. %endif
  145. %if %{with snmp}
  146. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  147. %endif
  148. %if %{with systemd}
  149. %{_unitdir}/corosync.service
  150. %{_unitdir}/corosync-notifyd.service
  151. %else
  152. %{_initrddir}/corosync
  153. %{_initrddir}/corosync-notifyd
  154. %endif
  155. %dir %{_localstatedir}/lib/corosync
  156. %dir %{_localstatedir}/log/cluster
  157. %{_mandir}/man8/corosync_overview.8*
  158. %{_mandir}/man8/corosync.8*
  159. %{_mandir}/man8/corosync-blackbox.8*
  160. %{_mandir}/man8/corosync-cmapctl.8*
  161. %{_mandir}/man8/corosync-keygen.8*
  162. %{_mandir}/man8/corosync-cfgtool.8*
  163. %{_mandir}/man8/corosync-cpgtool.8*
  164. %{_mandir}/man8/corosync-fplay.8*
  165. %{_mandir}/man8/corosync-notifyd.8*
  166. %{_mandir}/man8/corosync-quorumtool.8*
  167. %{_mandir}/man5/corosync.conf.5*
  168. %{_mandir}/man5/votequorum.5*
  169. # optional testagent rpm
  170. #
  171. %if %{with testagents}
  172. %package -n corosync-testagents
  173. Summary: The Corosync Cluster Engine Test Agents
  174. Group: Development/Libraries
  175. Requires: %{name} = %{version}-%{release}
  176. %description -n corosync-testagents
  177. This package contains corosync test agents.
  178. %files -n corosync-testagents
  179. %defattr(755,root,root,-)
  180. %{_datadir}/corosync/tests/mem_leak_test.sh
  181. %{_datadir}/corosync/tests/net_breaker.sh
  182. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  183. %{_datadir}/corosync/tests/shm_leak_audit.sh
  184. %{_bindir}/cpg_test_agent
  185. %{_bindir}/sam_test_agent
  186. %{_bindir}/votequorum_test_agent
  187. %endif
  188. # library
  189. #
  190. %package -n corosynclib
  191. Summary: The Corosync Cluster Engine Libraries
  192. Group: System Environment/Libraries
  193. Requires: %{name} = %{version}-%{release}
  194. %description -n corosynclib
  195. This package contains corosync libraries.
  196. %files -n corosynclib
  197. %defattr(-,root,root,-)
  198. %doc LICENSE
  199. %{_libdir}/libcfg.so.*
  200. %{_libdir}/libcpg.so.*
  201. %{_libdir}/libcmap.so.*
  202. %{_libdir}/libtotem_pg.so.*
  203. %{_libdir}/libquorum.so.*
  204. %{_libdir}/libvotequorum.so.*
  205. %{_libdir}/libsam.so.*
  206. %{_libdir}/libcorosync_common.so.*
  207. %post -n corosynclib -p /sbin/ldconfig
  208. %postun -n corosynclib -p /sbin/ldconfig
  209. %package -n corosynclib-devel
  210. Summary: The Corosync Cluster Engine Development Kit
  211. Group: Development/Libraries
  212. Requires: corosynclib = %{version}-%{release}
  213. Requires: pkgconfig
  214. Provides: corosync-devel = %{version}
  215. Obsoletes: corosync-devel < 0.92-7
  216. %description -n corosynclib-devel
  217. This package contains include files and man pages used to develop using
  218. The Corosync Cluster Engine APIs.
  219. %files -n corosynclib-devel
  220. %defattr(-,root,root,-)
  221. %doc LICENSE
  222. %dir %{_includedir}/corosync/
  223. %{_includedir}/corosync/corodefs.h
  224. %{_includedir}/corosync/cfg.h
  225. %{_includedir}/corosync/cmap.h
  226. %{_includedir}/corosync/corotypes.h
  227. %{_includedir}/corosync/cpg.h
  228. %{_includedir}/corosync/hdb.h
  229. %{_includedir}/corosync/sam.h
  230. %{_includedir}/corosync/quorum.h
  231. %{_includedir}/corosync/votequorum.h
  232. %dir %{_includedir}/corosync/totem/
  233. %{_includedir}/corosync/totem/totem.h
  234. %{_includedir}/corosync/totem/totemip.h
  235. %{_includedir}/corosync/totem/totempg.h
  236. %{_libdir}/libcfg.so
  237. %{_libdir}/libcpg.so
  238. %{_libdir}/libcmap.so
  239. %{_libdir}/libtotem_pg.so
  240. %{_libdir}/libquorum.so
  241. %{_libdir}/libvotequorum.so
  242. %{_libdir}/libsam.so
  243. %{_libdir}/libcorosync_common.so
  244. %{_libdir}/pkgconfig/*.pc
  245. %{_mandir}/man3/cpg_*3*
  246. %{_mandir}/man3/quorum_*3*
  247. %{_mandir}/man3/votequorum_*3*
  248. %{_mandir}/man3/sam_*3*
  249. %{_mandir}/man8/cpg_overview.8*
  250. %{_mandir}/man8/votequorum_overview.8*
  251. %{_mandir}/man8/sam_overview.8*
  252. %{_mandir}/man3/cmap_*3*
  253. %{_mandir}/man8/cmap_overview.8*
  254. %{_mandir}/man8/quorum_overview.8*
  255. %changelog
  256. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  257. - Autotools generated version