corosync.spec.in 8.2 KB

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