corosync.spec.in 8.0 KB

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