corosync.spec.in 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. --with-systemddir=%{_unitdir}
  92. make %{_smp_mflags}
  93. %install
  94. rm -rf %{buildroot}
  95. make install DESTDIR=%{buildroot}
  96. %if %{with dbus}
  97. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  98. install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  99. %endif
  100. ## tree fixup
  101. # drop static libs
  102. rm -f %{buildroot}%{_libdir}/*.a
  103. # drop docs and html docs for now
  104. rm -rf %{buildroot}%{_docdir}/*
  105. %clean
  106. rm -rf %{buildroot}
  107. %description
  108. This package contains the Corosync Cluster Engine Executive, several default
  109. APIs and libraries, default configuration files, and an init script.
  110. %post
  111. if [ $1 -eq 1 ]; then
  112. /sbin/chkconfig --add corosync || :
  113. fi
  114. %preun
  115. if [ $1 -eq 0 ]; then
  116. /sbin/service corosync stop &>/dev/null || :
  117. /sbin/chkconfig --del corosync || :
  118. fi
  119. %files
  120. %defattr(-,root,root,-)
  121. %doc LICENSE SECURITY
  122. %{_sbindir}/corosync
  123. %{_sbindir}/corosync-keygen
  124. %{_sbindir}/corosync-cmapctl
  125. %{_sbindir}/corosync-cfgtool
  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. %dir %{_datadir}/corosync
  152. %{_datadir}/corosync/corosync
  153. %{_datadir}/corosync/corosync-notifyd
  154. %else
  155. %{_initrddir}/corosync
  156. %{_initrddir}/corosync-notifyd
  157. %endif
  158. %dir %{_localstatedir}/lib/corosync
  159. %dir %{_localstatedir}/log/cluster
  160. %{_mandir}/man8/corosync_overview.8*
  161. %{_mandir}/man8/corosync.8*
  162. %{_mandir}/man8/corosync-blackbox.8*
  163. %{_mandir}/man8/corosync-cmapctl.8*
  164. %{_mandir}/man8/corosync-keygen.8*
  165. %{_mandir}/man8/corosync-cfgtool.8*
  166. %{_mandir}/man8/corosync-cpgtool.8*
  167. %{_mandir}/man8/corosync-notifyd.8*
  168. %{_mandir}/man8/corosync-quorumtool.8*
  169. %{_mandir}/man5/corosync.conf.5*
  170. %{_mandir}/man5/votequorum.5*
  171. %{_mandir}/man8/cmap_keys.8*
  172. # optional testagent rpm
  173. #
  174. %if %{with testagents}
  175. %package -n corosync-testagents
  176. Summary: The Corosync Cluster Engine Test Agents
  177. Group: Development/Libraries
  178. Requires: %{name} = %{version}-%{release}
  179. %description -n corosync-testagents
  180. This package contains corosync test agents.
  181. %files -n corosync-testagents
  182. %defattr(755,root,root,-)
  183. %{_datadir}/corosync/tests/mem_leak_test.sh
  184. %{_datadir}/corosync/tests/net_breaker.sh
  185. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  186. %{_datadir}/corosync/tests/shm_leak_audit.sh
  187. %{_bindir}/cpg_test_agent
  188. %{_bindir}/sam_test_agent
  189. %{_bindir}/votequorum_test_agent
  190. %endif
  191. # library
  192. #
  193. %package -n corosynclib
  194. Summary: The Corosync Cluster Engine Libraries
  195. Group: System Environment/Libraries
  196. Requires: %{name} = %{version}-%{release}
  197. %description -n corosynclib
  198. This package contains corosync libraries.
  199. %files -n corosynclib
  200. %defattr(-,root,root,-)
  201. %doc LICENSE
  202. %{_libdir}/libcfg.so.*
  203. %{_libdir}/libcpg.so.*
  204. %{_libdir}/libcmap.so.*
  205. %{_libdir}/libtotem_pg.so.*
  206. %{_libdir}/libquorum.so.*
  207. %{_libdir}/libvotequorum.so.*
  208. %{_libdir}/libsam.so.*
  209. %{_libdir}/libcorosync_common.so.*
  210. %post -n corosynclib -p /sbin/ldconfig
  211. %postun -n corosynclib -p /sbin/ldconfig
  212. %package -n corosynclib-devel
  213. Summary: The Corosync Cluster Engine Development Kit
  214. Group: Development/Libraries
  215. Requires: corosynclib = %{version}-%{release}
  216. Requires: pkgconfig
  217. Provides: corosync-devel = %{version}
  218. Obsoletes: corosync-devel < 0.92-7
  219. %description -n corosynclib-devel
  220. This package contains include files and man pages used to develop using
  221. The Corosync Cluster Engine APIs.
  222. %files -n corosynclib-devel
  223. %defattr(-,root,root,-)
  224. %doc LICENSE
  225. %dir %{_includedir}/corosync/
  226. %{_includedir}/corosync/corodefs.h
  227. %{_includedir}/corosync/cfg.h
  228. %{_includedir}/corosync/cmap.h
  229. %{_includedir}/corosync/corotypes.h
  230. %{_includedir}/corosync/cpg.h
  231. %{_includedir}/corosync/hdb.h
  232. %{_includedir}/corosync/sam.h
  233. %{_includedir}/corosync/quorum.h
  234. %{_includedir}/corosync/votequorum.h
  235. %dir %{_includedir}/corosync/totem/
  236. %{_includedir}/corosync/totem/totem.h
  237. %{_includedir}/corosync/totem/totemip.h
  238. %{_includedir}/corosync/totem/totempg.h
  239. %{_libdir}/libcfg.so
  240. %{_libdir}/libcpg.so
  241. %{_libdir}/libcmap.so
  242. %{_libdir}/libtotem_pg.so
  243. %{_libdir}/libquorum.so
  244. %{_libdir}/libvotequorum.so
  245. %{_libdir}/libsam.so
  246. %{_libdir}/libcorosync_common.so
  247. %{_libdir}/pkgconfig/*.pc
  248. %{_mandir}/man3/cpg_*3*
  249. %{_mandir}/man3/quorum_*3*
  250. %{_mandir}/man3/votequorum_*3*
  251. %{_mandir}/man3/sam_*3*
  252. %{_mandir}/man8/cpg_overview.8*
  253. %{_mandir}/man8/votequorum_overview.8*
  254. %{_mandir}/man8/sam_overview.8*
  255. %{_mandir}/man3/cmap_*3*
  256. %{_mandir}/man8/cmap_overview.8*
  257. %{_mandir}/man8/quorum_overview.8*
  258. %changelog
  259. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  260. - Autotools generated version