corosync.spec.in 13 KB

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