corosync.spec.in 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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 qdevices
  18. %bcond_with qnetd
  19. %bcond_with libcgroup
  20. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  21. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  22. Name: corosync
  23. Summary: The Corosync Cluster Engine and Application Programming Interfaces
  24. Version: @version@
  25. Release: 1%{?gitver}%{?dist}
  26. License: BSD
  27. Group: System Environment/Base
  28. URL: http://corosync.github.io/corosync/
  29. Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
  30. # Runtime bits
  31. # The automatic dependency overridden in favor of explicit version lock
  32. Requires: corosynclib%{?_isa} = %{version}-%{release}
  33. Requires(pre): /usr/sbin/useradd
  34. Requires(post): /sbin/chkconfig
  35. Requires(preun): /sbin/chkconfig
  36. Conflicts: openais <= 0.89, openais-devel <= 0.89
  37. # Build bits
  38. BuildRequires: groff
  39. BuildRequires: libqb-devel
  40. BuildRequires: nss-devel
  41. BuildRequires: libknet1-devel
  42. BuildRequires: zlib-devel
  43. %if %{with runautogen}
  44. BuildRequires: autoconf automake libtool
  45. %endif
  46. %if %{with monitoring}
  47. BuildRequires: libstatgrab-devel
  48. %endif
  49. %if %{with rdma}
  50. BuildRequires: libibverbs-devel librdmacm-devel
  51. %endif
  52. %if %{with snmp}
  53. BuildRequires: net-snmp-devel
  54. %endif
  55. %if %{with dbus}
  56. BuildRequires: dbus-devel
  57. %endif
  58. %if %{with systemd}
  59. BuildRequires: systemd-units
  60. BuildRequires: systemd-devel
  61. Requires(post): systemd
  62. Requires(preun): systemd
  63. Requires(postun): systemd
  64. %endif
  65. %if %{with xmlconf}
  66. Requires: libxslt
  67. %endif
  68. %if %{with qdevices} || %{with qnetd}
  69. Requires: nss-tools
  70. %endif
  71. %if %{with qnetd}
  72. BuildRequires: sed
  73. %endif
  74. %if %{with libcgroup}
  75. BuildRequires: libcgroup-devel
  76. %endif
  77. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  78. %prep
  79. %setup -q -n %{name}-%{version}%{?gittarver}
  80. %build
  81. %if %{with runautogen}
  82. ./autogen.sh
  83. %endif
  84. %if %{with rdma}
  85. export ibverbs_CFLAGS=-I/usr/include/infiniband \
  86. export ibverbs_LIBS=-libverbs \
  87. export rdmacm_CFLAGS=-I/usr/include/rdma \
  88. export rdmacm_LIBS=-lrdmacm \
  89. %endif
  90. %{configure} \
  91. %if %{with testagents}
  92. --enable-testagents \
  93. %endif
  94. %if %{with watchdog}
  95. --enable-watchdog \
  96. %endif
  97. %if %{with monitoring}
  98. --enable-monitoring \
  99. %endif
  100. %if %{with snmp}
  101. --enable-snmp \
  102. %endif
  103. %if %{with dbus}
  104. --enable-dbus \
  105. %endif
  106. %if %{with rdma}
  107. --enable-rdma \
  108. %endif
  109. %if %{with systemd}
  110. --enable-systemd \
  111. %endif
  112. %if %{with upstart}
  113. --enable-upstart \
  114. %endif
  115. %if %{with xmlconf}
  116. --enable-xmlconf \
  117. %endif
  118. %if %{with qdevices}
  119. --enable-qdevices \
  120. %endif
  121. %if %{with qnetd}
  122. --enable-qnetd \
  123. %endif
  124. %if %{with libcgroup}
  125. --enable-libcgroup \
  126. %endif
  127. --with-initddir=%{_initrddir} \
  128. --with-systemddir=%{_unitdir} \
  129. --with-upstartdir=%{_sysconfdir}/init
  130. make %{_smp_mflags}
  131. %install
  132. rm -rf %{buildroot}
  133. make install DESTDIR=%{buildroot}
  134. %if %{with dbus}
  135. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  136. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  137. %endif
  138. ## tree fixup
  139. # drop static libs
  140. rm -f %{buildroot}%{_libdir}/*.a
  141. rm -f %{buildroot}%{_libdir}/*.la
  142. # drop docs and html docs for now
  143. rm -rf %{buildroot}%{_docdir}/*
  144. # /etc/sysconfig/corosync-notifyd
  145. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  146. install -m 644 tools/corosync-notifyd.sysconfig.example \
  147. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  148. # /etc/sysconfig/corosync
  149. install -m 644 init/corosync.sysconfig.example \
  150. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  151. %if %{with qdevices}
  152. # /etc/sysconfig/corosync-qdevice
  153. install -m 644 init/corosync-qdevice.sysconfig.example \
  154. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
  155. %endif
  156. %if %{with qnetd}
  157. # /etc/sysconfig/corosync-qnetd
  158. install -m 644 init/corosync-qnetd.sysconfig.example \
  159. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  160. %if %{with systemd}
  161. sed -i -e 's/^#User=/User=/' \
  162. %{buildroot}%{_unitdir}/corosync-qnetd.service
  163. %else
  164. sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
  165. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  166. %endif
  167. %endif
  168. %clean
  169. rm -rf %{buildroot}
  170. %description
  171. This package contains the Corosync Cluster Engine Executive, several default
  172. APIs and libraries, default configuration files, and an init script.
  173. %post
  174. %if %{with systemd} && 0%{?systemd_post:1}
  175. %systemd_post corosync.service
  176. %else
  177. if [ $1 -eq 1 ]; then
  178. /sbin/chkconfig --add corosync || :
  179. fi
  180. %endif
  181. %preun
  182. %if %{with systemd} && 0%{?systemd_preun:1}
  183. %systemd_preun corosync.service
  184. %else
  185. if [ $1 -eq 0 ]; then
  186. /sbin/service corosync stop &>/dev/null || :
  187. /sbin/chkconfig --del corosync || :
  188. fi
  189. %endif
  190. %postun
  191. %if %{with systemd} && 0%{?systemd_postun:1}
  192. %systemd_postun
  193. %endif
  194. %files
  195. %defattr(-,root,root,-)
  196. %doc LICENSE SECURITY
  197. %{_sbindir}/corosync
  198. %{_sbindir}/corosync-keygen
  199. %{_sbindir}/corosync-cmapctl
  200. %{_sbindir}/corosync-cfgtool
  201. %{_sbindir}/corosync-cpgtool
  202. %{_sbindir}/corosync-quorumtool
  203. %{_sbindir}/corosync-notifyd
  204. %{_bindir}/corosync-blackbox
  205. %if %{with xmlconf}
  206. %{_bindir}/corosync-xmlproc
  207. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  208. %dir %{_datadir}/corosync
  209. %{_datadir}/corosync/xml2conf.xsl
  210. %{_mandir}/man8/corosync-xmlproc.8*
  211. %{_mandir}/man5/corosync.xml.5*
  212. %endif
  213. %dir %{_sysconfdir}/corosync
  214. %dir %{_sysconfdir}/corosync/uidgid.d
  215. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  216. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  217. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  218. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  219. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  220. %if %{with dbus}
  221. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  222. %endif
  223. %if %{with snmp}
  224. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  225. %endif
  226. %if %{with systemd}
  227. %{_unitdir}/corosync.service
  228. %{_unitdir}/corosync-notifyd.service
  229. %else
  230. %{_initrddir}/corosync
  231. %{_initrddir}/corosync-notifyd
  232. %endif
  233. %if %{with upstart}
  234. %{_sysconfdir}/init/corosync.conf
  235. %{_sysconfdir}/init/corosync-notifyd.conf
  236. %endif
  237. %dir %{_localstatedir}/lib/corosync
  238. %dir %{_localstatedir}/log/cluster
  239. %{_mandir}/man8/corosync_overview.8*
  240. %{_mandir}/man8/corosync.8*
  241. %{_mandir}/man8/corosync-blackbox.8*
  242. %{_mandir}/man8/corosync-cmapctl.8*
  243. %{_mandir}/man8/corosync-keygen.8*
  244. %{_mandir}/man8/corosync-cfgtool.8*
  245. %{_mandir}/man8/corosync-cpgtool.8*
  246. %{_mandir}/man8/corosync-notifyd.8*
  247. %{_mandir}/man8/corosync-quorumtool.8*
  248. %{_mandir}/man5/corosync.conf.5*
  249. %{_mandir}/man5/votequorum.5*
  250. %{_mandir}/man8/cmap_keys.8*
  251. # optional testagent rpm
  252. #
  253. %if %{with testagents}
  254. %package -n corosync-testagents
  255. Summary: The Corosync Cluster Engine Test Agents
  256. Group: Development/Libraries
  257. Requires: %{name} = %{version}-%{release}
  258. %description -n corosync-testagents
  259. This package contains corosync test agents.
  260. %files -n corosync-testagents
  261. %defattr(755,root,root,-)
  262. %{_datadir}/corosync/tests/mem_leak_test.sh
  263. %{_datadir}/corosync/tests/net_breaker.sh
  264. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  265. %{_datadir}/corosync/tests/shm_leak_audit.sh
  266. %{_bindir}/cpg_test_agent
  267. %{_bindir}/sam_test_agent
  268. %{_bindir}/votequorum_test_agent
  269. %endif
  270. # library
  271. #
  272. %package -n corosynclib
  273. Summary: The Corosync Cluster Engine Libraries
  274. Group: System Environment/Libraries
  275. %description -n corosynclib
  276. This package contains corosync libraries.
  277. %files -n corosynclib
  278. %defattr(-,root,root,-)
  279. %doc LICENSE
  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. %post -n corosynclib -p /sbin/ldconfig
  289. %postun -n corosynclib -p /sbin/ldconfig
  290. %package -n corosynclib-devel
  291. Summary: The Corosync Cluster Engine Development Kit
  292. Group: Development/Libraries
  293. Requires: corosynclib%{?_isa} = %{version}-%{release}
  294. Requires: pkgconfig
  295. Provides: corosync-devel = %{version}
  296. Obsoletes: corosync-devel < 0.92-7
  297. %description -n corosynclib-devel
  298. This package contains include files and man pages used to develop using
  299. The Corosync Cluster Engine APIs.
  300. %files -n corosynclib-devel
  301. %defattr(-,root,root,-)
  302. %doc LICENSE
  303. %dir %{_includedir}/corosync/
  304. %{_includedir}/corosync/corodefs.h
  305. %{_includedir}/corosync/cfg.h
  306. %{_includedir}/corosync/cmap.h
  307. %{_includedir}/corosync/corotypes.h
  308. %{_includedir}/corosync/cpg.h
  309. %{_includedir}/corosync/hdb.h
  310. %{_includedir}/corosync/sam.h
  311. %{_includedir}/corosync/quorum.h
  312. %{_includedir}/corosync/votequorum.h
  313. %dir %{_includedir}/corosync/totem/
  314. %{_includedir}/corosync/totem/totem.h
  315. %{_includedir}/corosync/totem/totemip.h
  316. %{_includedir}/corosync/totem/totempg.h
  317. %{_includedir}/corosync/totem/totemstats.h
  318. %{_libdir}/libcfg.so
  319. %{_libdir}/libcpg.so
  320. %{_libdir}/libcmap.so
  321. %{_libdir}/libtotem_pg.so
  322. %{_libdir}/libquorum.so
  323. %{_libdir}/libvotequorum.so
  324. %{_libdir}/libsam.so
  325. %{_libdir}/libcorosync_common.so
  326. %{_libdir}/pkgconfig/*.pc
  327. %{_mandir}/man3/cpg_*3*
  328. %{_mandir}/man3/quorum_*3*
  329. %{_mandir}/man3/votequorum_*3*
  330. %{_mandir}/man3/sam_*3*
  331. %{_mandir}/man8/cpg_overview.8*
  332. %{_mandir}/man8/votequorum_overview.8*
  333. %{_mandir}/man8/sam_overview.8*
  334. %{_mandir}/man3/cmap_*3*
  335. %{_mandir}/man8/cmap_overview.8*
  336. %{_mandir}/man8/quorum_overview.8*
  337. # optional qdevices
  338. #
  339. %if %{with qdevices}
  340. %package -n corosync-qdevice
  341. Summary: The Corosync Cluster Engine Qdevice
  342. Group: System Environment/Base
  343. Requires: %{name} = %{version}-%{release}
  344. # The automatic dependency overridden in favor of explicit version lock
  345. Requires: corosynclib%{?_isa} = %{version}-%{release}
  346. Requires: nss-tools
  347. %if %{with systemd}
  348. Requires(post): systemd
  349. Requires(preun): systemd
  350. Requires(postun): systemd
  351. %endif
  352. %description -n corosync-qdevice
  353. This package contains the Corosync Cluster Engine Qdevice, script for creating
  354. NSS certificates and an init script.
  355. %post -n corosync-qdevice
  356. %if %{with systemd} && 0%{?systemd_post:1}
  357. %systemd_post corosync-qdevice.service
  358. %else
  359. if [ $1 -eq 1 ]; then
  360. /sbin/chkconfig --add corosync-qdevice || :
  361. fi
  362. %endif
  363. %preun -n corosync-qdevice
  364. %if %{with systemd} && 0%{?systemd_preun:1}
  365. %systemd_preun corosync-qdevice.service
  366. %else
  367. if [ $1 -eq 0 ]; then
  368. /sbin/service corosync-qdevice stop &>/dev/null || :
  369. /sbin/chkconfig --del corosync-qdevice || :
  370. fi
  371. %endif
  372. %postun -n corosync-qdevice
  373. %if %{with systemd} && 0%{?systemd_postun:1}
  374. %systemd_postun
  375. %endif
  376. %files -n corosync-qdevice
  377. %defattr(-,root,root,-)
  378. %dir %{_sysconfdir}/corosync/qdevice
  379. %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
  380. %dir %{_localstatedir}/run/corosync-qdevice
  381. %{_sbindir}/corosync-qdevice
  382. %{_sbindir}/corosync-qdevice-net-certutil
  383. %{_sbindir}/corosync-qdevice-tool
  384. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
  385. %if %{with systemd}
  386. %{_unitdir}/corosync-qdevice.service
  387. %else
  388. %{_initrddir}/corosync-qdevice
  389. %endif
  390. %{_mandir}/man8/corosync-qdevice-tool.8*
  391. %{_mandir}/man8/corosync-qdevice-net-certutil.8*
  392. %{_mandir}/man8/corosync-qdevice.8*
  393. %endif
  394. # optional qnetd
  395. #
  396. %if %{with qnetd}
  397. %package -n corosync-qnetd
  398. Summary: The Corosync Cluster Engine Qdevice Network Daemon
  399. Group: System Environment/Base
  400. Requires: nss-tools
  401. Requires(pre): shadow-utils
  402. %if %{with systemd}
  403. Requires(post): systemd
  404. Requires(preun): systemd
  405. Requires(postun): systemd
  406. %endif
  407. %description -n corosync-qnetd
  408. This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
  409. NSS certificates and an init script.
  410. %pre -n corosync-qnetd
  411. getent group coroqnetd >/dev/null || groupadd -r coroqnetd
  412. getent passwd coroqnetd >/dev/null || \
  413. useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
  414. exit 0
  415. %post -n corosync-qnetd
  416. %if %{with systemd} && 0%{?systemd_post:1}
  417. %systemd_post corosync-qnetd.service
  418. %else
  419. if [ $1 -eq 1 ]; then
  420. /sbin/chkconfig --add corosync-qnetd || :
  421. fi
  422. %endif
  423. %preun -n corosync-qnetd
  424. %if %{with systemd} && 0%{?systemd_preun:1}
  425. %systemd_preun corosync-qnetd.service
  426. %else
  427. if [ $1 -eq 0 ]; then
  428. /sbin/service corosync-qnetd stop &>/dev/null || :
  429. /sbin/chkconfig --del corosync-qnetd || :
  430. fi
  431. %endif
  432. %postun -n corosync-qnetd
  433. %if %{with systemd} && 0%{?systemd_postun:1}
  434. %systemd_postun
  435. %endif
  436. %files -n corosync-qnetd
  437. %defattr(-,root,root,-)
  438. %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
  439. %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
  440. %{_bindir}/corosync-qnetd
  441. %{_bindir}/corosync-qnetd-certutil
  442. %{_bindir}/corosync-qnetd-tool
  443. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
  444. %if %{with systemd}
  445. %{_unitdir}/corosync-qnetd.service
  446. %else
  447. %{_initrddir}/corosync-qnetd
  448. %endif
  449. %{_mandir}/man8/corosync-qnetd-tool.8*
  450. %{_mandir}/man8/corosync-qnetd-certutil.8*
  451. %{_mandir}/man8/corosync-qnetd.8*
  452. %endif
  453. %changelog
  454. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  455. - Autotools generated version