corosync.spec.in 13 KB

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