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. %if %{with xmlconf}
  96. --enable-xmlconf \
  97. %endif
  98. --with-initddir=%{_initrddir}
  99. make %{_smp_mflags}
  100. %install
  101. rm -rf %{buildroot}
  102. make install DESTDIR=%{buildroot}
  103. %if %{with dbus}
  104. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  105. install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  106. %endif
  107. ## tree fixup
  108. # drop static libs
  109. rm -f %{buildroot}%{_libdir}/*.a
  110. # drop docs and html docs for now
  111. rm -rf %{buildroot}%{_docdir}/*
  112. %clean
  113. rm -rf %{buildroot}
  114. %description
  115. This package contains the Corosync Cluster Engine Executive, several default
  116. APIs and libraries, default configuration files, and an init script.
  117. %post
  118. if [ $1 -eq 1 ]; then
  119. /sbin/chkconfig --add corosync || :
  120. fi
  121. %preun
  122. if [ $1 -eq 0 ]; then
  123. /sbin/service corosync stop &>/dev/null || :
  124. /sbin/chkconfig --del corosync || :
  125. fi
  126. %files
  127. %defattr(-,root,root,-)
  128. %doc LICENSE SECURITY
  129. %{_sbindir}/corosync
  130. %{_sbindir}/corosync-keygen
  131. %{_sbindir}/corosync-cmapctl
  132. %{_sbindir}/corosync-cfgtool
  133. %{_sbindir}/corosync-fplay
  134. %{_sbindir}/corosync-pload
  135. %{_sbindir}/corosync-cpgtool
  136. %{_sbindir}/corosync-quorumtool
  137. %{_sbindir}/corosync-notifyd
  138. %{_bindir}/corosync-blackbox
  139. %if %{with xmlconf}
  140. %{_bindir}/corosync-xmlproc
  141. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  142. %dir %{_datadir}/corosync
  143. %dir %{_datadir}/corosync/xml2conf.xsl
  144. %{_mandir}/man8/corosync-xmlproc.8*
  145. %{_mandir}/man5/corosync.xml.5*
  146. %endif
  147. %dir %{_sysconfdir}/corosync
  148. %dir %{_sysconfdir}/corosync/uidgid.d
  149. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  150. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  151. %if %{with dbus}
  152. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  153. %endif
  154. %if %{with snmp}
  155. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  156. %endif
  157. %if %{with systemd}
  158. %{_unitdir}/corosync.service
  159. %{_unitdir}/corosync-notifyd.service
  160. %else
  161. %{_initrddir}/corosync
  162. %{_initrddir}/corosync-notifyd
  163. %endif
  164. %dir %{_localstatedir}/lib/corosync
  165. %dir %{_localstatedir}/log/cluster
  166. %{_mandir}/man8/corosync_overview.8*
  167. %{_mandir}/man8/corosync.8*
  168. %{_mandir}/man8/corosync-blackbox.8*
  169. %{_mandir}/man8/corosync-cmapctl.8*
  170. %{_mandir}/man8/corosync-keygen.8*
  171. %{_mandir}/man8/corosync-cfgtool.8*
  172. %{_mandir}/man8/corosync-cpgtool.8*
  173. %{_mandir}/man8/corosync-fplay.8*
  174. %{_mandir}/man8/corosync-pload.8*
  175. %{_mandir}/man8/corosync-notifyd.8*
  176. %{_mandir}/man8/corosync-quorumtool.8*
  177. %{_mandir}/man5/corosync.conf.5*
  178. %{_mandir}/man5/votequorum.5*
  179. # optional testagent rpm
  180. #
  181. %if %{with testagents}
  182. %package -n corosync-testagents
  183. Summary: The Corosync Cluster Engine Test Agents
  184. Group: Development/Libraries
  185. Requires: %{name} = %{version}-%{release}
  186. %description -n corosync-testagents
  187. This package contains corosync test agents.
  188. %files -n corosync-testagents
  189. %defattr(755,root,root,-)
  190. %{_datadir}/corosync/tests/mem_leak_test.sh
  191. %{_datadir}/corosync/tests/net_breaker.sh
  192. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  193. %{_datadir}/corosync/tests/shm_leak_audit.sh
  194. %{_bindir}/cpg_test_agent
  195. %{_bindir}/sam_test_agent
  196. %{_bindir}/votequorum_test_agent
  197. %endif
  198. # library
  199. #
  200. %package -n corosynclib
  201. Summary: The Corosync Cluster Engine Libraries
  202. Group: System Environment/Libraries
  203. Requires: %{name} = %{version}-%{release}
  204. %description -n corosynclib
  205. This package contains corosync libraries.
  206. %files -n corosynclib
  207. %defattr(-,root,root,-)
  208. %doc LICENSE
  209. %{_libdir}/libcfg.so.*
  210. %{_libdir}/libcpg.so.*
  211. %{_libdir}/libcmap.so.*
  212. %{_libdir}/libevs.so.*
  213. %{_libdir}/libtotem_pg.so.*
  214. %{_libdir}/libquorum.so.*
  215. %{_libdir}/libvotequorum.so.*
  216. %{_libdir}/libpload.so.*
  217. %{_libdir}/libsam.so.*
  218. %{_libdir}/libcorosync_common.so.*
  219. %post -n corosynclib -p /sbin/ldconfig
  220. %postun -n corosynclib -p /sbin/ldconfig
  221. %package -n corosynclib-devel
  222. Summary: The Corosync Cluster Engine Development Kit
  223. Group: Development/Libraries
  224. Requires: corosynclib = %{version}-%{release}
  225. Requires: pkgconfig
  226. Provides: corosync-devel = %{version}
  227. Obsoletes: corosync-devel < 0.92-7
  228. %description -n corosynclib-devel
  229. This package contains include files and man pages used to develop using
  230. The Corosync Cluster Engine APIs.
  231. %files -n corosynclib-devel
  232. %defattr(-,root,root,-)
  233. %doc LICENSE
  234. %dir %{_includedir}/corosync/
  235. %{_includedir}/corosync/corodefs.h
  236. %{_includedir}/corosync/cfg.h
  237. %{_includedir}/corosync/cmap.h
  238. %{_includedir}/corosync/corotypes.h
  239. %{_includedir}/corosync/cpg.h
  240. %{_includedir}/corosync/evs.h
  241. %{_includedir}/corosync/hdb.h
  242. %{_includedir}/corosync/sam.h
  243. %{_includedir}/corosync/quorum.h
  244. %{_includedir}/corosync/votequorum.h
  245. %dir %{_includedir}/corosync/totem/
  246. %{_includedir}/corosync/totem/totem.h
  247. %{_includedir}/corosync/totem/totemip.h
  248. %{_includedir}/corosync/totem/totempg.h
  249. %{_libdir}/libcfg.so
  250. %{_libdir}/libcpg.so
  251. %{_libdir}/libcmap.so
  252. %{_libdir}/libevs.so
  253. %{_libdir}/libtotem_pg.so
  254. %{_libdir}/libquorum.so
  255. %{_libdir}/libvotequorum.so
  256. %{_libdir}/libpload.so
  257. %{_libdir}/libsam.so
  258. %{_libdir}/libcorosync_common.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. %{_mandir}/man8/quorum_overview.8*
  272. %changelog
  273. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  274. - Autotools generated version