4
0

corosync.spec.in 7.5 KB

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