4
0

corosync.spec.in 8.7 KB

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