corosync.spec.in 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 watchdog
  8. %bcond_with monitoring
  9. %bcond_with snmp
  10. %bcond_with dbus
  11. %bcond_with systemd
  12. %bcond_with xmlconf
  13. %bcond_with nozzle
  14. %bcond_with vqsim
  15. %bcond_with runautogen
  16. %bcond_with userflags
  17. %bcond_with wsdissector
  18. %if %{with wsdissector}
  19. %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
  20. %endif
  21. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  22. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  23. Name: corosync
  24. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  25. Version: @version@
  26. Release: 1%{?gitver}%{?dist}
  27. License: BSD-3-Clause
  28. URL: http://corosync.github.io/corosync/
  29. Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}%{?gittarver}.tar.gz
  30. # Runtime bits
  31. # The automatic dependency overridden in favor of explicit version lock
  32. Requires: corosynclib%{?_isa} = %{version}-%{release}
  33. # Support crypto reload
  34. Requires: libknet1 >= 1.18
  35. # Build bits
  36. BuildRequires: gcc
  37. %if 0%{?suse_version}
  38. BuildRequires: groff-full
  39. %else
  40. BuildRequires: groff
  41. %endif
  42. BuildRequires: libqb-devel
  43. BuildRequires: libknet1-devel >= 1.18
  44. BuildRequires: zlib-devel
  45. %if %{with runautogen}
  46. BuildRequires: autoconf automake libtool
  47. %endif
  48. %if %{with monitoring}
  49. BuildRequires: libstatgrab-devel
  50. %endif
  51. %if %{with snmp}
  52. BuildRequires: net-snmp-devel
  53. %endif
  54. %if %{with dbus}
  55. %if 0%{?suse_version}
  56. BuildRequires: dbus-1-devel
  57. %else
  58. BuildRequires: dbus-devel
  59. %endif
  60. %endif
  61. %if %{with nozzle}
  62. BuildRequires: libnozzle1-devel
  63. %endif
  64. %if %{with systemd}
  65. %{?systemd_requires}
  66. BuildRequires: systemd
  67. BuildRequires: systemd-devel
  68. %else
  69. Requires(post): /sbin/chkconfig
  70. Requires(preun): /sbin/chkconfig
  71. %endif
  72. %if %{with xmlconf}
  73. Requires: libxslt
  74. %endif
  75. %if %{with vqsim}
  76. BuildRequires: readline-devel
  77. %endif
  78. %if %{with wsdissector}
  79. BuildRequires: wireshark-devel >= 4.6
  80. %endif
  81. %prep
  82. %setup -q -n %{name}-%{version}%{?gittarver}
  83. %build
  84. %if %{with runautogen}
  85. ./autogen.sh
  86. %endif
  87. %{configure} \
  88. %if %{with watchdog}
  89. --enable-watchdog \
  90. %endif
  91. %if %{with monitoring}
  92. --enable-monitoring \
  93. %endif
  94. %if %{with snmp}
  95. --enable-snmp \
  96. %endif
  97. %if %{with dbus}
  98. --enable-dbus \
  99. %endif
  100. %if %{with systemd}
  101. --enable-systemd \
  102. %endif
  103. %if %{with xmlconf}
  104. --enable-xmlconf \
  105. %endif
  106. %if %{with nozzle}
  107. --enable-nozzle \
  108. %endif
  109. %if %{with vqsim}
  110. --enable-vqsim \
  111. %endif
  112. %if %{with userflags}
  113. --enable-user-flags \
  114. %endif
  115. %if %{with wsdissector}
  116. --enable-wireshark-dissector \
  117. %endif
  118. --with-initddir=%{_initrddir} \
  119. --with-systemddir=%{_unitdir} \
  120. --docdir=%{_docdir}
  121. make %{_smp_mflags}
  122. %install
  123. make install DESTDIR=%{buildroot}
  124. %if %{with dbus}
  125. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  126. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_datadir}/dbus-1/system.d/corosync-signals.conf
  127. %endif
  128. ## tree fixup
  129. # drop static libs
  130. rm -f %{buildroot}%{_libdir}/*.a
  131. rm -f %{buildroot}%{_libdir}/*.la
  132. rm -f %{buildroot}%{wireshark_plugindir}/*.a
  133. rm -f %{buildroot}%{wireshark_plugindir}/*.la
  134. # drop docs and html docs for now
  135. rm -rf %{buildroot}%{_docdir}/*
  136. # /etc/sysconfig/corosync-notifyd
  137. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  138. install -m 644 tools/corosync-notifyd.sysconfig.example \
  139. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  140. # /etc/sysconfig/corosync
  141. install -m 644 init/corosync.sysconfig.example \
  142. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  143. %description
  144. This package contains the Corosync Cluster Engine Executive, several default
  145. APIs and libraries, default configuration files, and an init script.
  146. %post
  147. %if %{with systemd} && 0%{?systemd_post:1}
  148. %systemd_post corosync.service
  149. %else
  150. if [ $1 -eq 1 ]; then
  151. /sbin/chkconfig --add corosync || :
  152. fi
  153. %endif
  154. %preun
  155. %if %{with systemd} && 0%{?systemd_preun:1}
  156. %systemd_preun corosync.service
  157. %else
  158. if [ $1 -eq 0 ]; then
  159. /sbin/service corosync stop &>/dev/null || :
  160. /sbin/chkconfig --del corosync || :
  161. fi
  162. %endif
  163. %postun
  164. %if %{with systemd} && 0%{?systemd_postun:1}
  165. %systemd_postun corosync.service
  166. %endif
  167. %files
  168. %doc LICENSE
  169. %{_sbindir}/corosync
  170. %{_sbindir}/corosync-keygen
  171. %{_sbindir}/corosync-cmapctl
  172. %{_sbindir}/corosync-cfgtool
  173. %{_sbindir}/corosync-cpgtool
  174. %{_sbindir}/corosync-quorumtool
  175. %{_sbindir}/corosync-notifyd
  176. %{_bindir}/corosync-blackbox
  177. %if %{with xmlconf}
  178. %{_bindir}/corosync-xmlproc
  179. %dir %{_datadir}/corosync
  180. %{_datadir}/corosync/xml2conf.xsl
  181. %{_mandir}/man8/corosync-xmlproc.8*
  182. %{_mandir}/man5/corosync.xml.5*
  183. %endif
  184. %dir %{_sysconfdir}/corosync
  185. %dir %{_sysconfdir}/corosync/uidgid.d
  186. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  187. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  188. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  189. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  190. %if %{with dbus}
  191. %{_datadir}/dbus-1/system.d/corosync-signals.conf
  192. %endif
  193. %if %{with snmp}
  194. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  195. %endif
  196. %if %{with systemd}
  197. %{_unitdir}/corosync.service
  198. %{_unitdir}/corosync-notifyd.service
  199. %else
  200. %{_initrddir}/corosync
  201. %{_initrddir}/corosync-notifyd
  202. %endif
  203. %if %{without systemd}
  204. %dir %{_localstatedir}/lib/corosync
  205. %dir %{_localstatedir}/log/cluster
  206. %endif
  207. %{_mandir}/man7/corosync_overview.7*
  208. %{_mandir}/man8/corosync.8*
  209. %{_mandir}/man8/corosync-blackbox.8*
  210. %{_mandir}/man8/corosync-cmapctl.8*
  211. %{_mandir}/man8/corosync-keygen.8*
  212. %{_mandir}/man8/corosync-cfgtool.8*
  213. %{_mandir}/man8/corosync-cpgtool.8*
  214. %{_mandir}/man8/corosync-notifyd.8*
  215. %{_mandir}/man8/corosync-quorumtool.8*
  216. %{_mandir}/man5/corosync.conf.5*
  217. %{_mandir}/man5/votequorum.5*
  218. %{_mandir}/man7/cmap_keys.7*
  219. # library
  220. #
  221. %package -n corosynclib
  222. Summary: The Corosync Cluster Engine Libraries
  223. %description -n corosynclib
  224. This package contains corosync libraries.
  225. %files -n corosynclib
  226. %doc LICENSE
  227. %{_libdir}/libcfg.so.*
  228. %{_libdir}/libcpg.so.*
  229. %{_libdir}/libcmap.so.*
  230. %{_libdir}/libquorum.so.*
  231. %{_libdir}/libvotequorum.so.*
  232. %{_libdir}/libsam.so.*
  233. %{_libdir}/libcorosync_common.so.*
  234. %post -n corosynclib -p /sbin/ldconfig
  235. %postun -n corosynclib -p /sbin/ldconfig
  236. %package -n corosynclib-devel
  237. Summary: The Corosync Cluster Engine Development Kit
  238. Requires: corosynclib%{?_isa} = %{version}-%{release}
  239. Requires: pkgconfig
  240. Provides: corosync-devel = %{version}-%{release}
  241. Provides: corosync-devel%{?_isa} = %{version}-%{release}
  242. %description -n corosynclib-devel
  243. This package contains include files and man pages used to develop using
  244. The Corosync Cluster Engine APIs.
  245. %files -n corosynclib-devel
  246. %doc LICENSE
  247. %dir %{_includedir}/corosync/
  248. %{_includedir}/corosync/corodefs.h
  249. %{_includedir}/corosync/cfg.h
  250. %{_includedir}/corosync/cmap.h
  251. %{_includedir}/corosync/corotypes.h
  252. %{_includedir}/corosync/cpg.h
  253. %{_includedir}/corosync/hdb.h
  254. %{_includedir}/corosync/sam.h
  255. %{_includedir}/corosync/quorum.h
  256. %{_includedir}/corosync/votequorum.h
  257. %{_libdir}/libcfg.so
  258. %{_libdir}/libcpg.so
  259. %{_libdir}/libcmap.so
  260. %{_libdir}/libquorum.so
  261. %{_libdir}/libvotequorum.so
  262. %{_libdir}/libsam.so
  263. %{_libdir}/libcorosync_common.so
  264. %{_libdir}/pkgconfig/*.pc
  265. %{_mandir}/man3/cpg_*3*
  266. %{_mandir}/man3/quorum_*3*
  267. %{_mandir}/man3/votequorum_*3*
  268. %{_mandir}/man3/sam_*3*
  269. %{_mandir}/man3/cmap_*3*
  270. %if %{with vqsim}
  271. %package -n corosync-vqsim
  272. Summary: The Corosync Cluster Engine - Votequorum Simulator
  273. Requires: corosynclib%{?_isa} = %{version}-%{release}
  274. Requires: pkgconfig
  275. %description -n corosync-vqsim
  276. A command-line simulator for the corosync votequorum subsystem.
  277. It uses the same code as the corosync quorum system but forks
  278. them into subprocesses to simulate nodes.
  279. Nodes can be added and removed as well as partitioned (to simulate
  280. network splits)
  281. %files -n corosync-vqsim
  282. %doc LICENSE
  283. %{_bindir}/corosync-vqsim
  284. %{_mandir}/man8/corosync-vqsim.8*
  285. %endif
  286. %if %{with wsdissector}
  287. %package -n corosync-wireshark
  288. Summary: Wireshark dissector plugin for corosync
  289. License: LGPL-2.1-or-later
  290. Requires: wireshark >= 4.6.0
  291. Requires: kronosnet-wireshark
  292. %description -n corosync-wireshark
  293. Wireshark dissector plugin for better analysis of corosync traffic.
  294. %files -n corosync-wireshark
  295. %{wireshark_plugindir}/corosync-totemknet.so
  296. %endif
  297. %changelog
  298. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  299. - Autotools generated version