corosync.spec.in 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. %if 0%{?suse_version}
  35. BuildRequires: mozilla-nss-devel
  36. %else
  37. BuildRequires: nss-devel
  38. %endif
  39. BuildRequires: libknet1-devel
  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 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. %prep
  69. %setup -q -n %{name}-%{version}%{?gittarver}
  70. %build
  71. %if %{with runautogen}
  72. ./autogen.sh
  73. %endif
  74. %{configure} \
  75. %if %{with watchdog}
  76. --enable-watchdog \
  77. %endif
  78. %if %{with monitoring}
  79. --enable-monitoring \
  80. %endif
  81. %if %{with snmp}
  82. --enable-snmp \
  83. %endif
  84. %if %{with dbus}
  85. --enable-dbus \
  86. %endif
  87. %if %{with systemd}
  88. --enable-systemd \
  89. %endif
  90. %if %{with xmlconf}
  91. --enable-xmlconf \
  92. %endif
  93. --with-initddir=%{_initrddir} \
  94. --with-systemddir=%{_unitdir} \
  95. --docdir=%{_docdir}
  96. make %{_smp_mflags}
  97. %install
  98. make install DESTDIR=%{buildroot}
  99. %if %{with dbus}
  100. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  101. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  102. %endif
  103. ## tree fixup
  104. # drop static libs
  105. rm -f %{buildroot}%{_libdir}/*.a
  106. rm -f %{buildroot}%{_libdir}/*.la
  107. # drop docs and html docs for now
  108. rm -rf %{buildroot}%{_docdir}/*
  109. # /etc/sysconfig/corosync-notifyd
  110. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  111. install -m 644 tools/corosync-notifyd.sysconfig.example \
  112. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  113. # /etc/sysconfig/corosync
  114. install -m 644 init/corosync.sysconfig.example \
  115. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  116. %description
  117. This package contains the Corosync Cluster Engine Executive, several default
  118. APIs and libraries, default configuration files, and an init script.
  119. %post
  120. %if %{with systemd} && 0%{?systemd_post:1}
  121. %systemd_post corosync.service
  122. %else
  123. if [ $1 -eq 1 ]; then
  124. /sbin/chkconfig --add corosync || :
  125. fi
  126. %endif
  127. %preun
  128. %if %{with systemd} && 0%{?systemd_preun:1}
  129. %systemd_preun corosync.service
  130. %else
  131. if [ $1 -eq 0 ]; then
  132. /sbin/service corosync stop &>/dev/null || :
  133. /sbin/chkconfig --del corosync || :
  134. fi
  135. %endif
  136. %postun
  137. %if %{with systemd} && 0%{?systemd_postun:1}
  138. %systemd_postun corosync.service
  139. %endif
  140. %files
  141. %doc LICENSE
  142. %{_sbindir}/corosync
  143. %{_sbindir}/corosync-keygen
  144. %{_sbindir}/corosync-cmapctl
  145. %{_sbindir}/corosync-cfgtool
  146. %{_sbindir}/corosync-cpgtool
  147. %{_sbindir}/corosync-quorumtool
  148. %{_sbindir}/corosync-notifyd
  149. %{_bindir}/corosync-blackbox
  150. %if %{with xmlconf}
  151. %{_bindir}/corosync-xmlproc
  152. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  153. %dir %{_datadir}/corosync
  154. %{_datadir}/corosync/xml2conf.xsl
  155. %{_mandir}/man8/corosync-xmlproc.8*
  156. %{_mandir}/man5/corosync.xml.5*
  157. %endif
  158. %dir %{_sysconfdir}/corosync
  159. %dir %{_sysconfdir}/corosync/uidgid.d
  160. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  161. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  162. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  163. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  164. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  165. %if %{with dbus}
  166. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  167. %endif
  168. %if %{with snmp}
  169. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  170. %endif
  171. %if %{with systemd}
  172. %{_unitdir}/corosync.service
  173. %{_unitdir}/corosync-notifyd.service
  174. %else
  175. %{_initrddir}/corosync
  176. %{_initrddir}/corosync-notifyd
  177. %endif
  178. %dir %{_localstatedir}/lib/corosync
  179. %dir %{_localstatedir}/log/cluster
  180. %{_mandir}/man7/corosync_overview.7*
  181. %{_mandir}/man8/corosync.8*
  182. %{_mandir}/man8/corosync-blackbox.8*
  183. %{_mandir}/man8/corosync-cmapctl.8*
  184. %{_mandir}/man8/corosync-keygen.8*
  185. %{_mandir}/man8/corosync-cfgtool.8*
  186. %{_mandir}/man8/corosync-cpgtool.8*
  187. %{_mandir}/man8/corosync-notifyd.8*
  188. %{_mandir}/man8/corosync-quorumtool.8*
  189. %{_mandir}/man5/corosync.conf.5*
  190. %{_mandir}/man5/votequorum.5*
  191. %{_mandir}/man8/cmap_keys.8*
  192. # library
  193. #
  194. %package -n corosynclib
  195. Summary: The Corosync Cluster Engine Libraries
  196. %description -n corosynclib
  197. This package contains corosync libraries.
  198. %files -n corosynclib
  199. %doc LICENSE
  200. %{_libdir}/libcfg.so.*
  201. %{_libdir}/libcpg.so.*
  202. %{_libdir}/libcmap.so.*
  203. %{_libdir}/libtotem_pg.so.*
  204. %{_libdir}/libquorum.so.*
  205. %{_libdir}/libvotequorum.so.*
  206. %{_libdir}/libsam.so.*
  207. %{_libdir}/libcorosync_common.so.*
  208. %post -n corosynclib -p /sbin/ldconfig
  209. %postun -n corosynclib -p /sbin/ldconfig
  210. %package -n corosynclib-devel
  211. Summary: The Corosync Cluster Engine Development Kit
  212. Requires: corosynclib%{?_isa} = %{version}-%{release}
  213. Requires: pkgconfig
  214. Provides: corosync-devel = %{version}
  215. %description -n corosynclib-devel
  216. This package contains include files and man pages used to develop using
  217. The Corosync Cluster Engine APIs.
  218. %files -n corosynclib-devel
  219. %doc LICENSE
  220. %dir %{_includedir}/corosync/
  221. %{_includedir}/corosync/corodefs.h
  222. %{_includedir}/corosync/cfg.h
  223. %{_includedir}/corosync/cmap.h
  224. %{_includedir}/corosync/corotypes.h
  225. %{_includedir}/corosync/cpg.h
  226. %{_includedir}/corosync/hdb.h
  227. %{_includedir}/corosync/sam.h
  228. %{_includedir}/corosync/quorum.h
  229. %{_includedir}/corosync/votequorum.h
  230. %dir %{_includedir}/corosync/totem/
  231. %{_includedir}/corosync/totem/totem.h
  232. %{_includedir}/corosync/totem/totemip.h
  233. %{_includedir}/corosync/totem/totempg.h
  234. %{_includedir}/corosync/totem/totemstats.h
  235. %{_libdir}/libcfg.so
  236. %{_libdir}/libcpg.so
  237. %{_libdir}/libcmap.so
  238. %{_libdir}/libtotem_pg.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. %changelog
  250. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  251. - Autotools generated version