4
0

corosync.spec.in 7.4 KB

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