6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
8 %@bcond_userflags@ userflags
9 %@bcond_runautogen@ runautogen
10 %@bcond_systemd@ systemd
12 %global gitver
%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
13 %global gittarver
%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
15 Name: corosync
-qdevice
16 Summary: The Corosync Cluster Engine Qdevice
18 Release: 1%{?gitver}%{?dist}
20 URL: https
://github.com
/corosync
/corosync
-qdevice
21 Source0: https
://github.com
/corosync
/corosync
-qdevice
/releases
/download
/v
%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz
24 Requires: corosync
>= 2.4.0
25 Requires: corosynclib
>= 2.4.0
30 BuildRequires
: systemd
31 BuildRequires
: systemd
-devel
33 Requires(post
): /sbin
/chkconfig
34 Requires(preun
): /sbin
/chkconfig
39 BuildRequires
: corosynclib
-devel
40 BuildRequires
: libqb
-devel
44 BuildRequires
: groff
-full
50 BuildRequires
: mozilla
-nss
-devel
52 BuildRequires
: nss
-devel
55 %if %{with runautogen}
56 BuildRequires
: autoconf automake libtool
60 %setup -q
-n
%{name}-%{version}%{?gittarver}
63 %if %{with runautogen}
76 --with
-initddir
=%{_initrddir} \
77 --with
-systemddir
=%{_unitdir} \
83 make install DESTDIR
=%{buildroot}
86 # drop docs and html docs for now
87 rm -rf
%{buildroot}%{_docdir}/*
88 mkdir -p
%{buildroot}%{_sysconfdir}/sysconfig
89 # /etc/sysconfig/corosync-qdevice
90 install -p
-m
644 init
/corosync
-qdevice.sysconfig.example \
91 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
92 # /etc/sysconfig/corosync-qnetd
93 install -p
-m
644 init
/corosync
-qnetd.sysconfig.example \
94 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
97 sed
-i
-e 's
/^
#User=/User=/' \
98 %{buildroot}%{_unitdir}/corosync
-qnetd.service
100 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
101 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
105 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
106 NSS certificates and an init script.
109 %if %{with systemd} && 0%{?systemd_post:1}
110 %systemd_post corosync
-qdevice.service
112 if [ $
1 -eq
1 ]; then
113 /sbin
/chkconfig
--add corosync
-qdevice ||
:
118 %if %{with systemd} && 0%{?systemd_preun:1}
119 %systemd_preun corosync
-qdevice.service
121 if [ $
1 -eq
0 ]; then
122 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
123 /sbin
/chkconfig
--del corosync
-qdevice ||
:
128 %if %{with systemd} && 0%{?systemd_postun:1}
129 %systemd_postun corosync
-qdevice.service
134 %dir %{_sysconfdir}/corosync
/qdevice
135 %dir %config(noreplace
) %{_sysconfdir}/corosync
/qdevice
/net
136 %dir %{_localstatedir}/run
/corosync
-qdevice
137 %{_sbindir}/corosync
-qdevice
138 %{_sbindir}/corosync
-qdevice
-net
-certutil
139 %{_sbindir}/corosync
-qdevice
-tool
140 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qdevice
142 %{_unitdir}/corosync
-qdevice.service
144 %{_initrddir}/corosync
-qdevice
146 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
147 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
148 %{_mandir}/man8
/corosync
-qdevice
.8*
150 %package -n corosync
-qdevice
-devel
151 Summary: The Corosync Cluster Engine Qdevice Network Development Kit
154 %description -n corosync
-qdevice
-devel
155 This package contains files used to develop using
156 The Corosync Cluster Engine Qdevice
158 %files -n corosync
-qdevice
-devel
160 %{_datadir}/pkgconfig
/corosync
-qdevice.pc
162 %package -n corosync
-qnetd
163 Summary: The Corosync Cluster Engine Qdevice Network Daemon
165 Requires(pre
): shadow
-utils
171 %description -n corosync
-qnetd
172 This package contains the Corosync Cluster Engine Qdevice Network Daemon
,
173 script
for creating NSS certificates and an init script.
175 %pre -n corosync
-qnetd
176 getent group coroqnetd
>/dev
/null || groupadd
-r coroqnetd
177 getent passwd coroqnetd
>/dev
/null || \
178 useradd
-r
-g coroqnetd
-d
/ -s
/sbin
/nologin
-c "User
for corosync
-qnetd" coroqnetd
181 %post -n corosync
-qnetd
182 %if %{with systemd} && 0%{?systemd_post:1}
183 %systemd_post corosync
-qnetd.service
185 if [ $
1 -eq
1 ]; then
186 /sbin
/chkconfig
--add corosync
-qnetd ||
:
190 %preun -n corosync
-qnetd
191 %if %{with systemd} && 0%{?systemd_preun:1}
192 %systemd_preun corosync
-qnetd.service
194 if [ $
1 -eq
0 ]; then
195 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
196 /sbin
/chkconfig
--del corosync
-qnetd ||
:
200 %postun -n corosync
-qnetd
201 %if %{with systemd} && 0%{?systemd_postun:1}
202 %systemd_postun corosync
-qnetd.service
205 %files -n corosync
-qnetd
207 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
208 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
209 %{_bindir}/corosync
-qnetd
210 %{_bindir}/corosync
-qnetd
-certutil
211 %{_bindir}/corosync
-qnetd
-tool
212 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
214 %{_unitdir}/corosync
-qnetd.service
216 %{_initrddir}/corosync
-qnetd
218 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
219 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
220 %{_mandir}/man8
/corosync
-qnetd
.8*
223 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
224 - Autotools generated version