corosync.spec.in 7.4 KB

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