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