corosync.spec.in 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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. make %{_smp_mflags}
  129. %install
  130. rm -rf %{buildroot}
  131. make install DESTDIR=%{buildroot}
  132. %if %{with dbus}
  133. mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
  134. install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  135. %endif
  136. ## tree fixup
  137. # drop static libs
  138. rm -f %{buildroot}%{_libdir}/*.a
  139. rm -f %{buildroot}%{_libdir}/*.la
  140. # drop docs and html docs for now
  141. rm -rf %{buildroot}%{_docdir}/*
  142. # /etc/sysconfig/corosync-notifyd
  143. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  144. install -m 644 tools/corosync-notifyd.sysconfig.example \
  145. %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
  146. # /etc/sysconfig/corosync
  147. install -m 644 init/corosync.sysconfig.example \
  148. %{buildroot}%{_sysconfdir}/sysconfig/corosync
  149. %if %{with qdevices}
  150. # /etc/sysconfig/corosync-qdevice
  151. install -m 644 init/corosync-qdevice.sysconfig.example \
  152. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
  153. %endif
  154. %if %{with qnetd}
  155. # /etc/sysconfig/corosync-qnetd
  156. install -m 644 init/corosync-qnetd.sysconfig.example \
  157. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  158. %if %{with systemd}
  159. sed -i -e 's/^#User=/User=/' \
  160. %{buildroot}%{_unitdir}/corosync-qnetd.service
  161. %else
  162. sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
  163. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  164. %endif
  165. %endif
  166. %clean
  167. rm -rf %{buildroot}
  168. %description
  169. This package contains the Corosync Cluster Engine Executive, several default
  170. APIs and libraries, default configuration files, and an init script.
  171. %post
  172. %if %{with systemd} && 0%{?systemd_post:1}
  173. %systemd_post corosync.service
  174. %else
  175. if [ $1 -eq 1 ]; then
  176. /sbin/chkconfig --add corosync || :
  177. fi
  178. %endif
  179. %preun
  180. %if %{with systemd} && 0%{?systemd_preun:1}
  181. %systemd_preun corosync.service
  182. %else
  183. if [ $1 -eq 0 ]; then
  184. /sbin/service corosync stop &>/dev/null || :
  185. /sbin/chkconfig --del corosync || :
  186. fi
  187. %endif
  188. %postun
  189. %if %{with systemd} && 0%{?systemd_postun:1}
  190. %systemd_postun
  191. %endif
  192. %files
  193. %defattr(-,root,root,-)
  194. %doc LICENSE SECURITY
  195. %{_sbindir}/corosync
  196. %{_sbindir}/corosync-keygen
  197. %{_sbindir}/corosync-cmapctl
  198. %{_sbindir}/corosync-cfgtool
  199. %{_sbindir}/corosync-cpgtool
  200. %{_sbindir}/corosync-quorumtool
  201. %{_sbindir}/corosync-notifyd
  202. %{_bindir}/corosync-blackbox
  203. %if %{with xmlconf}
  204. %{_bindir}/corosync-xmlproc
  205. %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
  206. %dir %{_datadir}/corosync
  207. %{_datadir}/corosync/xml2conf.xsl
  208. %{_mandir}/man8/corosync-xmlproc.8*
  209. %{_mandir}/man5/corosync.xml.5*
  210. %endif
  211. %dir %{_sysconfdir}/corosync
  212. %dir %{_sysconfdir}/corosync/uidgid.d
  213. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
  214. %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
  215. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
  216. %config(noreplace) %{_sysconfdir}/sysconfig/corosync
  217. %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
  218. %if %{with dbus}
  219. %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
  220. %endif
  221. %if %{with snmp}
  222. %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
  223. %endif
  224. %if %{with systemd}
  225. %{_unitdir}/corosync.service
  226. %{_unitdir}/corosync-notifyd.service
  227. %dir %{_datadir}/corosync
  228. %{_datadir}/corosync/corosync
  229. %{_datadir}/corosync/corosync-notifyd
  230. %else
  231. %{_initrddir}/corosync
  232. %{_initrddir}/corosync-notifyd
  233. %endif
  234. %if %{with upstart}
  235. %{_sysconfdir}/init/corosync.conf
  236. %{_sysconfdir}/init/corosync-notifyd.conf
  237. %endif
  238. %dir %{_localstatedir}/lib/corosync
  239. %dir %{_localstatedir}/log/cluster
  240. %{_mandir}/man8/corosync_overview.8*
  241. %{_mandir}/man8/corosync.8*
  242. %{_mandir}/man8/corosync-blackbox.8*
  243. %{_mandir}/man8/corosync-cmapctl.8*
  244. %{_mandir}/man8/corosync-keygen.8*
  245. %{_mandir}/man8/corosync-cfgtool.8*
  246. %{_mandir}/man8/corosync-cpgtool.8*
  247. %{_mandir}/man8/corosync-notifyd.8*
  248. %{_mandir}/man8/corosync-quorumtool.8*
  249. %{_mandir}/man5/corosync.conf.5*
  250. %{_mandir}/man5/votequorum.5*
  251. %{_mandir}/man8/cmap_keys.8*
  252. # optional testagent rpm
  253. #
  254. %if %{with testagents}
  255. %package -n corosync-testagents
  256. Summary: The Corosync Cluster Engine Test Agents
  257. Group: Development/Libraries
  258. Requires: %{name} = %{version}-%{release}
  259. %description -n corosync-testagents
  260. This package contains corosync test agents.
  261. %files -n corosync-testagents
  262. %defattr(755,root,root,-)
  263. %{_datadir}/corosync/tests/mem_leak_test.sh
  264. %{_datadir}/corosync/tests/net_breaker.sh
  265. %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
  266. %{_datadir}/corosync/tests/shm_leak_audit.sh
  267. %{_bindir}/cpg_test_agent
  268. %{_bindir}/sam_test_agent
  269. %{_bindir}/votequorum_test_agent
  270. %endif
  271. # library
  272. #
  273. %package -n corosynclib
  274. Summary: The Corosync Cluster Engine Libraries
  275. Group: System Environment/Libraries
  276. %description -n corosynclib
  277. This package contains corosync libraries.
  278. %files -n corosynclib
  279. %defattr(-,root,root,-)
  280. %doc LICENSE
  281. %{_libdir}/libcfg.so.*
  282. %{_libdir}/libcpg.so.*
  283. %{_libdir}/libcmap.so.*
  284. %{_libdir}/libtotem_pg.so.*
  285. %{_libdir}/libquorum.so.*
  286. %{_libdir}/libvotequorum.so.*
  287. %{_libdir}/libsam.so.*
  288. %{_libdir}/libcorosync_common.so.*
  289. %post -n corosynclib -p /sbin/ldconfig
  290. %postun -n corosynclib -p /sbin/ldconfig
  291. %package -n corosynclib-devel
  292. Summary: The Corosync Cluster Engine Development Kit
  293. Group: Development/Libraries
  294. Requires: corosynclib%{?_isa} = %{version}-%{release}
  295. Requires: pkgconfig
  296. Provides: corosync-devel = %{version}
  297. Obsoletes: corosync-devel < 0.92-7
  298. %description -n corosynclib-devel
  299. This package contains include files and man pages used to develop using
  300. The Corosync Cluster Engine APIs.
  301. %files -n corosynclib-devel
  302. %defattr(-,root,root,-)
  303. %doc LICENSE
  304. %dir %{_includedir}/corosync/
  305. %{_includedir}/corosync/corodefs.h
  306. %{_includedir}/corosync/cfg.h
  307. %{_includedir}/corosync/cmap.h
  308. %{_includedir}/corosync/corotypes.h
  309. %{_includedir}/corosync/cpg.h
  310. %{_includedir}/corosync/hdb.h
  311. %{_includedir}/corosync/sam.h
  312. %{_includedir}/corosync/quorum.h
  313. %{_includedir}/corosync/votequorum.h
  314. %dir %{_includedir}/corosync/totem/
  315. %{_includedir}/corosync/totem/totem.h
  316. %{_includedir}/corosync/totem/totemip.h
  317. %{_includedir}/corosync/totem/totempg.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. %dir %{_datadir}/corosync
  388. %{_datadir}/corosync/corosync-qdevice
  389. %else
  390. %{_initrddir}/corosync-qdevice
  391. %endif
  392. %{_mandir}/man8/corosync-qdevice-tool.8*
  393. %{_mandir}/man8/corosync-qdevice-net-certutil.8*
  394. %{_mandir}/man8/corosync-qdevice.8*
  395. %endif
  396. # optional qnetd
  397. #
  398. %if %{with qnetd}
  399. %package -n corosync-qnetd
  400. Summary: The Corosync Cluster Engine Qdevice Network Daemon
  401. Group: System Environment/Base
  402. Requires: nss-tools
  403. Requires(pre): shadow-utils
  404. %if %{with systemd}
  405. Requires(post): systemd
  406. Requires(preun): systemd
  407. Requires(postun): systemd
  408. %endif
  409. %description -n corosync-qnetd
  410. This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
  411. NSS certificates and an init script.
  412. %pre -n corosync-qnetd
  413. getent group coroqnetd >/dev/null || groupadd -r coroqnetd
  414. getent passwd coroqnetd >/dev/null || \
  415. useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
  416. exit 0
  417. %post -n corosync-qnetd
  418. %if %{with systemd} && 0%{?systemd_post:1}
  419. %systemd_post corosync-qnetd.service
  420. %else
  421. if [ $1 -eq 1 ]; then
  422. /sbin/chkconfig --add corosync-qnetd || :
  423. fi
  424. %endif
  425. %preun -n corosync-qnetd
  426. %if %{with systemd} && 0%{?systemd_preun:1}
  427. %systemd_preun corosync-qnetd.service
  428. %else
  429. if [ $1 -eq 0 ]; then
  430. /sbin/service corosync-qnetd stop &>/dev/null || :
  431. /sbin/chkconfig --del corosync-qnetd || :
  432. fi
  433. %endif
  434. %postun -n corosync-qnetd
  435. %if %{with systemd} && 0%{?systemd_postun:1}
  436. %systemd_postun
  437. %endif
  438. %files -n corosync-qnetd
  439. %defattr(-,root,root,-)
  440. %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
  441. %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
  442. %{_bindir}/corosync-qnetd
  443. %{_bindir}/corosync-qnetd-certutil
  444. %{_bindir}/corosync-qnetd-tool
  445. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
  446. %if %{with systemd}
  447. %{_unitdir}/corosync-qnetd.service
  448. %dir %{_datadir}/corosync
  449. %{_datadir}/corosync/corosync-qnetd
  450. %else
  451. %{_initrddir}/corosync-qnetd
  452. %endif
  453. %{_mandir}/man8/corosync-qnetd-tool.8*
  454. %{_mandir}/man8/corosync-qnetd-certutil.8*
  455. %{_mandir}/man8/corosync-qnetd.8*
  456. %endif
  457. %changelog
  458. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  459. - Autotools generated version