corosync.spec.in 6.8 KB

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