corosync.spec.in 13 KB

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