corosync.spec.in 7.6 KB

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