corosync.spec.in 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. %endif
  139. %dir %{_sysconfdir}/corosync
  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 %{_localstatedir}/lib/corosync
  157. %dir %{_localstatedir}/log/cluster
  158. %{_mandir}/man8/corosync_overview.8*
  159. %{_mandir}/man8/corosync.8*
  160. %{_mandir}/man8/corosync-blackbox.8*
  161. %{_mandir}/man8/corosync-cmapctl.8*
  162. %{_mandir}/man8/corosync-keygen.8*
  163. %{_mandir}/man8/corosync-cfgtool.8*
  164. %{_mandir}/man8/corosync-cpgtool.8*
  165. %{_mandir}/man8/corosync-fplay.8*
  166. %{_mandir}/man8/corosync-pload.8*
  167. %{_mandir}/man8/corosync-notifyd.8*
  168. %{_mandir}/man8/corosync-quorumtool.8*
  169. %{_mandir}/man5/corosync.conf.5*
  170. %{_mandir}/man5/votequorum.5*
  171. # optional testagent rpm
  172. #
  173. %if %{with testagents}
  174. %package -n corosync-testagents
  175. Summary: The Corosync Cluster Engine Test Agents
  176. Group: Development/Libraries
  177. Requires: %{name} = %{version}-%{release}
  178. %description -n corosync-testagents
  179. This package contains corosync test agents.
  180. %files -n corosync-testagents
  181. %defattr(755,root,root,-)
  182. %{_datadir}/corosync/tests/mem_leak_test.sh
  183. %{_datadir}/corosync/tests/net_breaker.sh
  184. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  185. %{_datadir}/corosync/tests/shm_leak_audit.sh
  186. %{_bindir}/cpg_test_agent
  187. %{_bindir}/sam_test_agent
  188. %{_bindir}/votequorum_test_agent
  189. %endif
  190. # library
  191. #
  192. %package -n corosynclib
  193. Summary: The Corosync Cluster Engine Libraries
  194. Group: System Environment/Libraries
  195. Requires: %{name} = %{version}-%{release}
  196. %description -n corosynclib
  197. This package contains corosync libraries.
  198. %files -n corosynclib
  199. %defattr(-,root,root,-)
  200. %doc LICENSE
  201. %{_libdir}/libcfg.so.*
  202. %{_libdir}/libcpg.so.*
  203. %{_libdir}/libcmap.so.*
  204. %{_libdir}/libevs.so.*
  205. %{_libdir}/libtotem_pg.so.*
  206. %{_libdir}/libquorum.so.*
  207. %{_libdir}/libvotequorum.so.*
  208. %{_libdir}/libpload.so.*
  209. %{_libdir}/libsam.so.*
  210. %post -n corosynclib -p /sbin/ldconfig
  211. %postun -n corosynclib -p /sbin/ldconfig
  212. %package -n corosynclib-devel
  213. Summary: The Corosync Cluster Engine Development Kit
  214. Group: Development/Libraries
  215. Requires: corosynclib = %{version}-%{release}
  216. Requires: pkgconfig
  217. Provides: corosync-devel = %{version}
  218. Obsoletes: corosync-devel < 0.92-7
  219. %description -n corosynclib-devel
  220. This package contains include files and man pages used to develop using
  221. The Corosync Cluster Engine APIs.
  222. %files -n corosynclib-devel
  223. %defattr(-,root,root,-)
  224. %doc LICENSE
  225. %dir %{_includedir}/corosync/
  226. %{_includedir}/corosync/cs_config.h
  227. %{_includedir}/corosync/corodefs.h
  228. %{_includedir}/corosync/cfg.h
  229. %{_includedir}/corosync/cmap.h
  230. %{_includedir}/corosync/corotypes.h
  231. %{_includedir}/corosync/cpg.h
  232. %{_includedir}/corosync/evs.h
  233. %{_includedir}/corosync/hdb.h
  234. %{_includedir}/corosync/list.h
  235. %{_includedir}/corosync/mar_gen.h
  236. %{_includedir}/corosync/sam.h
  237. %{_includedir}/corosync/swab.h
  238. %{_includedir}/corosync/quorum.h
  239. %{_includedir}/corosync/votequorum.h
  240. %dir %{_includedir}/corosync/totem/
  241. %{_includedir}/corosync/totem/totem.h
  242. %{_includedir}/corosync/totem/totemip.h
  243. %{_includedir}/corosync/totem/totempg.h
  244. %dir %{_includedir}/corosync/engine
  245. %{_includedir}/corosync/engine/quorum.h
  246. %{_libdir}/libcfg.so
  247. %{_libdir}/libcpg.so
  248. %{_libdir}/libcmap.so
  249. %{_libdir}/libevs.so
  250. %{_libdir}/libtotem_pg.so
  251. %{_libdir}/libquorum.so
  252. %{_libdir}/libvotequorum.so
  253. %{_libdir}/libpload.so
  254. %{_libdir}/libsam.so
  255. %{_libdir}/pkgconfig/*.pc
  256. %{_mandir}/man3/cpg_*3*
  257. %{_mandir}/man3/evs_*3*
  258. %{_mandir}/man3/quorum_*3*
  259. %{_mandir}/man3/votequorum_*3*
  260. %{_mandir}/man3/sam_*3*
  261. %{_mandir}/man8/cpg_overview.8*
  262. %{_mandir}/man8/evs_overview.8*
  263. %{_mandir}/man8/votequorum_overview.8*
  264. %{_mandir}/man8/sam_overview.8*
  265. %changelog
  266. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  267. - Autotools generated version