corosync.spec.in 13 KB

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