4
0

corosync-qdevice.spec.in 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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_userflags@ userflags
  8. %@bcond_runautogen@ runautogen
  9. %@bcond_systemd@ systemd
  10. %@bcond_install_qnetd_in_sbin@ install_qnetd_in_sbin
  11. %@bcond_use_sysusers@ use_sysusers
  12. %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
  13. %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
  14. Name: corosync-qdevice
  15. Summary: The Corosync Cluster Engine Qdevice
  16. Version: @version@
  17. Release: 1%{?gitver}%{?dist}
  18. License: BSD-3-Clause
  19. URL: https://github.com/corosync/corosync-qdevice
  20. Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz
  21. # Runtime bits
  22. Requires: corosync >= 2.4.0
  23. Requires: corosynclib >= 2.4.0
  24. Requires: nss-tools
  25. %if %{with systemd}
  26. %{?systemd_requires}
  27. BuildRequires: systemd
  28. BuildRequires: systemd-devel
  29. %else
  30. Requires(post): /sbin/chkconfig
  31. Requires(preun): /sbin/chkconfig
  32. %endif
  33. # Build bits
  34. BuildRequires: gcc
  35. BuildRequires: corosynclib-devel
  36. BuildRequires: libqb-devel
  37. BuildRequires: sed
  38. %if 0%{?suse_version}
  39. BuildRequires: groff-full
  40. %else
  41. BuildRequires: groff
  42. %endif
  43. %if 0%{?suse_version}
  44. BuildRequires: mozilla-nss-devel
  45. %else
  46. BuildRequires: nss-devel
  47. %endif
  48. %if %{with runautogen}
  49. BuildRequires: autoconf automake libtool
  50. %endif
  51. %prep
  52. %setup -q -n %{name}-%{version}%{?gittarver}
  53. %build
  54. %if %{with runautogen}
  55. ./autogen.sh
  56. %endif
  57. %{configure} \
  58. %if %{with userflags}
  59. --enable-user-flags \
  60. %endif
  61. %if %{with systemd}
  62. --enable-systemd \
  63. %endif
  64. %if %{with install_qnetd_in_sbin}
  65. --enable-install-qnetd-in-sbin \
  66. %endif
  67. --enable-qdevices \
  68. --enable-qnetd \
  69. --with-initddir=%{_initrddir} \
  70. --with-systemddir=%{_unitdir} \
  71. --docdir=%{_docdir}
  72. make %{_smp_mflags}
  73. %install
  74. make install DESTDIR=%{buildroot}
  75. ## tree fixup
  76. # drop docs and html docs for now
  77. rm -rf %{buildroot}%{_docdir}/*
  78. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  79. # /etc/sysconfig/corosync-qdevice
  80. install -p -m 644 init/corosync-qdevice.sysconfig.example \
  81. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
  82. # /etc/sysconfig/corosync-qnetd
  83. install -p -m 644 init/corosync-qnetd.sysconfig.example \
  84. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  85. %if %{with systemd}
  86. sed -i -e 's/^#User=/User=/' \
  87. %{buildroot}%{_unitdir}/corosync-qnetd.service
  88. %else
  89. sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
  90. %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
  91. %endif
  92. %if %{with use_sysusers}
  93. install -m0644 -D init/corosync-qnetd.sysusers.conf.example %{buildroot}%{_sysusersdir}/corosync-qnetd.conf
  94. %endif
  95. %description
  96. This package contains the Corosync Cluster Engine Qdevice, script for creating
  97. NSS certificates and an init script.
  98. %post
  99. %if %{with systemd} && 0%{?systemd_post:1}
  100. %systemd_post corosync-qdevice.service
  101. %else
  102. if [ $1 -eq 1 ]; then
  103. /sbin/chkconfig --add corosync-qdevice || :
  104. fi
  105. %endif
  106. %preun
  107. %if %{with systemd} && 0%{?systemd_preun:1}
  108. %systemd_preun corosync-qdevice.service
  109. %else
  110. if [ $1 -eq 0 ]; then
  111. /sbin/service corosync-qdevice stop &>/dev/null || :
  112. /sbin/chkconfig --del corosync-qdevice || :
  113. fi
  114. %endif
  115. %postun
  116. %if %{with systemd} && 0%{?systemd_postun:1}
  117. %systemd_postun corosync-qdevice.service
  118. %endif
  119. %files
  120. %license LICENSE
  121. %dir %{_sysconfdir}/corosync/qdevice
  122. %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
  123. %dir %{_localstatedir}/run/corosync-qdevice
  124. %{_sbindir}/corosync-qdevice
  125. %{_sbindir}/corosync-qdevice-net-certutil
  126. %{_sbindir}/corosync-qdevice-tool
  127. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
  128. %if %{with systemd}
  129. %{_unitdir}/corosync-qdevice.service
  130. %else
  131. %{_initrddir}/corosync-qdevice
  132. %endif
  133. %{_mandir}/man8/corosync-qdevice-tool.8*
  134. %{_mandir}/man8/corosync-qdevice-net-certutil.8*
  135. %{_mandir}/man8/corosync-qdevice.8*
  136. %package -n corosync-qdevice-devel
  137. Summary: The Corosync Cluster Engine Qdevice Network Development Kit
  138. Requires: pkgconfig
  139. %description -n corosync-qdevice-devel
  140. This package contains files used to develop using
  141. The Corosync Cluster Engine Qdevice
  142. %files -n corosync-qdevice-devel
  143. %license LICENSE
  144. %{_datadir}/pkgconfig/corosync-qdevice.pc
  145. %package -n corosync-qnetd
  146. Summary: The Corosync Cluster Engine Qdevice Network Daemon
  147. Requires: nss-tools
  148. %if %{without use_sysusers}
  149. Requires(pre): shadow-utils
  150. %endif
  151. %if %{with systemd}
  152. %{?systemd_requires}
  153. %endif
  154. %description -n corosync-qnetd
  155. This package contains the Corosync Cluster Engine Qdevice Network Daemon,
  156. script for creating NSS certificates and an init script.
  157. %pre -n corosync-qnetd
  158. %if %{without use_sysusers}
  159. getent group coroqnetd >/dev/null || groupadd -r coroqnetd
  160. getent passwd coroqnetd >/dev/null || \
  161. useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
  162. exit 0
  163. %endif
  164. %post -n corosync-qnetd
  165. %if %{with systemd} && 0%{?systemd_post:1}
  166. %systemd_post corosync-qnetd.service
  167. %else
  168. if [ $1 -eq 1 ]; then
  169. /sbin/chkconfig --add corosync-qnetd || :
  170. fi
  171. %endif
  172. %preun -n corosync-qnetd
  173. %if %{with systemd} && 0%{?systemd_preun:1}
  174. %systemd_preun corosync-qnetd.service
  175. %else
  176. if [ $1 -eq 0 ]; then
  177. /sbin/service corosync-qnetd stop &>/dev/null || :
  178. /sbin/chkconfig --del corosync-qnetd || :
  179. fi
  180. %endif
  181. %postun -n corosync-qnetd
  182. %if %{with systemd} && 0%{?systemd_postun:1}
  183. %systemd_postun corosync-qnetd.service
  184. %endif
  185. %files -n corosync-qnetd
  186. %license LICENSE
  187. %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
  188. %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
  189. %if %{with install_qnetd_in_sbin}
  190. %{_sbindir}/corosync-qnetd
  191. %{_sbindir}/corosync-qnetd-certutil
  192. %{_sbindir}/corosync-qnetd-tool
  193. %else
  194. %{_bindir}/corosync-qnetd
  195. %{_bindir}/corosync-qnetd-certutil
  196. %{_bindir}/corosync-qnetd-tool
  197. %endif
  198. %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
  199. %if %{with systemd}
  200. %{_unitdir}/corosync-qnetd.service
  201. %else
  202. %{_initrddir}/corosync-qnetd
  203. %endif
  204. %{_mandir}/man8/corosync-qnetd-tool.8*
  205. %{_mandir}/man8/corosync-qnetd-certutil.8*
  206. %{_mandir}/man8/corosync-qnetd.8*
  207. %if %{with use_sysusers}
  208. %{_sysusersdir}/corosync-qnetd.conf
  209. %endif
  210. %changelog
  211. * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
  212. - Autotools generated version