corosync.spec.in 7.6 KB

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