6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
8 %@bcond_runautogen@ runautogen
9 %@bcond_systemd@ systemd
11 %global gitver
%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
12 %global gittarver
%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
14 Name: corosync
-qdevice
15 Summary: The Corosync Cluster Engine Qdevice
17 Release: 1%{?gitver}%{?dist}
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
23 Requires: corosync
>= 2.4.0
24 Requires: corosynclib
>= 2.4.0
29 BuildRequires
: systemd
30 BuildRequires
: systemd
-devel
32 Requires(post
): /sbin
/chkconfig
33 Requires(preun
): /sbin
/chkconfig
38 BuildRequires
: corosynclib
-devel
39 BuildRequires
: libqb
-devel
43 BuildRequires
: groff
-full
49 BuildRequires
: mozilla
-nss
-devel
51 BuildRequires
: nss
-devel
54 %if %{with runautogen}
55 BuildRequires
: autoconf automake libtool
59 %setup -q
-n
%{name}-%{version}%{?gittarver}
62 %if %{with runautogen}
72 --with
-initddir
=%{_initrddir} \
73 --with
-systemddir
=%{_unitdir} \
79 make install DESTDIR
=%{buildroot}
82 # drop docs and html docs for now
83 rm -rf
%{buildroot}%{_docdir}/*
84 mkdir -p
%{buildroot}%{_sysconfdir}/sysconfig
85 # /etc/sysconfig/corosync-qdevice
86 install -m
644 init
/corosync
-qdevice.sysconfig.example \
87 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
88 # /etc/sysconfig/corosync-qnetd
89 install -m
644 init
/corosync
-qnetd.sysconfig.example \
90 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
93 sed
-i
-e 's
/^
#User=/User=/' \
94 %{buildroot}%{_unitdir}/corosync
-qnetd.service
96 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
97 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
101 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
102 NSS certificates and an init script.
105 %if %{with systemd} && 0%{?systemd_post:1}
106 %systemd_post corosync
-qdevice.service
108 if [ $
1 -eq
1 ]; then
109 /sbin
/chkconfig
--add corosync
-qdevice ||
:
114 %if %{with systemd} && 0%{?systemd_preun:1}
115 %systemd_preun corosync
-qdevice.service
117 if [ $
1 -eq
0 ]; then
118 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
119 /sbin
/chkconfig
--del corosync
-qdevice ||
:
124 %if %{with systemd} && 0%{?systemd_postun:1}
125 %systemd_postun corosync
-qdevice.service
129 %dir %{_sysconfdir}/corosync
/qdevice
130 %dir %config(noreplace
) %{_sysconfdir}/corosync
/qdevice
/net
131 %dir %{_localstatedir}/run
/corosync
-qdevice
132 %{_sbindir}/corosync
-qdevice
133 %{_sbindir}/corosync
-qdevice
-net
-certutil
134 %{_sbindir}/corosync
-qdevice
-tool
135 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qdevice
137 %{_unitdir}/corosync
-qdevice.service
139 %{_initrddir}/corosync
-qdevice
141 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
142 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
143 %{_mandir}/man8
/corosync
-qdevice
.8*
145 %package -n corosync
-qnetd
146 Summary: The Corosync Cluster Engine Qdevice Network Daemon
148 Requires(pre
): shadow
-utils
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.
158 %pre -n corosync
-qnetd
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
164 %post -n corosync
-qnetd
165 %if %{with systemd} && 0%{?systemd_post:1}
166 %systemd_post corosync
-qnetd.service
168 if [ $
1 -eq
1 ]; then
169 /sbin
/chkconfig
--add corosync
-qnetd ||
:
173 %preun -n corosync
-qnetd
174 %if %{with systemd} && 0%{?systemd_preun:1}
175 %systemd_preun corosync
-qnetd.service
177 if [ $
1 -eq
0 ]; then
178 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
179 /sbin
/chkconfig
--del corosync
-qnetd ||
:
183 %postun -n corosync
-qnetd
184 %if %{with systemd} && 0%{?systemd_postun:1}
185 %systemd_postun corosync
-qnetd.service
188 %files -n corosync
-qnetd
189 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
190 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
191 %{_bindir}/corosync
-qnetd
192 %{_bindir}/corosync
-qnetd
-certutil
193 %{_bindir}/corosync
-qnetd
-tool
194 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
196 %{_unitdir}/corosync
-qnetd.service
198 %{_initrddir}/corosync
-qnetd
200 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
201 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
202 %{_mandir}/man8
/corosync
-qnetd
.8*
205 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
206 - Autotools generated version