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