corosync.spec.in 8.5 KB

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