corosync.spec.in 7.3 KB

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