corosync.spec.in 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. %dir %{_datadir}/corosync
  148. %{_datadir}/corosync/xml2conf.xsl
  149. %{_mandir}/man8/corosync-xmlproc.8*
  150. %{_mandir}/man5/corosync.xml.5*
  151. %endif
  152. %dir %{_sysconfdir}/corosync
  153. %dir %{_sysconfdir}/corosync/uidgid.d
  154. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  155. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  156. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  157. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  158. %if %{with dbus}
  159. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  160. %endif
  161. %if %{with snmp}
  162. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  163. %endif
  164. %if %{with systemd}
  165. %{_unitdir}/corosync.service
  166. %{_unitdir}/corosync-notifyd.service
  167. %else
  168. %{_initrddir}/corosync
  169. %{_initrddir}/corosync-notifyd
  170. %endif
  171. %dir %{_localstatedir}/lib/corosync
  172. %dir %{_localstatedir}/log/cluster
  173. %{_mandir}/man7/corosync_overview.7*
  174. %{_mandir}/man8/corosync.8*
  175. %{_mandir}/man8/corosync-blackbox.8*
  176. %{_mandir}/man8/corosync-cmapctl.8*
  177. %{_mandir}/man8/corosync-keygen.8*
  178. %{_mandir}/man8/corosync-cfgtool.8*
  179. %{_mandir}/man8/corosync-cpgtool.8*
  180. %{_mandir}/man8/corosync-notifyd.8*
  181. %{_mandir}/man8/corosync-quorumtool.8*
  182. %{_mandir}/man5/corosync.conf.5*
  183. %{_mandir}/man5/votequorum.5*
  184. %{_mandir}/man8/cmap_keys.8*
  185. # library
  186. #
  187. %package -n corosynclib
  188. Summary: The Corosync Cluster Engine Libraries
  189. %description -n corosynclib
  190. This package contains corosync libraries.
  191. %files -n corosynclib
  192. %doc LICENSE
  193. %{_libdir}/libcfg.so.*
  194. %{_libdir}/libcpg.so.*
  195. %{_libdir}/libcmap.so.*
  196. %{_libdir}/libquorum.so.*
  197. %{_libdir}/libvotequorum.so.*
  198. %{_libdir}/libsam.so.*
  199. %{_libdir}/libcorosync_common.so.*
  200. %post -n corosynclib -p /sbin/ldconfig
  201. %postun -n corosynclib -p /sbin/ldconfig
  202. %package -n corosynclib-devel
  203. Summary: The Corosync Cluster Engine Development Kit
  204. Requires: corosynclib%{?_isa} = %{version}-%{release}
  205. Requires: pkgconfig
  206. Provides: corosync-devel = %{version}
  207. %description -n corosynclib-devel
  208. This package contains include files and man pages used to develop using
  209. The Corosync Cluster Engine APIs.
  210. %files -n corosynclib-devel
  211. %doc LICENSE
  212. %dir %{_includedir}/corosync/
  213. %{_includedir}/corosync/corodefs.h
  214. %{_includedir}/corosync/cfg.h
  215. %{_includedir}/corosync/cmap.h
  216. %{_includedir}/corosync/corotypes.h
  217. %{_includedir}/corosync/cpg.h
  218. %{_includedir}/corosync/hdb.h
  219. %{_includedir}/corosync/sam.h
  220. %{_includedir}/corosync/quorum.h
  221. %{_includedir}/corosync/votequorum.h
  222. %{_libdir}/libcfg.so
  223. %{_libdir}/libcpg.so
  224. %{_libdir}/libcmap.so
  225. %{_libdir}/libquorum.so
  226. %{_libdir}/libvotequorum.so
  227. %{_libdir}/libsam.so
  228. %{_libdir}/libcorosync_common.so
  229. %{_libdir}/pkgconfig/*.pc
  230. %{_mandir}/man3/cpg_*3*
  231. %{_mandir}/man3/quorum_*3*
  232. %{_mandir}/man3/votequorum_*3*
  233. %{_mandir}/man3/sam_*3*
  234. %{_mandir}/man3/cmap_*3*
  235. %changelog
  236. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  237. - Autotools generated version