corosync.spec.in 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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. Name: corosync
  15. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  16. Version: @version@
  17. Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
  18. License: BSD
  19. Group: System Environment/Base
  20. URL: http://ftp.corosync.org
  21. Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
  22. # Runtime bits
  23. Requires: corosynclib = %{version}-%{release}
  24. Requires(pre): /usr/sbin/useradd
  25. Requires(post): /sbin/chkconfig
  26. Requires(preun): /sbin/chkconfig
  27. Conflicts: openais <= 0.89, openais-devel <= 0.89
  28. # Build bits
  29. %define buildtrunk 0
  30. %{?_with_buildtrunk: %define buildtrunk 1}
  31. %if %{buildtrunk}
  32. BuildRequires: autoconf automake
  33. %endif
  34. BuildRequires: nss-devel
  35. %if %{with rdma}
  36. BuildRequires: libibverbs-devel librdmacm-devel
  37. %endif
  38. %if %{with snmp}
  39. BuildRequires: net-snmp-devel
  40. %endif
  41. %if %{with dbus}
  42. BuildRequires: dbus-devel
  43. %endif
  44. %if %{with systemd}
  45. BuildRequires: systemd-units
  46. %endif
  47. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  48. %prep
  49. %setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  50. %build
  51. %if %{buildtrunk}
  52. ./autogen.sh
  53. %endif
  54. %if %{with rdma}
  55. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  56. export ibverbs_LIBS=-libverbs \
  57. export rdmacm_CFLAGS=-I/usr/include/rdma \
  58. export rdmacm_LIBS=-lrdmacm \
  59. %endif
  60. %{configure} \
  61. --enable-nss \
  62. %if %{with testagents}
  63. --enable-testagents \
  64. %endif
  65. %if %{with watchdog}
  66. --enable-watchdog \
  67. %endif
  68. %if %{with monitoring}
  69. --enable-monitoring \
  70. %endif
  71. %if %{with snmp}
  72. --enable-snmp \
  73. %endif
  74. %if %{with dbus}
  75. --enable-dbus \
  76. %endif
  77. %if %{with rdma}
  78. --enable-rdma \
  79. %endif
  80. %if %{with systemd}
  81. --enable-systemd \
  82. %endif
  83. --with-initddir=%{_initrddir}
  84. make %{_smp_mflags}
  85. %install
  86. rm -rf %{buildroot}
  87. make install DESTDIR=%{buildroot}
  88. %if %{with dbus}
  89. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  90. install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  91. %endif
  92. ## tree fixup
  93. # drop static libs
  94. rm -f %{buildroot}%{_libdir}/*.a
  95. # drop docs and html docs for now
  96. rm -rf %{buildroot}%{_docdir}/*
  97. %clean
  98. rm -rf %{buildroot}
  99. %description
  100. This package contains the Corosync Cluster Engine Executive, several default
  101. APIs and libraries, default configuration files, and an init script.
  102. %post
  103. if [ $1 -eq 1 ]; then
  104. /sbin/chkconfig --add corosync || :
  105. fi
  106. %preun
  107. if [ $1 -eq 0 ]; then
  108. /sbin/service corosync stop &>/dev/null || :
  109. /sbin/chkconfig --del corosync || :
  110. fi
  111. %files
  112. %defattr(-,root,root,-)
  113. %doc LICENSE SECURITY
  114. %{_bindir}/corosync-blackbox
  115. %{_sbindir}/corosync
  116. %{_sbindir}/corosync-keygen
  117. %{_sbindir}/corosync-objctl
  118. %{_sbindir}/corosync-cfgtool
  119. %{_sbindir}/corosync-fplay
  120. %{_sbindir}/corosync-pload
  121. %{_sbindir}/corosync-cpgtool
  122. %{_sbindir}/corosync-quorumtool
  123. %{_sbindir}/corosync-notifyd
  124. %{_bindir}/corosync-blackbox
  125. %dir %{_sysconfdir}/corosync
  126. %dir %{_sysconfdir}/corosync/service.d
  127. %dir %{_sysconfdir}/corosync/uidgid.d
  128. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  129. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  130. %if %{with dbus}
  131. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  132. %endif
  133. %if %{with snmp}
  134. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  135. %endif
  136. %if %{with systemd}
  137. %{_unitdir}/corosync.service
  138. %{_unitdir}/corosync-notifyd.service
  139. %else
  140. %{_initrddir}/corosync
  141. %{_initrddir}/corosync-notifyd
  142. %endif
  143. %dir %{_libexecdir}/lcrso
  144. %{_libexecdir}/lcrso/coroparse.lcrso
  145. %{_libexecdir}/lcrso/objdb.lcrso
  146. %{_libexecdir}/lcrso/service_cfg.lcrso
  147. %{_libexecdir}/lcrso/service_cpg.lcrso
  148. %{_libexecdir}/lcrso/service_evs.lcrso
  149. %{_libexecdir}/lcrso/service_confdb.lcrso
  150. %{_libexecdir}/lcrso/service_pload.lcrso
  151. %{_libexecdir}/lcrso/quorum_votequorum.lcrso
  152. %{_libexecdir}/lcrso/quorum_testquorum.lcrso
  153. %{_libexecdir}/lcrso/vsf_quorum.lcrso
  154. %{_libexecdir}/lcrso/vsf_ykd.lcrso
  155. %if %{with watchdog}
  156. %{_libexecdir}/lcrso/service_wd.lcrso
  157. %endif
  158. %if %{with monitoring}
  159. %{_libexecdir}/lcrso/service_mon.lcrso
  160. %endif
  161. %dir %{_localstatedir}/lib/corosync
  162. %dir %{_localstatedir}/log/cluster
  163. %{_mandir}/man8/corosync_overview.8*
  164. %{_mandir}/man8/corosync.8*
  165. %{_mandir}/man8/corosync-blackbox.8*
  166. %{_mandir}/man8/corosync-objctl.8*
  167. %{_mandir}/man8/corosync-keygen.8*
  168. %{_mandir}/man8/corosync-cfgtool.8*
  169. %{_mandir}/man8/corosync-cpgtool.8*
  170. %{_mandir}/man8/corosync-fplay.8*
  171. %{_mandir}/man8/corosync-pload.8*
  172. %{_mandir}/man8/corosync-notifyd.8*
  173. %{_mandir}/man8/corosync-quorumtool.8*
  174. %{_mandir}/man5/corosync.conf.5*
  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. %{_bindir}/cpg_test_agent
  189. %{_bindir}/confdb_test_agent
  190. %{_bindir}/sam_test_agent
  191. %{_bindir}/votequorum_test_agent
  192. %{_libexecdir}/lcrso/service_syncv2.lcrso
  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}/libconfdb.so.*
  208. %{_libdir}/libevs.so.*
  209. %{_libdir}/libtotem_pg.so.*
  210. %{_libdir}/liblogsys.so.*
  211. %{_libdir}/libcoroipcc.so.*
  212. %{_libdir}/libcoroipcs.so.*
  213. %{_libdir}/libquorum.so.*
  214. %{_libdir}/libvotequorum.so.*
  215. %{_libdir}/libpload.so.*
  216. %{_libdir}/libsam.so.*
  217. %post -n corosynclib -p /sbin/ldconfig
  218. %postun -n corosynclib -p /sbin/ldconfig
  219. %package -n corosynclib-devel
  220. Summary: The Corosync Cluster Engine Development Kit
  221. Group: Development/Libraries
  222. Requires: corosynclib = %{version}-%{release}
  223. Requires: pkgconfig
  224. Provides: corosync-devel = %{version}
  225. Obsoletes: corosync-devel < 0.92-7
  226. %description -n corosynclib-devel
  227. This package contains include files and man pages used to develop using
  228. The Corosync Cluster Engine APIs.
  229. %files -n corosynclib-devel
  230. %defattr(-,root,root,-)
  231. %doc LICENSE README.devmap
  232. %dir %{_includedir}/corosync/
  233. %{_includedir}/corosync/cs_config.h
  234. %{_includedir}/corosync/corodefs.h
  235. %{_includedir}/corosync/coroipc_types.h
  236. %{_includedir}/corosync/coroipcs.h
  237. %{_includedir}/corosync/coroipcc.h
  238. %{_includedir}/corosync/cfg.h
  239. %{_includedir}/corosync/confdb.h
  240. %{_includedir}/corosync/corotypes.h
  241. %{_includedir}/corosync/cpg.h
  242. %{_includedir}/corosync/evs.h
  243. %{_includedir}/corosync/hdb.h
  244. %{_includedir}/corosync/list.h
  245. %{_includedir}/corosync/mar_gen.h
  246. %{_includedir}/corosync/sam.h
  247. %{_includedir}/corosync/swab.h
  248. %{_includedir}/corosync/quorum.h
  249. %{_includedir}/corosync/votequorum.h
  250. %dir %{_includedir}/corosync/totem/
  251. %{_includedir}/corosync/totem/coropoll.h
  252. %{_includedir}/corosync/totem/totem.h
  253. %{_includedir}/corosync/totem/totemip.h
  254. %{_includedir}/corosync/totem/totempg.h
  255. %dir %{_includedir}/corosync/lcr/
  256. %{_includedir}/corosync/lcr/lcr_ckpt.h
  257. %{_includedir}/corosync/lcr/lcr_comp.h
  258. %{_includedir}/corosync/lcr/lcr_ifact.h
  259. %dir %{_includedir}/corosync/engine
  260. %{_includedir}/corosync/engine/config.h
  261. %{_includedir}/corosync/engine/coroapi.h
  262. %{_includedir}/corosync/engine/logsys.h
  263. %{_includedir}/corosync/engine/objdb.h
  264. %{_includedir}/corosync/engine/quorum.h
  265. %{_libdir}/libcfg.so
  266. %{_libdir}/libcpg.so
  267. %{_libdir}/libconfdb.so
  268. %{_libdir}/libevs.so
  269. %{_libdir}/libtotem_pg.so
  270. %{_libdir}/liblogsys.so
  271. %{_libdir}/libcoroipcc.so
  272. %{_libdir}/libcoroipcs.so
  273. %{_libdir}/libquorum.so
  274. %{_libdir}/libvotequorum.so
  275. %{_libdir}/libpload.so
  276. %{_libdir}/libsam.so
  277. %{_libdir}/pkgconfig/*.pc
  278. %{_mandir}/man3/cpg_*3*
  279. %{_mandir}/man3/evs_*3*
  280. %{_mandir}/man3/confdb_*3*
  281. %{_mandir}/man3/votequorum_*3*
  282. %{_mandir}/man3/sam_*3*
  283. %{_mandir}/man8/cpg_overview.8*
  284. %{_mandir}/man8/evs_overview.8*
  285. %{_mandir}/man8/confdb_overview.8*
  286. %{_mandir}/man8/logsys_overview.8*
  287. %{_mandir}/man8/votequorum_overview.8*
  288. %{_mandir}/man8/coroipc_overview.8*
  289. %{_mandir}/man8/sam_overview.8*
  290. %changelog
  291. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  292. - Autotools generated version