corosync.spec.in 12 KB

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