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
-qnetd
151 Summary: The Corosync Cluster Engine Qdevice Network Daemon
153 Requires(pre
): shadow
-utils
159 %description -n corosync
-qnetd
160 This package contains the Corosync Cluster Engine Qdevice Network Daemon
,
161 script
for creating NSS certificates and an init script.
163 %pre -n corosync
-qnetd
164 getent group coroqnetd
>/dev
/null || groupadd
-r coroqnetd
165 getent passwd coroqnetd
>/dev
/null || \
166 useradd
-r
-g coroqnetd
-d
/ -s
/sbin
/nologin
-c "User
for corosync
-qnetd" coroqnetd
169 %post -n corosync
-qnetd
170 %if %{with systemd} && 0%{?systemd_post:1}
171 %systemd_post corosync
-qnetd.service
173 if [ $
1 -eq
1 ]; then
174 /sbin
/chkconfig
--add corosync
-qnetd ||
:
178 %preun -n corosync
-qnetd
179 %if %{with systemd} && 0%{?systemd_preun:1}
180 %systemd_preun corosync
-qnetd.service
182 if [ $
1 -eq
0 ]; then
183 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
184 /sbin
/chkconfig
--del corosync
-qnetd ||
:
188 %postun -n corosync
-qnetd
189 %if %{with systemd} && 0%{?systemd_postun:1}
190 %systemd_postun corosync
-qnetd.service
193 %files -n corosync
-qnetd
195 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
196 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
197 %{_bindir}/corosync
-qnetd
198 %{_bindir}/corosync
-qnetd
-certutil
199 %{_bindir}/corosync
-qnetd
-tool
200 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
202 %{_unitdir}/corosync
-qnetd.service
204 %{_initrddir}/corosync
-qnetd
206 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
207 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
208 %{_mandir}/man8
/corosync
-qnetd
.8*
211 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
212 - Autotools generated version