corosync.spec.in 7.3 KB

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