corosync.spec.in 7.3 KB

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