corosync.spec.in 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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 systemd
  13. %bcond_with xmlconf
  14. %bcond_with runautogen
  15. %bcond_with libcgroup
  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. URL: http://corosync.github.io/corosync/
  24. Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
  25. # Runtime bits
  26. # The automatic dependency overridden in favor of explicit version lock
  27. Requires: corosynclib%{?_isa} = %{version}-%{release}
  28. # Build bits
  29. BuildRequires: groff
  30. BuildRequires: libqb-devel
  31. BuildRequires: nss-devel
  32. BuildRequires: libknet1-devel
  33. BuildRequires: zlib-devel
  34. %if %{with runautogen}
  35. BuildRequires: autoconf automake libtool
  36. %endif
  37. %if %{with monitoring}
  38. BuildRequires: libstatgrab-devel
  39. %endif
  40. %if %{with snmp}
  41. BuildRequires: net-snmp-devel
  42. %endif
  43. %if %{with dbus}
  44. BuildRequires: dbus-devel
  45. %endif
  46. %if %{with systemd}
  47. %{?systemd_requires}
  48. BuildRequires: systemd
  49. BuildRequires: systemd-devel
  50. %else
  51. Requires(post): /sbin/chkconfig
  52. Requires(preun): /sbin/chkconfig
  53. %endif
  54. %if %{with xmlconf}
  55. Requires: libxslt
  56. %endif
  57. %if %{with libcgroup}
  58. BuildRequires: libcgroup-devel
  59. %endif
  60. %prep
  61. %setup -q -n %{name}-%{version}%{?gittarver}
  62. %build
  63. %if %{with runautogen}
  64. ./autogen.sh
  65. %endif
  66. %{configure} \
  67. %if %{with testagents}
  68. --enable-testagents \
  69. %endif
  70. %if %{with watchdog}
  71. --enable-watchdog \
  72. %endif
  73. %if %{with monitoring}
  74. --enable-monitoring \
  75. %endif
  76. %if %{with snmp}
  77. --enable-snmp \
  78. %endif
  79. %if %{with dbus}
  80. --enable-dbus \
  81. %endif
  82. %if %{with systemd}
  83. --enable-systemd \
  84. %endif
  85. %if %{with xmlconf}
  86. --enable-xmlconf \
  87. %endif
  88. %if %{with libcgroup}
  89. --enable-libcgroup \
  90. %endif
  91. --with-initddir=%{_initrddir} \
  92. --with-systemddir=%{_unitdir}
  93. make %{_smp_mflags}
  94. %install
  95. make install DESTDIR=%{buildroot}
  96. %if %{with dbus}
  97. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  98. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  99. %endif
  100. ## tree fixup
  101. # drop static libs
  102. rm -f %{buildroot}%{_libdir}/*.a
  103. rm -f %{buildroot}%{_libdir}/*.la
  104. # drop docs and html docs for now
  105. rm -rf %{buildroot}%{_docdir}/*
  106. # /etc/sysconfig/corosync-notifyd
  107. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  108. install -m 644 tools/corosync-notifyd.sysconfig.example \
  109. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  110. # /etc/sysconfig/corosync
  111. install -m 644 init/corosync.sysconfig.example \
  112. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  113. %clean
  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 %{with systemd} && 0%{?systemd_post:1}
  119. %systemd_post corosync.service
  120. %else
  121. if [ $1 -eq 1 ]; then
  122. /sbin/chkconfig --add corosync || :
  123. fi
  124. %endif
  125. %preun
  126. %if %{with systemd} && 0%{?systemd_preun:1}
  127. %systemd_preun corosync.service
  128. %else
  129. if [ $1 -eq 0 ]; then
  130. /sbin/service corosync stop &>/dev/null || :
  131. /sbin/chkconfig --del corosync || :
  132. fi
  133. %endif
  134. %postun
  135. %if %{with systemd} && 0%{?systemd_postun:1}
  136. %systemd_postun corosync.service
  137. %endif
  138. %files
  139. %doc LICENSE SECURITY
  140. %{_sbindir}/corosync
  141. %{_sbindir}/corosync-keygen
  142. %{_sbindir}/corosync-cmapctl
  143. %{_sbindir}/corosync-cfgtool
  144. %{_sbindir}/corosync-cpgtool
  145. %{_sbindir}/corosync-quorumtool
  146. %{_sbindir}/corosync-notifyd
  147. %{_bindir}/corosync-blackbox
  148. %if %{with xmlconf}
  149. %{_bindir}/corosync-xmlproc
  150. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  151. %dir %{_datadir}/corosync
  152. %{_datadir}/corosync/xml2conf.xsl
  153. %{_mandir}/man8/corosync-xmlproc.8*
  154. %{_mandir}/man5/corosync.xml.5*
  155. %endif
  156. %dir %{_sysconfdir}/corosync
  157. %dir %{_sysconfdir}/corosync/uidgid.d
  158. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  159. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  160. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  161. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  162. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  163. %if %{with dbus}
  164. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  165. %endif
  166. %if %{with snmp}
  167. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  168. %endif
  169. %if %{with systemd}
  170. %{_unitdir}/corosync.service
  171. %{_unitdir}/corosync-notifyd.service
  172. %else
  173. %{_initrddir}/corosync
  174. %{_initrddir}/corosync-notifyd
  175. %endif
  176. %dir %{_localstatedir}/lib/corosync
  177. %dir %{_localstatedir}/log/cluster
  178. %{_mandir}/man8/corosync_overview.7*
  179. %{_mandir}/man8/corosync.8*
  180. %{_mandir}/man8/corosync-blackbox.8*
  181. %{_mandir}/man8/corosync-cmapctl.8*
  182. %{_mandir}/man8/corosync-keygen.8*
  183. %{_mandir}/man8/corosync-cfgtool.8*
  184. %{_mandir}/man8/corosync-cpgtool.8*
  185. %{_mandir}/man8/corosync-notifyd.8*
  186. %{_mandir}/man8/corosync-quorumtool.8*
  187. %{_mandir}/man5/corosync.conf.5*
  188. %{_mandir}/man5/votequorum.5*
  189. %{_mandir}/man8/cmap_keys.8*
  190. # optional testagent rpm
  191. #
  192. %if %{with testagents}
  193. %package -n corosync-testagents
  194. Summary: The Corosync Cluster Engine Test Agents
  195. Requires: %{name} = %{version}-%{release}
  196. %description -n corosync-testagents
  197. This package contains corosync test agents.
  198. %files -n corosync-testagents
  199. %defattr(755,root,root,-)
  200. %{_datadir}/corosync/tests/mem_leak_test.sh
  201. %{_datadir}/corosync/tests/net_breaker.sh
  202. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  203. %{_datadir}/corosync/tests/shm_leak_audit.sh
  204. %{_bindir}/cpg_test_agent
  205. %{_bindir}/sam_test_agent
  206. %{_bindir}/votequorum_test_agent
  207. %endif
  208. # library
  209. #
  210. %package -n corosynclib
  211. Summary: The Corosync Cluster Engine Libraries
  212. %description -n corosynclib
  213. This package contains corosync libraries.
  214. %files -n corosynclib
  215. %doc LICENSE
  216. %{_libdir}/libcfg.so.*
  217. %{_libdir}/libcpg.so.*
  218. %{_libdir}/libcmap.so.*
  219. %{_libdir}/libtotem_pg.so.*
  220. %{_libdir}/libquorum.so.*
  221. %{_libdir}/libvotequorum.so.*
  222. %{_libdir}/libsam.so.*
  223. %{_libdir}/libcorosync_common.so.*
  224. %post -n corosynclib -p /sbin/ldconfig
  225. %postun -n corosynclib -p /sbin/ldconfig
  226. %package -n corosynclib-devel
  227. Summary: The Corosync Cluster Engine Development Kit
  228. Requires: corosynclib%{?_isa} = %{version}-%{release}
  229. Requires: pkgconfig
  230. Provides: corosync-devel = %{version}
  231. %description -n corosynclib-devel
  232. This package contains include files and man pages used to develop using
  233. The Corosync Cluster Engine APIs.
  234. %files -n corosynclib-devel
  235. %doc LICENSE
  236. %dir %{_includedir}/corosync/
  237. %{_includedir}/corosync/corodefs.h
  238. %{_includedir}/corosync/cfg.h
  239. %{_includedir}/corosync/cmap.h
  240. %{_includedir}/corosync/corotypes.h
  241. %{_includedir}/corosync/cpg.h
  242. %{_includedir}/corosync/hdb.h
  243. %{_includedir}/corosync/sam.h
  244. %{_includedir}/corosync/quorum.h
  245. %{_includedir}/corosync/votequorum.h
  246. %dir %{_includedir}/corosync/totem/
  247. %{_includedir}/corosync/totem/totem.h
  248. %{_includedir}/corosync/totem/totemip.h
  249. %{_includedir}/corosync/totem/totempg.h
  250. %{_includedir}/corosync/totem/totemstats.h
  251. %{_libdir}/libcfg.so
  252. %{_libdir}/libcpg.so
  253. %{_libdir}/libcmap.so
  254. %{_libdir}/libtotem_pg.so
  255. %{_libdir}/libquorum.so
  256. %{_libdir}/libvotequorum.so
  257. %{_libdir}/libsam.so
  258. %{_libdir}/libcorosync_common.so
  259. %{_libdir}/pkgconfig/*.pc
  260. %{_mandir}/man3/cpg_*3*
  261. %{_mandir}/man3/quorum_*3*
  262. %{_mandir}/man3/votequorum_*3*
  263. %{_mandir}/man3/sam_*3*
  264. %{_mandir}/man8/cpg_overview.3*
  265. %{_mandir}/man8/votequorum_overview.3*
  266. %{_mandir}/man8/sam_overview.3*
  267. %{_mandir}/man3/cmap_*3*
  268. %{_mandir}/man8/cmap_overview.3*
  269. %{_mandir}/man8/quorum_overview.3*
  270. %changelog
  271. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  272. - Autotools generated version