corosync.spec.in 7.8 KB

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