corosync.spec.in 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. @ALPHATAG@
  2. @NUMCOMM@
  3. @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 xmlconf
  15. %bcond_with runautogen
  16. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  17. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  18. Name: corosync
  19. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  20. Version: @version@
  21. Release: 1%{?gitver}%{?dist}
  22. License: BSD
  23. Group: System Environment/Base
  24. URL: http://ftp.corosync.org
  25. Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?gittarver}.tar.gz
  26. # Runtime bits
  27. Requires: corosynclib = %{version}-%{release}
  28. Requires(pre): /usr/sbin/useradd
  29. Requires(post): /sbin/chkconfig
  30. Requires(preun): /sbin/chkconfig
  31. Conflicts: openais <= 0.89, openais-devel <= 0.89
  32. # Build bits
  33. BuildRequires: groff
  34. BuildRequires: libqb-devel
  35. BuildRequires: nss-devel
  36. %if %{with runautogen}
  37. BuildRequires: autoconf automake libtool
  38. %endif
  39. %if %{with monitoring}
  40. BuildRequires: libstatgrab-devel
  41. %endif
  42. %if %{with rdma}
  43. BuildRequires: libibverbs-devel librdmacm-devel
  44. %endif
  45. %if %{with snmp}
  46. BuildRequires: net-snmp-devel
  47. %endif
  48. %if %{with dbus}
  49. BuildRequires: dbus-devel
  50. %endif
  51. %if %{with systemd}
  52. BuildRequires: systemd-units
  53. %endif
  54. %if %{with xmlconf}
  55. Requires: libxslt
  56. %endif
  57. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  58. %prep
  59. %setup -q -n %{name}-%{version}%{?gittarver}
  60. %build
  61. %if %{with runautogen}
  62. ./autogen.sh
  63. %endif
  64. %if %{with rdma}
  65. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  66. export ibverbs_LIBS=-libverbs \
  67. export rdmacm_CFLAGS=-I/usr/include/rdma \
  68. export rdmacm_LIBS=-lrdmacm \
  69. %endif
  70. %{configure} \
  71. %if %{with testagents}
  72. --enable-testagents \
  73. %endif
  74. %if %{with watchdog}
  75. --enable-watchdog \
  76. %endif
  77. %if %{with monitoring}
  78. --enable-monitoring \
  79. %endif
  80. %if %{with snmp}
  81. --enable-snmp \
  82. %endif
  83. %if %{with dbus}
  84. --enable-dbus \
  85. %endif
  86. %if %{with rdma}
  87. --enable-rdma \
  88. %endif
  89. %if %{with systemd}
  90. --enable-systemd \
  91. %endif
  92. %if %{with xmlconf}
  93. --enable-xmlconf \
  94. %endif
  95. --with-initddir=%{_initrddir} \
  96. --with-systemddir=%{_unitdir}
  97. make %{_smp_mflags}
  98. %install
  99. rm -rf %{buildroot}
  100. make install DESTDIR=%{buildroot}
  101. %if %{with dbus}
  102. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  103. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  104. %endif
  105. ## tree fixup
  106. # drop static libs
  107. rm -f %{buildroot}%{_libdir}/*.a
  108. rm -f %{buildroot}%{_libdir}/*.la
  109. # drop docs and html docs for now
  110. rm -rf %{buildroot}%{_docdir}/*
  111. %clean
  112. rm -rf %{buildroot}
  113. %description
  114. This package contains the Corosync Cluster Engine Executive, several default
  115. APIs and libraries, default configuration files, and an init script.
  116. %post
  117. if [ $1 -eq 1 ]; then
  118. /sbin/chkconfig --add corosync || :
  119. fi
  120. %preun
  121. if [ $1 -eq 0 ]; then
  122. /sbin/service corosync stop &>/dev/null || :
  123. /sbin/chkconfig --del corosync || :
  124. fi
  125. %files
  126. %defattr(-,root,root,-)
  127. %doc LICENSE SECURITY
  128. %{_sbindir}/corosync
  129. %{_sbindir}/corosync-keygen
  130. %{_sbindir}/corosync-cmapctl
  131. %{_sbindir}/corosync-cfgtool
  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. %dir %{_datadir}/corosync
  158. %{_datadir}/corosync/corosync
  159. %{_datadir}/corosync/corosync-notifyd
  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-notifyd.8*
  174. %{_mandir}/man8/corosync-quorumtool.8*
  175. %{_mandir}/man5/corosync.conf.5*
  176. %{_mandir}/man5/votequorum.5*
  177. %{_mandir}/man8/cmap_keys.8*
  178. # optional testagent rpm
  179. #
  180. %if %{with testagents}
  181. %package -n corosync-testagents
  182. Summary: The Corosync Cluster Engine Test Agents
  183. Group: Development/Libraries
  184. Requires: %{name} = %{version}-%{release}
  185. %description -n corosync-testagents
  186. This package contains corosync test agents.
  187. %files -n corosync-testagents
  188. %defattr(755,root,root,-)
  189. %{_datadir}/corosync/tests/mem_leak_test.sh
  190. %{_datadir}/corosync/tests/net_breaker.sh
  191. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  192. %{_datadir}/corosync/tests/shm_leak_audit.sh
  193. %{_bindir}/cpg_test_agent
  194. %{_bindir}/sam_test_agent
  195. %{_bindir}/votequorum_test_agent
  196. %endif
  197. # library
  198. #
  199. %package -n corosynclib
  200. Summary: The Corosync Cluster Engine Libraries
  201. Group: System Environment/Libraries
  202. Requires: %{name} = %{version}-%{release}
  203. %description -n corosynclib
  204. This package contains corosync libraries.
  205. %files -n corosynclib
  206. %defattr(-,root,root,-)
  207. %doc LICENSE
  208. %{_libdir}/libcfg.so.*
  209. %{_libdir}/libcpg.so.*
  210. %{_libdir}/libcmap.so.*
  211. %{_libdir}/libtotem_pg.so.*
  212. %{_libdir}/libquorum.so.*
  213. %{_libdir}/libvotequorum.so.*
  214. %{_libdir}/libsam.so.*
  215. %{_libdir}/libcorosync_common.so.*
  216. %post -n corosynclib -p /sbin/ldconfig
  217. %postun -n corosynclib -p /sbin/ldconfig
  218. %package -n corosynclib-devel
  219. Summary: The Corosync Cluster Engine Development Kit
  220. Group: Development/Libraries
  221. Requires: corosynclib = %{version}-%{release}
  222. Requires: pkgconfig
  223. Provides: corosync-devel = %{version}
  224. Obsoletes: corosync-devel < 0.92-7
  225. %description -n corosynclib-devel
  226. This package contains include files and man pages used to develop using
  227. The Corosync Cluster Engine APIs.
  228. %files -n corosynclib-devel
  229. %defattr(-,root,root,-)
  230. %doc LICENSE
  231. %dir %{_includedir}/corosync/
  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/hdb.h
  238. %{_includedir}/corosync/sam.h
  239. %{_includedir}/corosync/quorum.h
  240. %{_includedir}/corosync/votequorum.h
  241. %dir %{_includedir}/corosync/totem/
  242. %{_includedir}/corosync/totem/totem.h
  243. %{_includedir}/corosync/totem/totemip.h
  244. %{_includedir}/corosync/totem/totempg.h
  245. %{_libdir}/libcfg.so
  246. %{_libdir}/libcpg.so
  247. %{_libdir}/libcmap.so
  248. %{_libdir}/libtotem_pg.so
  249. %{_libdir}/libquorum.so
  250. %{_libdir}/libvotequorum.so
  251. %{_libdir}/libsam.so
  252. %{_libdir}/libcorosync_common.so
  253. %{_libdir}/pkgconfig/*.pc
  254. %{_mandir}/man3/cpg_*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/votequorum_overview.8*
  260. %{_mandir}/man8/sam_overview.8*
  261. %{_mandir}/man3/cmap_*3*
  262. %{_mandir}/man8/cmap_overview.8*
  263. %{_mandir}/man8/quorum_overview.8*
  264. %changelog
  265. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  266. - Autotools generated version