corosync.spec.in 7.7 KB

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