corosync.spec.in 8.2 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 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. %if %{with runautogen}
  38. BuildRequires: autoconf automake libtool
  39. %endif
  40. %if %{with monitoring}
  41. BuildRequires: libstatgrab-devel
  42. %endif
  43. %if %{with rdma}
  44. BuildRequires: libibverbs-devel librdmacm-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. Requires(post): systemd
  55. Requires(preun): systemd
  56. Requires(postun): systemd
  57. %endif
  58. %if %{with xmlconf}
  59. Requires: libxslt
  60. %endif
  61. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  62. %prep
  63. %setup -q -n %{name}-%{version}%{?gittarver}
  64. %build
  65. %if %{with runautogen}
  66. ./autogen.sh
  67. %endif
  68. %if %{with rdma}
  69. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  70. export ibverbs_LIBS=-libverbs \
  71. export rdmacm_CFLAGS=-I/usr/include/rdma \
  72. export rdmacm_LIBS=-lrdmacm \
  73. %endif
  74. %{configure} \
  75. %if %{with testagents}
  76. --enable-testagents \
  77. %endif
  78. %if %{with watchdog}
  79. --enable-watchdog \
  80. %endif
  81. %if %{with monitoring}
  82. --enable-monitoring \
  83. %endif
  84. %if %{with snmp}
  85. --enable-snmp \
  86. %endif
  87. %if %{with dbus}
  88. --enable-dbus \
  89. %endif
  90. %if %{with rdma}
  91. --enable-rdma \
  92. %endif
  93. %if %{with systemd}
  94. --enable-systemd \
  95. %endif
  96. %if %{with upstart}
  97. --enable-upstart \
  98. %endif
  99. %if %{with xmlconf}
  100. --enable-xmlconf \
  101. %endif
  102. --with-initddir=%{_initrddir} \
  103. --with-systemddir=%{_unitdir} \
  104. --with-upstartdir=%{_sysconfdir}/init
  105. make %{_smp_mflags}
  106. %install
  107. rm -rf %{buildroot}
  108. make install DESTDIR=%{buildroot}
  109. %if %{with dbus}
  110. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  111. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  112. %endif
  113. ## tree fixup
  114. # drop static libs
  115. rm -f %{buildroot}%{_libdir}/*.a
  116. rm -f %{buildroot}%{_libdir}/*.la
  117. # drop docs and html docs for now
  118. rm -rf %{buildroot}%{_docdir}/*
  119. # /etc/sysconfig/corosync-notifyd
  120. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  121. install -m 644 tools/corosync-notifyd.sysconfig.example \
  122. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  123. %clean
  124. rm -rf %{buildroot}
  125. %description
  126. This package contains the Corosync Cluster Engine Executive, several default
  127. APIs and libraries, default configuration files, and an init script.
  128. %post
  129. %if %{with systemd} && 0%{?systemd_post:1}
  130. %systemd_post corosync.service
  131. %else
  132. if [ $1 -eq 1 ]; then
  133. /sbin/chkconfig --add corosync || :
  134. fi
  135. %endif
  136. %preun
  137. %if %{with systemd} && 0%{?systemd_preun:1}
  138. %systemd_preun corosync.service
  139. %else
  140. if [ $1 -eq 0 ]; then
  141. /sbin/service corosync stop &>/dev/null || :
  142. /sbin/chkconfig --del corosync || :
  143. fi
  144. %endif
  145. %postun
  146. %if %{with systemd} && 0%{?systemd_postun:1}
  147. %systemd_postun
  148. %endif
  149. %files
  150. %defattr(-,root,root,-)
  151. %doc LICENSE SECURITY
  152. %{_sbindir}/corosync
  153. %{_sbindir}/corosync-keygen
  154. %{_sbindir}/corosync-cmapctl
  155. %{_sbindir}/corosync-cfgtool
  156. %{_sbindir}/corosync-cpgtool
  157. %{_sbindir}/corosync-quorumtool
  158. %{_sbindir}/corosync-notifyd
  159. %{_bindir}/corosync-blackbox
  160. %if %{with xmlconf}
  161. %{_bindir}/corosync-xmlproc
  162. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  163. %dir %{_datadir}/corosync
  164. %{_datadir}/corosync/xml2conf.xsl
  165. %{_mandir}/man8/corosync-xmlproc.8*
  166. %{_mandir}/man5/corosync.xml.5*
  167. %endif
  168. %dir %{_sysconfdir}/corosync
  169. %dir %{_sysconfdir}/corosync/uidgid.d
  170. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  171. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  172. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  173. %if %{with dbus}
  174. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  175. %endif
  176. %if %{with snmp}
  177. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  178. %endif
  179. %if %{with systemd}
  180. %{_unitdir}/corosync.service
  181. %{_unitdir}/corosync-notifyd.service
  182. %dir %{_datadir}/corosync
  183. %{_datadir}/corosync/corosync
  184. %{_datadir}/corosync/corosync-notifyd
  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. Requires: %{name} = %{version}-%{release}
  232. %description -n corosynclib
  233. This package contains corosync libraries.
  234. %files -n corosynclib
  235. %defattr(-,root,root,-)
  236. %doc LICENSE
  237. %{_libdir}/libcfg.so.*
  238. %{_libdir}/libcpg.so.*
  239. %{_libdir}/libcmap.so.*
  240. %{_libdir}/libtotem_pg.so.*
  241. %{_libdir}/libquorum.so.*
  242. %{_libdir}/libvotequorum.so.*
  243. %{_libdir}/libsam.so.*
  244. %{_libdir}/libcorosync_common.so.*
  245. %post -n corosynclib -p /sbin/ldconfig
  246. %postun -n corosynclib -p /sbin/ldconfig
  247. %package -n corosynclib-devel
  248. Summary: The Corosync Cluster Engine Development Kit
  249. Group: Development/Libraries
  250. Requires: corosynclib = %{version}-%{release}
  251. Requires: pkgconfig
  252. Provides: corosync-devel = %{version}
  253. Obsoletes: corosync-devel < 0.92-7
  254. %description -n corosynclib-devel
  255. This package contains include files and man pages used to develop using
  256. The Corosync Cluster Engine APIs.
  257. %files -n corosynclib-devel
  258. %defattr(-,root,root,-)
  259. %doc LICENSE
  260. %dir %{_includedir}/corosync/
  261. %{_includedir}/corosync/corodefs.h
  262. %{_includedir}/corosync/cfg.h
  263. %{_includedir}/corosync/cmap.h
  264. %{_includedir}/corosync/corotypes.h
  265. %{_includedir}/corosync/cpg.h
  266. %{_includedir}/corosync/hdb.h
  267. %{_includedir}/corosync/sam.h
  268. %{_includedir}/corosync/quorum.h
  269. %{_includedir}/corosync/votequorum.h
  270. %dir %{_includedir}/corosync/totem/
  271. %{_includedir}/corosync/totem/totem.h
  272. %{_includedir}/corosync/totem/totemip.h
  273. %{_includedir}/corosync/totem/totempg.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