corosync.spec.in 12 KB

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