corosync.spec.in 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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 nss
  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. %if %{buildtrunk}
  34. BuildRequires: autoconf automake
  35. %endif
  36. %if %{with nss}
  37. BuildRequires: nss-devel
  38. %endif
  39. %if %{with rdma}
  40. BuildRequires: libibverbs-devel librdmacm-devel
  41. %endif
  42. %if %{with snmp}
  43. BuildRequires: net-snmp-devel
  44. %endif
  45. %if %{with dbus}
  46. BuildRequires: dbus-devel
  47. %endif
  48. %if %{with systemd}
  49. BuildRequires: systemd-units
  50. %endif
  51. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  52. %prep
  53. %setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  54. %build
  55. %if %{buildtrunk}
  56. ./autogen.sh
  57. %endif
  58. %if %{with rdma}
  59. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  60. export ibverbs_LIBS=-libverbs \
  61. export rdmacm_CFLAGS=-I/usr/include/rdma \
  62. export rdmacm_LIBS=-lrdmacm \
  63. %endif
  64. %{configure} \
  65. %if %{with nss}
  66. --enable-nss \
  67. %else
  68. --disable-nss \
  69. %endif
  70. %if %{with testagents}
  71. --enable-testagents \
  72. %endif
  73. %if %{with watchdog}
  74. --enable-watchdog \
  75. %endif
  76. %if %{with monitoring}
  77. --enable-monitoring \
  78. %endif
  79. %if %{with snmp}
  80. --enable-snmp \
  81. %endif
  82. %if %{with dbus}
  83. --enable-dbus \
  84. %endif
  85. %if %{with rdma}
  86. --enable-rdma \
  87. %endif
  88. %if %{with systemd}
  89. --enable-systemd \
  90. %endif
  91. --with-initddir=%{_initrddir}
  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-objctl
  125. %{_sbindir}/corosync-cfgtool
  126. %{_sbindir}/corosync-fplay
  127. %{_sbindir}/corosync-pload
  128. %{_sbindir}/corosync-cpgtool
  129. %{_sbindir}/corosync-quorumtool
  130. %{_sbindir}/corosync-notifyd
  131. %{_bindir}/corosync-blackbox
  132. %dir %{_sysconfdir}/corosync
  133. %dir %{_sysconfdir}/corosync/service.d
  134. %dir %{_sysconfdir}/corosync/uidgid.d
  135. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  136. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  137. %if %{with dbus}
  138. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  139. %endif
  140. %if %{with snmp}
  141. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  142. %endif
  143. %if %{with systemd}
  144. %{_unitdir}/corosync.service
  145. %{_unitdir}/corosync-notifyd.service
  146. %else
  147. %{_initrddir}/corosync
  148. %{_initrddir}/corosync-notifyd
  149. %endif
  150. %dir %{_libexecdir}/lcrso
  151. %{_libexecdir}/lcrso/coroparse.lcrso
  152. %{_libexecdir}/lcrso/service_cfg.lcrso
  153. %{_libexecdir}/lcrso/service_cpg.lcrso
  154. %{_libexecdir}/lcrso/service_evs.lcrso
  155. %{_libexecdir}/lcrso/service_cmap.lcrso
  156. %{_libexecdir}/lcrso/service_pload.lcrso
  157. %{_libexecdir}/lcrso/quorum_votequorum.lcrso
  158. %{_libexecdir}/lcrso/quorum_testquorum.lcrso
  159. %{_libexecdir}/lcrso/vsf_quorum.lcrso
  160. %{_libexecdir}/lcrso/vsf_ykd.lcrso
  161. %if %{with watchdog}
  162. %{_libexecdir}/lcrso/service_wd.lcrso
  163. %endif
  164. %if %{with monitoring}
  165. %{_libexecdir}/lcrso/service_mon.lcrso
  166. %endif
  167. %dir %{_localstatedir}/lib/corosync
  168. %dir %{_localstatedir}/log/cluster
  169. %{_mandir}/man8/corosync_overview.8*
  170. %{_mandir}/man8/corosync.8*
  171. %{_mandir}/man8/corosync-blackbox.8*
  172. %{_mandir}/man8/corosync-objctl.8*
  173. %{_mandir}/man8/corosync-keygen.8*
  174. %{_mandir}/man8/corosync-cfgtool.8*
  175. %{_mandir}/man8/corosync-cpgtool.8*
  176. %{_mandir}/man8/corosync-fplay.8*
  177. %{_mandir}/man8/corosync-pload.8*
  178. %{_mandir}/man8/corosync-notifyd.8*
  179. %{_mandir}/man8/corosync-quorumtool.8*
  180. %{_mandir}/man5/corosync.conf.5*
  181. # optional testagent rpm
  182. #
  183. %if %{with testagents}
  184. %package -n corosync-testagents
  185. Summary: The Corosync Cluster Engine Test Agents
  186. Group: Development/Libraries
  187. Requires: %{name} = %{version}-%{release}
  188. %description -n corosync-testagents
  189. This package contains corosync test agents.
  190. %files -n corosync-testagents
  191. %defattr(755,root,root,-)
  192. %{_datadir}/corosync/tests/mem_leak_test.sh
  193. %{_datadir}/corosync/tests/net_breaker.sh
  194. %{_bindir}/cpg_test_agent
  195. %{_bindir}/sam_test_agent
  196. %{_bindir}/votequorum_test_agent
  197. %{_libexecdir}/lcrso/service_syncv2.lcrso
  198. %endif
  199. # library
  200. #
  201. %package -n corosynclib
  202. Summary: The Corosync Cluster Engine Libraries
  203. Group: System Environment/Libraries
  204. Requires: %{name} = %{version}-%{release}
  205. %description -n corosynclib
  206. This package contains corosync libraries.
  207. %files -n corosynclib
  208. %defattr(-,root,root,-)
  209. %doc LICENSE
  210. %{_libdir}/libcfg.so.*
  211. %{_libdir}/libcpg.so.*
  212. %{_libdir}/libcmap.so.*
  213. %{_libdir}/libevs.so.*
  214. %{_libdir}/libtotem_pg.so.*
  215. %{_libdir}/liblogsys.so.*
  216. %{_libdir}/libicmap.so.*
  217. %{_libdir}/libquorum.so.*
  218. %{_libdir}/libvotequorum.so.*
  219. %{_libdir}/libpload.so.*
  220. %{_libdir}/libsam.so.*
  221. %post -n corosynclib -p /sbin/ldconfig
  222. %postun -n corosynclib -p /sbin/ldconfig
  223. %package -n corosynclib-devel
  224. Summary: The Corosync Cluster Engine Development Kit
  225. Group: Development/Libraries
  226. Requires: corosynclib = %{version}-%{release}
  227. Requires: pkgconfig
  228. Provides: corosync-devel = %{version}
  229. Obsoletes: corosync-devel < 0.92-7
  230. %description -n corosynclib-devel
  231. This package contains include files and man pages used to develop using
  232. The Corosync Cluster Engine APIs.
  233. %files -n corosynclib-devel
  234. %defattr(-,root,root,-)
  235. %doc LICENSE
  236. %dir %{_includedir}/corosync/
  237. %{_includedir}/corosync/cs_config.h
  238. %{_includedir}/corosync/corodefs.h
  239. %{_includedir}/corosync/cfg.h
  240. %{_includedir}/corosync/cmap.h
  241. %{_includedir}/corosync/corotypes.h
  242. %{_includedir}/corosync/cpg.h
  243. %{_includedir}/corosync/evs.h
  244. %{_includedir}/corosync/hdb.h
  245. %{_includedir}/corosync/list.h
  246. %{_includedir}/corosync/mar_gen.h
  247. %{_includedir}/corosync/sam.h
  248. %{_includedir}/corosync/swab.h
  249. %{_includedir}/corosync/quorum.h
  250. %{_includedir}/corosync/votequorum.h
  251. %dir %{_includedir}/corosync/totem/
  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/icmap.h
  264. %{_includedir}/corosync/engine/quorum.h
  265. %{_libdir}/libcfg.so
  266. %{_libdir}/libcpg.so
  267. %{_libdir}/libcmap.so
  268. %{_libdir}/libevs.so
  269. %{_libdir}/libtotem_pg.so
  270. %{_libdir}/liblogsys.so
  271. %{_libdir}/libquorum.so
  272. %{_libdir}/libvotequorum.so
  273. %{_libdir}/libpload.so
  274. %{_libdir}/libsam.so
  275. %{_libdir}/pkgconfig/*.pc
  276. %{_mandir}/man3/cpg_*3*
  277. %{_mandir}/man3/evs_*3*
  278. %{_mandir}/man3/confdb_*3*
  279. %{_mandir}/man3/votequorum_*3*
  280. %{_mandir}/man3/sam_*3*
  281. %{_mandir}/man8/cpg_overview.8*
  282. %{_mandir}/man8/evs_overview.8*
  283. %{_mandir}/man8/confdb_overview.8*
  284. %{_mandir}/man8/votequorum_overview.8*
  285. %{_mandir}/man8/sam_overview.8*
  286. %changelog
  287. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  288. - Autotools generated version