corosync.spec.in 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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 upstart
  14. %bcond_with xmlconf
  15. %bcond_with runautogen
  16. %bcond_with libcgroup
  17. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  18. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  19. Name: corosync
  20. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  21. Version: @version@
  22. Release: 1%{?gitver}%{?dist}
  23. License: BSD
  24. Group: System Environment/Base
  25. URL: http://corosync.github.io/corosync/
  26. Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
  27. # Runtime bits
  28. # The automatic dependency overridden in favor of explicit version lock
  29. Requires: corosynclib%{?_isa} = %{version}-%{release}
  30. Requires(pre): /usr/sbin/useradd
  31. Requires(post): /sbin/chkconfig
  32. Requires(preun): /sbin/chkconfig
  33. Conflicts: openais <= 0.89, openais-devel <= 0.89
  34. # Build bits
  35. BuildRequires: groff
  36. BuildRequires: libqb-devel
  37. BuildRequires: nss-devel
  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. BuildRequires: dbus-devel
  51. %endif
  52. %if %{with systemd}
  53. BuildRequires: systemd-units
  54. BuildRequires: systemd-devel
  55. Requires(post): systemd
  56. Requires(preun): systemd
  57. Requires(postun): systemd
  58. %endif
  59. %if %{with xmlconf}
  60. Requires: libxslt
  61. %endif
  62. %if %{with libcgroup}
  63. BuildRequires: libcgroup-devel
  64. %endif
  65. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  66. %prep
  67. %setup -q -n %{name}-%{version}%{?gittarver}
  68. %build
  69. %if %{with runautogen}
  70. ./autogen.sh
  71. %endif
  72. %{configure} \
  73. %if %{with testagents}
  74. --enable-testagents \
  75. %endif
  76. %if %{with watchdog}
  77. --enable-watchdog \
  78. %endif
  79. %if %{with monitoring}
  80. --enable-monitoring \
  81. %endif
  82. %if %{with snmp}
  83. --enable-snmp \
  84. %endif
  85. %if %{with dbus}
  86. --enable-dbus \
  87. %endif
  88. %if %{with systemd}
  89. --enable-systemd \
  90. %endif
  91. %if %{with upstart}
  92. --enable-upstart \
  93. %endif
  94. %if %{with xmlconf}
  95. --enable-xmlconf \
  96. %endif
  97. %if %{with libcgroup}
  98. --enable-libcgroup \
  99. %endif
  100. --with-initddir=%{_initrddir} \
  101. --with-systemddir=%{_unitdir} \
  102. --with-upstartdir=%{_sysconfdir}/init
  103. make %{_smp_mflags}
  104. %install
  105. rm -rf %{buildroot}
  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. rm -rf %{buildroot}
  126. %description
  127. This package contains the Corosync Cluster Engine Executive, several default
  128. APIs and libraries, default configuration files, and an init script.
  129. %post
  130. %if %{with systemd} && 0%{?systemd_post:1}
  131. %systemd_post corosync.service
  132. %else
  133. if [ $1 -eq 1 ]; then
  134. /sbin/chkconfig --add corosync || :
  135. fi
  136. %endif
  137. %preun
  138. %if %{with systemd} && 0%{?systemd_preun:1}
  139. %systemd_preun corosync.service
  140. %else
  141. if [ $1 -eq 0 ]; then
  142. /sbin/service corosync stop &>/dev/null || :
  143. /sbin/chkconfig --del corosync || :
  144. fi
  145. %endif
  146. %postun
  147. %if %{with systemd} && 0%{?systemd_postun:1}
  148. %systemd_postun
  149. %endif
  150. %files
  151. %defattr(-,root,root,-)
  152. %doc LICENSE SECURITY
  153. %{_sbindir}/corosync
  154. %{_sbindir}/corosync-keygen
  155. %{_sbindir}/corosync-cmapctl
  156. %{_sbindir}/corosync-cfgtool
  157. %{_sbindir}/corosync-cpgtool
  158. %{_sbindir}/corosync-quorumtool
  159. %{_sbindir}/corosync-notifyd
  160. %{_bindir}/corosync-blackbox
  161. %if %{with xmlconf}
  162. %{_bindir}/corosync-xmlproc
  163. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  164. %dir %{_datadir}/corosync
  165. %{_datadir}/corosync/xml2conf.xsl
  166. %{_mandir}/man8/corosync-xmlproc.8*
  167. %{_mandir}/man5/corosync.xml.5*
  168. %endif
  169. %dir %{_sysconfdir}/corosync
  170. %dir %{_sysconfdir}/corosync/uidgid.d
  171. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  172. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  173. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  174. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  175. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  176. %if %{with dbus}
  177. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  178. %endif
  179. %if %{with snmp}
  180. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  181. %endif
  182. %if %{with systemd}
  183. %{_unitdir}/corosync.service
  184. %{_unitdir}/corosync-notifyd.service
  185. %else
  186. %{_initrddir}/corosync
  187. %{_initrddir}/corosync-notifyd
  188. %endif
  189. %if %{with upstart}
  190. %{_sysconfdir}/init/corosync.conf
  191. %{_sysconfdir}/init/corosync-notifyd.conf
  192. %endif
  193. %dir %{_localstatedir}/lib/corosync
  194. %dir %{_localstatedir}/log/cluster
  195. %{_mandir}/man8/corosync_overview.8*
  196. %{_mandir}/man8/corosync.8*
  197. %{_mandir}/man8/corosync-blackbox.8*
  198. %{_mandir}/man8/corosync-cmapctl.8*
  199. %{_mandir}/man8/corosync-keygen.8*
  200. %{_mandir}/man8/corosync-cfgtool.8*
  201. %{_mandir}/man8/corosync-cpgtool.8*
  202. %{_mandir}/man8/corosync-notifyd.8*
  203. %{_mandir}/man8/corosync-quorumtool.8*
  204. %{_mandir}/man5/corosync.conf.5*
  205. %{_mandir}/man5/votequorum.5*
  206. %{_mandir}/man8/cmap_keys.8*
  207. # optional testagent rpm
  208. #
  209. %if %{with testagents}
  210. %package -n corosync-testagents
  211. Summary: The Corosync Cluster Engine Test Agents
  212. Group: Development/Libraries
  213. Requires: %{name} = %{version}-%{release}
  214. %description -n corosync-testagents
  215. This package contains corosync test agents.
  216. %files -n corosync-testagents
  217. %defattr(755,root,root,-)
  218. %{_datadir}/corosync/tests/mem_leak_test.sh
  219. %{_datadir}/corosync/tests/net_breaker.sh
  220. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  221. %{_datadir}/corosync/tests/shm_leak_audit.sh
  222. %{_bindir}/cpg_test_agent
  223. %{_bindir}/sam_test_agent
  224. %{_bindir}/votequorum_test_agent
  225. %endif
  226. # library
  227. #
  228. %package -n corosynclib
  229. Summary: The Corosync Cluster Engine Libraries
  230. Group: System Environment/Libraries
  231. %description -n corosynclib
  232. This package contains corosync libraries.
  233. %files -n corosynclib
  234. %defattr(-,root,root,-)
  235. %doc LICENSE
  236. %{_libdir}/libcfg.so.*
  237. %{_libdir}/libcpg.so.*
  238. %{_libdir}/libcmap.so.*
  239. %{_libdir}/libtotem_pg.so.*
  240. %{_libdir}/libquorum.so.*
  241. %{_libdir}/libvotequorum.so.*
  242. %{_libdir}/libsam.so.*
  243. %{_libdir}/libcorosync_common.so.*
  244. %post -n corosynclib -p /sbin/ldconfig
  245. %postun -n corosynclib -p /sbin/ldconfig
  246. %package -n corosynclib-devel
  247. Summary: The Corosync Cluster Engine Development Kit
  248. Group: Development/Libraries
  249. Requires: corosynclib%{?_isa} = %{version}-%{release}
  250. Requires: pkgconfig
  251. Provides: corosync-devel = %{version}
  252. Obsoletes: corosync-devel < 0.92-7
  253. %description -n corosynclib-devel
  254. This package contains include files and man pages used to develop using
  255. The Corosync Cluster Engine APIs.
  256. %files -n corosynclib-devel
  257. %defattr(-,root,root,-)
  258. %doc LICENSE
  259. %dir %{_includedir}/corosync/
  260. %{_includedir}/corosync/corodefs.h
  261. %{_includedir}/corosync/cfg.h
  262. %{_includedir}/corosync/cmap.h
  263. %{_includedir}/corosync/corotypes.h
  264. %{_includedir}/corosync/cpg.h
  265. %{_includedir}/corosync/hdb.h
  266. %{_includedir}/corosync/sam.h
  267. %{_includedir}/corosync/quorum.h
  268. %{_includedir}/corosync/votequorum.h
  269. %dir %{_includedir}/corosync/totem/
  270. %{_includedir}/corosync/totem/totem.h
  271. %{_includedir}/corosync/totem/totemip.h
  272. %{_includedir}/corosync/totem/totempg.h
  273. %{_includedir}/corosync/totem/totemstats.h
  274. %{_libdir}/libcfg.so
  275. %{_libdir}/libcpg.so
  276. %{_libdir}/libcmap.so
  277. %{_libdir}/libtotem_pg.so
  278. %{_libdir}/libquorum.so
  279. %{_libdir}/libvotequorum.so
  280. %{_libdir}/libsam.so
  281. %{_libdir}/libcorosync_common.so
  282. %{_libdir}/pkgconfig/*.pc
  283. %{_mandir}/man3/cpg_*3*
  284. %{_mandir}/man3/quorum_*3*
  285. %{_mandir}/man3/votequorum_*3*
  286. %{_mandir}/man3/sam_*3*
  287. %{_mandir}/man8/cpg_overview.8*
  288. %{_mandir}/man8/votequorum_overview.8*
  289. %{_mandir}/man8/sam_overview.8*
  290. %{_mandir}/man3/cmap_*3*
  291. %{_mandir}/man8/cmap_overview.8*
  292. %{_mandir}/man8/quorum_overview.8*
  293. %changelog
  294. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  295. - Autotools generated version