corosync.spec.in 7.7 KB

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