corosync.spec.in 13 KB

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