corosync.spec.in 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  16. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  17. Name: corosync
  18. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  19. Version: @version@
  20. Release: 1%{?gitver}%{?dist}
  21. License: BSD
  22. Group: System Environment/Base
  23. URL: http://ftp.corosync.org
  24. Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?gittarver}.tar.gz
  25. # Runtime bits
  26. Requires: corosynclib = %{version}-%{release}
  27. Requires(pre): /usr/sbin/useradd
  28. Requires(post): /sbin/chkconfig
  29. Requires(preun): /sbin/chkconfig
  30. Conflicts: openais <= 0.89, openais-devel <= 0.89
  31. # Build bits
  32. %define buildtrunk 0
  33. %{?_with_buildtrunk: %define buildtrunk 1}
  34. BuildRequires: groff
  35. BuildRequires: libqb-devel
  36. BuildRequires: nss-devel
  37. %if %{buildtrunk}
  38. BuildRequires: autoconf automake
  39. %endif
  40. %if %{with monitoring}
  41. BuildRequires: libstatgrab-devel
  42. %endif
  43. %if %{with rdma}
  44. BuildRequires: libibverbs-devel librdmacm-devel
  45. %endif
  46. %if %{with snmp}
  47. BuildRequires: net-snmp-devel
  48. %endif
  49. %if %{with dbus}
  50. BuildRequires: dbus-devel
  51. %endif
  52. %if %{with systemd}
  53. BuildRequires: systemd-units
  54. %endif
  55. %if %{with xmlconf}
  56. Requires: libxslt
  57. %endif
  58. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  59. %prep
  60. %setup -q -n %{name}-%{version}%{?gittarver}
  61. %build
  62. %if %{buildtrunk}
  63. ./autogen.sh
  64. %endif
  65. %if %{with rdma}
  66. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  67. export ibverbs_LIBS=-libverbs \
  68. export rdmacm_CFLAGS=-I/usr/include/rdma \
  69. export rdmacm_LIBS=-lrdmacm \
  70. %endif
  71. %{configure} \
  72. %if %{with testagents}
  73. --enable-testagents \
  74. %endif
  75. %if %{with watchdog}
  76. --enable-watchdog \
  77. %endif
  78. %if %{with monitoring}
  79. --enable-monitoring \
  80. %endif
  81. %if %{with snmp}
  82. --enable-snmp \
  83. %endif
  84. %if %{with dbus}
  85. --enable-dbus \
  86. %endif
  87. %if %{with rdma}
  88. --enable-rdma \
  89. %endif
  90. %if %{with systemd}
  91. --enable-systemd \
  92. %endif
  93. %if %{with xmlconf}
  94. --enable-xmlconf \
  95. %endif
  96. --with-initddir=%{_initrddir} \
  97. --with-systemddir=%{_unitdir}
  98. make %{_smp_mflags}
  99. %install
  100. rm -rf %{buildroot}
  101. make install DESTDIR=%{buildroot}
  102. %if %{with dbus}
  103. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  104. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  105. %endif
  106. ## tree fixup
  107. # drop static libs
  108. rm -f %{buildroot}%{_libdir}/*.a
  109. rm -f %{buildroot}%{_libdir}/*.la
  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-cpgtool
  134. %{_sbindir}/corosync-quorumtool
  135. %{_sbindir}/corosync-notifyd
  136. %{_bindir}/corosync-blackbox
  137. %if %{with xmlconf}
  138. %{_bindir}/corosync-xmlproc
  139. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  140. %dir %{_datadir}/corosync
  141. %dir %{_datadir}/corosync/xml2conf.xsl
  142. %{_mandir}/man8/corosync-xmlproc.8*
  143. %{_mandir}/man5/corosync.xml.5*
  144. %endif
  145. %dir %{_sysconfdir}/corosync
  146. %dir %{_sysconfdir}/corosync/uidgid.d
  147. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  148. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  149. %if %{with dbus}
  150. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  151. %endif
  152. %if %{with snmp}
  153. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  154. %endif
  155. %if %{with systemd}
  156. %{_unitdir}/corosync.service
  157. %{_unitdir}/corosync-notifyd.service
  158. %dir %{_datadir}/corosync
  159. %{_datadir}/corosync/corosync
  160. %{_datadir}/corosync/corosync-notifyd
  161. %else
  162. %{_initrddir}/corosync
  163. %{_initrddir}/corosync-notifyd
  164. %endif
  165. %dir %{_localstatedir}/lib/corosync
  166. %dir %{_localstatedir}/log/cluster
  167. %{_mandir}/man8/corosync_overview.8*
  168. %{_mandir}/man8/corosync.8*
  169. %{_mandir}/man8/corosync-blackbox.8*
  170. %{_mandir}/man8/corosync-cmapctl.8*
  171. %{_mandir}/man8/corosync-keygen.8*
  172. %{_mandir}/man8/corosync-cfgtool.8*
  173. %{_mandir}/man8/corosync-cpgtool.8*
  174. %{_mandir}/man8/corosync-notifyd.8*
  175. %{_mandir}/man8/corosync-quorumtool.8*
  176. %{_mandir}/man5/corosync.conf.5*
  177. %{_mandir}/man5/votequorum.5*
  178. %{_mandir}/man8/cmap_keys.8*
  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}/libtotem_pg.so.*
  213. %{_libdir}/libquorum.so.*
  214. %{_libdir}/libvotequorum.so.*
  215. %{_libdir}/libsam.so.*
  216. %{_libdir}/libcorosync_common.so.*
  217. %post -n corosynclib -p /sbin/ldconfig
  218. %postun -n corosynclib -p /sbin/ldconfig
  219. %package -n corosynclib-devel
  220. Summary: The Corosync Cluster Engine Development Kit
  221. Group: Development/Libraries
  222. Requires: corosynclib = %{version}-%{release}
  223. Requires: pkgconfig
  224. Provides: corosync-devel = %{version}
  225. Obsoletes: corosync-devel < 0.92-7
  226. %description -n corosynclib-devel
  227. This package contains include files and man pages used to develop using
  228. The Corosync Cluster Engine APIs.
  229. %files -n corosynclib-devel
  230. %defattr(-,root,root,-)
  231. %doc LICENSE
  232. %dir %{_includedir}/corosync/
  233. %{_includedir}/corosync/corodefs.h
  234. %{_includedir}/corosync/cfg.h
  235. %{_includedir}/corosync/cmap.h
  236. %{_includedir}/corosync/corotypes.h
  237. %{_includedir}/corosync/cpg.h
  238. %{_includedir}/corosync/hdb.h
  239. %{_includedir}/corosync/sam.h
  240. %{_includedir}/corosync/quorum.h
  241. %{_includedir}/corosync/votequorum.h
  242. %dir %{_includedir}/corosync/totem/
  243. %{_includedir}/corosync/totem/totem.h
  244. %{_includedir}/corosync/totem/totemip.h
  245. %{_includedir}/corosync/totem/totempg.h
  246. %{_libdir}/libcfg.so
  247. %{_libdir}/libcpg.so
  248. %{_libdir}/libcmap.so
  249. %{_libdir}/libtotem_pg.so
  250. %{_libdir}/libquorum.so
  251. %{_libdir}/libvotequorum.so
  252. %{_libdir}/libsam.so
  253. %{_libdir}/libcorosync_common.so
  254. %{_libdir}/pkgconfig/*.pc
  255. %{_mandir}/man3/cpg_*3*
  256. %{_mandir}/man3/quorum_*3*
  257. %{_mandir}/man3/votequorum_*3*
  258. %{_mandir}/man3/sam_*3*
  259. %{_mandir}/man8/cpg_overview.8*
  260. %{_mandir}/man8/votequorum_overview.8*
  261. %{_mandir}/man8/sam_overview.8*
  262. %{_mandir}/man3/cmap_*3*
  263. %{_mandir}/man8/cmap_overview.8*
  264. %{_mandir}/man8/quorum_overview.8*
  265. %changelog
  266. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  267. - Autotools generated version