corosync.spec.in 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. Group: System Environment/Base
  24. URL: http://corosync.github.io/corosync/
  25. Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
  26. # Runtime bits
  27. # The automatic dependency overridden in favor of explicit version lock
  28. Requires: corosynclib%{?_isa} = %{version}-%{release}
  29. Requires(pre): /usr/sbin/useradd
  30. Requires(post): /sbin/chkconfig
  31. Requires(preun): /sbin/chkconfig
  32. Conflicts: openais <= 0.89, openais-devel <= 0.89
  33. # Build bits
  34. BuildRequires: groff
  35. BuildRequires: libqb-devel
  36. BuildRequires: nss-devel
  37. BuildRequires: libknet1-devel
  38. BuildRequires: zlib-devel
  39. %if %{with runautogen}
  40. BuildRequires: autoconf automake libtool
  41. %endif
  42. %if %{with monitoring}
  43. BuildRequires: libstatgrab-devel
  44. %endif
  45. %if %{with snmp}
  46. BuildRequires: net-snmp-devel
  47. %endif
  48. %if %{with dbus}
  49. BuildRequires: dbus-devel
  50. %endif
  51. %if %{with systemd}
  52. BuildRequires: systemd-units
  53. BuildRequires: systemd-devel
  54. Requires(post): systemd
  55. Requires(preun): systemd
  56. Requires(postun): systemd
  57. %endif
  58. %if %{with xmlconf}
  59. Requires: libxslt
  60. %endif
  61. %if %{with libcgroup}
  62. BuildRequires: libcgroup-devel
  63. %endif
  64. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  65. %prep
  66. %setup -q -n %{name}-%{version}%{?gittarver}
  67. %build
  68. %if %{with runautogen}
  69. ./autogen.sh
  70. %endif
  71. %{configure} \
  72. %if %{with testagents}
  73. --enable-testagents \
  74. %endif
  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. %if %{with libcgroup}
  94. --enable-libcgroup \
  95. %endif
  96. --with-initddir=%{_initrddir} \
  97. --with-systemddir=%{_unitdir}
  98. make %{_smp_mflags}
  99. %install
  100. rm -rf %{buildroot}
  101. make install DESTDIR=%{buildroot}
  102. %if %{with dbus}
  103. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  104. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  105. %endif
  106. ## tree fixup
  107. # drop static libs
  108. rm -f %{buildroot}%{_libdir}/*.a
  109. rm -f %{buildroot}%{_libdir}/*.la
  110. # drop docs and html docs for now
  111. rm -rf %{buildroot}%{_docdir}/*
  112. # /etc/sysconfig/corosync-notifyd
  113. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  114. install -m 644 tools/corosync-notifyd.sysconfig.example \
  115. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  116. # /etc/sysconfig/corosync
  117. install -m 644 init/corosync.sysconfig.example \
  118. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  119. %clean
  120. rm -rf %{buildroot}
  121. %description
  122. This package contains the Corosync Cluster Engine Executive, several default
  123. APIs and libraries, default configuration files, and an init script.
  124. %post
  125. %if %{with systemd} && 0%{?systemd_post:1}
  126. %systemd_post corosync.service
  127. %else
  128. if [ $1 -eq 1 ]; then
  129. /sbin/chkconfig --add corosync || :
  130. fi
  131. %endif
  132. %preun
  133. %if %{with systemd} && 0%{?systemd_preun:1}
  134. %systemd_preun corosync.service
  135. %else
  136. if [ $1 -eq 0 ]; then
  137. /sbin/service corosync stop &>/dev/null || :
  138. /sbin/chkconfig --del corosync || :
  139. fi
  140. %endif
  141. %postun
  142. %if %{with systemd} && 0%{?systemd_postun:1}
  143. %systemd_postun
  144. %endif
  145. %files
  146. %defattr(-,root,root,-)
  147. %doc LICENSE SECURITY
  148. %{_sbindir}/corosync
  149. %{_sbindir}/corosync-keygen
  150. %{_sbindir}/corosync-cmapctl
  151. %{_sbindir}/corosync-cfgtool
  152. %{_sbindir}/corosync-cpgtool
  153. %{_sbindir}/corosync-quorumtool
  154. %{_sbindir}/corosync-notifyd
  155. %{_bindir}/corosync-blackbox
  156. %if %{with xmlconf}
  157. %{_bindir}/corosync-xmlproc
  158. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  159. %dir %{_datadir}/corosync
  160. %{_datadir}/corosync/xml2conf.xsl
  161. %{_mandir}/man8/corosync-xmlproc.8*
  162. %{_mandir}/man5/corosync.xml.5*
  163. %endif
  164. %dir %{_sysconfdir}/corosync
  165. %dir %{_sysconfdir}/corosync/uidgid.d
  166. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  167. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  168. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  169. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  170. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  171. %if %{with dbus}
  172. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  173. %endif
  174. %if %{with snmp}
  175. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  176. %endif
  177. %if %{with systemd}
  178. %{_unitdir}/corosync.service
  179. %{_unitdir}/corosync-notifyd.service
  180. %else
  181. %{_initrddir}/corosync
  182. %{_initrddir}/corosync-notifyd
  183. %endif
  184. %dir %{_localstatedir}/lib/corosync
  185. %dir %{_localstatedir}/log/cluster
  186. %{_mandir}/man8/corosync_overview.8*
  187. %{_mandir}/man8/corosync.8*
  188. %{_mandir}/man8/corosync-blackbox.8*
  189. %{_mandir}/man8/corosync-cmapctl.8*
  190. %{_mandir}/man8/corosync-keygen.8*
  191. %{_mandir}/man8/corosync-cfgtool.8*
  192. %{_mandir}/man8/corosync-cpgtool.8*
  193. %{_mandir}/man8/corosync-notifyd.8*
  194. %{_mandir}/man8/corosync-quorumtool.8*
  195. %{_mandir}/man5/corosync.conf.5*
  196. %{_mandir}/man5/votequorum.5*
  197. %{_mandir}/man8/cmap_keys.8*
  198. # optional testagent rpm
  199. #
  200. %if %{with testagents}
  201. %package -n corosync-testagents
  202. Summary: The Corosync Cluster Engine Test Agents
  203. Group: Development/Libraries
  204. Requires: %{name} = %{version}-%{release}
  205. %description -n corosync-testagents
  206. This package contains corosync test agents.
  207. %files -n corosync-testagents
  208. %defattr(755,root,root,-)
  209. %{_datadir}/corosync/tests/mem_leak_test.sh
  210. %{_datadir}/corosync/tests/net_breaker.sh
  211. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  212. %{_datadir}/corosync/tests/shm_leak_audit.sh
  213. %{_bindir}/cpg_test_agent
  214. %{_bindir}/sam_test_agent
  215. %{_bindir}/votequorum_test_agent
  216. %endif
  217. # library
  218. #
  219. %package -n corosynclib
  220. Summary: The Corosync Cluster Engine Libraries
  221. Group: System Environment/Libraries
  222. %description -n corosynclib
  223. This package contains corosync libraries.
  224. %files -n corosynclib
  225. %defattr(-,root,root,-)
  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. Group: Development/Libraries
  240. Requires: corosynclib%{?_isa} = %{version}-%{release}
  241. Requires: pkgconfig
  242. Provides: corosync-devel = %{version}
  243. Obsoletes: corosync-devel < 0.92-7
  244. %description -n corosynclib-devel
  245. This package contains include files and man pages used to develop using
  246. The Corosync Cluster Engine APIs.
  247. %files -n corosynclib-devel
  248. %defattr(-,root,root,-)
  249. %doc LICENSE
  250. %dir %{_includedir}/corosync/
  251. %{_includedir}/corosync/corodefs.h
  252. %{_includedir}/corosync/cfg.h
  253. %{_includedir}/corosync/cmap.h
  254. %{_includedir}/corosync/corotypes.h
  255. %{_includedir}/corosync/cpg.h
  256. %{_includedir}/corosync/hdb.h
  257. %{_includedir}/corosync/sam.h
  258. %{_includedir}/corosync/quorum.h
  259. %{_includedir}/corosync/votequorum.h
  260. %dir %{_includedir}/corosync/totem/
  261. %{_includedir}/corosync/totem/totem.h
  262. %{_includedir}/corosync/totem/totemip.h
  263. %{_includedir}/corosync/totem/totempg.h
  264. %{_includedir}/corosync/totem/totemstats.h
  265. %{_libdir}/libcfg.so
  266. %{_libdir}/libcpg.so
  267. %{_libdir}/libcmap.so
  268. %{_libdir}/libtotem_pg.so
  269. %{_libdir}/libquorum.so
  270. %{_libdir}/libvotequorum.so
  271. %{_libdir}/libsam.so
  272. %{_libdir}/libcorosync_common.so
  273. %{_libdir}/pkgconfig/*.pc
  274. %{_mandir}/man3/cpg_*3*
  275. %{_mandir}/man3/quorum_*3*
  276. %{_mandir}/man3/votequorum_*3*
  277. %{_mandir}/man3/sam_*3*
  278. %{_mandir}/man8/cpg_overview.8*
  279. %{_mandir}/man8/votequorum_overview.8*
  280. %{_mandir}/man8/sam_overview.8*
  281. %{_mandir}/man3/cmap_*3*
  282. %{_mandir}/man8/cmap_overview.8*
  283. %{_mandir}/man8/quorum_overview.8*
  284. %changelog
  285. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  286. - Autotools generated version