corosync.spec.in 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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. %dir %{_datadir}/corosync
  230. %{_datadir}/corosync/corosync
  231. %{_datadir}/corosync/corosync-notifyd
  232. %else
  233. %{_initrddir}/corosync
  234. %{_initrddir}/corosync-notifyd
  235. %endif
  236. %if %{with upstart}
  237. %{_sysconfdir}/init/corosync.conf
  238. %{_sysconfdir}/init/corosync-notifyd.conf
  239. %endif
  240. %dir %{_localstatedir}/lib/corosync
  241. %dir %{_localstatedir}/log/cluster
  242. %{_mandir}/man8/corosync_overview.8*
  243. %{_mandir}/man8/corosync.8*
  244. %{_mandir}/man8/corosync-blackbox.8*
  245. %{_mandir}/man8/corosync-cmapctl.8*
  246. %{_mandir}/man8/corosync-keygen.8*
  247. %{_mandir}/man8/corosync-cfgtool.8*
  248. %{_mandir}/man8/corosync-cpgtool.8*
  249. %{_mandir}/man8/corosync-notifyd.8*
  250. %{_mandir}/man8/corosync-quorumtool.8*
  251. %{_mandir}/man5/corosync.conf.5*
  252. %{_mandir}/man5/votequorum.5*
  253. %{_mandir}/man8/cmap_keys.8*
  254. # optional testagent rpm
  255. #
  256. %if %{with testagents}
  257. %package -n corosync-testagents
  258. Summary: The Corosync Cluster Engine Test Agents
  259. Group: Development/Libraries
  260. Requires: %{name} = %{version}-%{release}
  261. %description -n corosync-testagents
  262. This package contains corosync test agents.
  263. %files -n corosync-testagents
  264. %defattr(755,root,root,-)
  265. %{_datadir}/corosync/tests/mem_leak_test.sh
  266. %{_datadir}/corosync/tests/net_breaker.sh
  267. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  268. %{_datadir}/corosync/tests/shm_leak_audit.sh
  269. %{_bindir}/cpg_test_agent
  270. %{_bindir}/sam_test_agent
  271. %{_bindir}/votequorum_test_agent
  272. %endif
  273. # library
  274. #
  275. %package -n corosynclib
  276. Summary: The Corosync Cluster Engine Libraries
  277. Group: System Environment/Libraries
  278. %description -n corosynclib
  279. This package contains corosync libraries.
  280. %files -n corosynclib
  281. %defattr(-,root,root,-)
  282. %doc LICENSE
  283. %{_libdir}/libcfg.so.*
  284. %{_libdir}/libcpg.so.*
  285. %{_libdir}/libcmap.so.*
  286. %{_libdir}/libtotem_pg.so.*
  287. %{_libdir}/libquorum.so.*
  288. %{_libdir}/libvotequorum.so.*
  289. %{_libdir}/libsam.so.*
  290. %{_libdir}/libcorosync_common.so.*
  291. %post -n corosynclib -p /sbin/ldconfig
  292. %postun -n corosynclib -p /sbin/ldconfig
  293. %package -n corosynclib-devel
  294. Summary: The Corosync Cluster Engine Development Kit
  295. Group: Development/Libraries
  296. Requires: corosynclib%{?_isa} = %{version}-%{release}
  297. Requires: pkgconfig
  298. Provides: corosync-devel = %{version}
  299. Obsoletes: corosync-devel < 0.92-7
  300. %description -n corosynclib-devel
  301. This package contains include files and man pages used to develop using
  302. The Corosync Cluster Engine APIs.
  303. %files -n corosynclib-devel
  304. %defattr(-,root,root,-)
  305. %doc LICENSE
  306. %dir %{_includedir}/corosync/
  307. %{_includedir}/corosync/corodefs.h
  308. %{_includedir}/corosync/cfg.h
  309. %{_includedir}/corosync/cmap.h
  310. %{_includedir}/corosync/corotypes.h
  311. %{_includedir}/corosync/cpg.h
  312. %{_includedir}/corosync/hdb.h
  313. %{_includedir}/corosync/sam.h
  314. %{_includedir}/corosync/quorum.h
  315. %{_includedir}/corosync/votequorum.h
  316. %dir %{_includedir}/corosync/totem/
  317. %{_includedir}/corosync/totem/totem.h
  318. %{_includedir}/corosync/totem/totemip.h
  319. %{_includedir}/corosync/totem/totempg.h
  320. %{_libdir}/libcfg.so
  321. %{_libdir}/libcpg.so
  322. %{_libdir}/libcmap.so
  323. %{_libdir}/libtotem_pg.so
  324. %{_libdir}/libquorum.so
  325. %{_libdir}/libvotequorum.so
  326. %{_libdir}/libsam.so
  327. %{_libdir}/libcorosync_common.so
  328. %{_libdir}/pkgconfig/*.pc
  329. %{_mandir}/man3/cpg_*3*
  330. %{_mandir}/man3/quorum_*3*
  331. %{_mandir}/man3/votequorum_*3*
  332. %{_mandir}/man3/sam_*3*
  333. %{_mandir}/man8/cpg_overview.8*
  334. %{_mandir}/man8/votequorum_overview.8*
  335. %{_mandir}/man8/sam_overview.8*
  336. %{_mandir}/man3/cmap_*3*
  337. %{_mandir}/man8/cmap_overview.8*
  338. %{_mandir}/man8/quorum_overview.8*
  339. # optional qdevices
  340. #
  341. %if %{with qdevices}
  342. %package -n corosync-qdevice
  343. Summary: The Corosync Cluster Engine Qdevice
  344. Group: System Environment/Base
  345. Requires: %{name} = %{version}-%{release}
  346. # The automatic dependency overridden in favor of explicit version lock
  347. Requires: corosynclib%{?_isa} = %{version}-%{release}
  348. Requires: nss-tools
  349. %if %{with systemd}
  350. Requires(post): systemd
  351. Requires(preun): systemd
  352. Requires(postun): systemd
  353. %endif
  354. %description -n corosync-qdevice
  355. This package contains the Corosync Cluster Engine Qdevice, script for creating
  356. NSS certificates and an init script.
  357. %post -n corosync-qdevice
  358. %if %{with systemd} && 0%{?systemd_post:1}
  359. %systemd_post corosync-qdevice.service
  360. %else
  361. if [ $1 -eq 1 ]; then
  362. /sbin/chkconfig --add corosync-qdevice || :
  363. fi
  364. %endif
  365. %preun -n corosync-qdevice
  366. %if %{with systemd} && 0%{?systemd_preun:1}
  367. %systemd_preun corosync-qdevice.service
  368. %else
  369. if [ $1 -eq 0 ]; then
  370. /sbin/service corosync-qdevice stop &>/dev/null || :
  371. /sbin/chkconfig --del corosync-qdevice || :
  372. fi
  373. %endif
  374. %postun -n corosync-qdevice
  375. %if %{with systemd} && 0%{?systemd_postun:1}
  376. %systemd_postun
  377. %endif
  378. %files -n corosync-qdevice
  379. %defattr(-,root,root,-)
  380. %dir %{_sysconfdir}/corosync/qdevice
  381. %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
  382. %dir %{_localstatedir}/run/corosync-qdevice
  383. %{_sbindir}/corosync-qdevice
  384. %{_sbindir}/corosync-qdevice-net-certutil
  385. %{_sbindir}/corosync-qdevice-tool
  386. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
  387. %if %{with systemd}
  388. %{_unitdir}/corosync-qdevice.service
  389. %dir %{_datadir}/corosync
  390. %{_datadir}/corosync/corosync-qdevice
  391. %else
  392. %{_initrddir}/corosync-qdevice
  393. %endif
  394. %{_mandir}/man8/corosync-qdevice-tool.8*
  395. %{_mandir}/man8/corosync-qdevice-net-certutil.8*
  396. %{_mandir}/man8/corosync-qdevice.8*
  397. %endif
  398. # optional qnetd
  399. #
  400. %if %{with qnetd}
  401. %package -n corosync-qnetd
  402. Summary: The Corosync Cluster Engine Qdevice Network Daemon
  403. Group: System Environment/Base
  404. Requires: nss-tools
  405. Requires(pre): shadow-utils
  406. %if %{with systemd}
  407. Requires(post): systemd
  408. Requires(preun): systemd
  409. Requires(postun): systemd
  410. %endif
  411. %description -n corosync-qnetd
  412. This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
  413. NSS certificates and an init script.
  414. %pre -n corosync-qnetd
  415. getent group coroqnetd >/dev/null || groupadd -r coroqnetd
  416. getent passwd coroqnetd >/dev/null || \
  417. useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
  418. exit 0
  419. %post -n corosync-qnetd
  420. %if %{with systemd} && 0%{?systemd_post:1}
  421. %systemd_post corosync-qnetd.service
  422. %else
  423. if [ $1 -eq 1 ]; then
  424. /sbin/chkconfig --add corosync-qnetd || :
  425. fi
  426. %endif
  427. %preun -n corosync-qnetd
  428. %if %{with systemd} && 0%{?systemd_preun:1}
  429. %systemd_preun corosync-qnetd.service
  430. %else
  431. if [ $1 -eq 0 ]; then
  432. /sbin/service corosync-qnetd stop &>/dev/null || :
  433. /sbin/chkconfig --del corosync-qnetd || :
  434. fi
  435. %endif
  436. %postun -n corosync-qnetd
  437. %if %{with systemd} && 0%{?systemd_postun:1}
  438. %systemd_postun
  439. %endif
  440. %files -n corosync-qnetd
  441. %defattr(-,root,root,-)
  442. %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
  443. %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
  444. %{_bindir}/corosync-qnetd
  445. %{_bindir}/corosync-qnetd-certutil
  446. %{_bindir}/corosync-qnetd-tool
  447. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
  448. %if %{with systemd}
  449. %{_unitdir}/corosync-qnetd.service
  450. %dir %{_datadir}/corosync
  451. %{_datadir}/corosync/corosync-qnetd
  452. %else
  453. %{_initrddir}/corosync-qnetd
  454. %endif
  455. %{_mandir}/man8/corosync-qnetd-tool.8*
  456. %{_mandir}/man8/corosync-qnetd-certutil.8*
  457. %{_mandir}/man8/corosync-qnetd.8*
  458. %endif
  459. %changelog
  460. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  461. - Autotools generated version