6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
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}
78 make install DESTDIR
=%{buildroot}
81 # drop docs and html docs for now
82 rm -rf
%{buildroot}%{_docdir}/*
83 mkdir -p
%{buildroot}%{_sysconfdir}/sysconfig
84 # /etc/sysconfig/corosync-qdevice
85 install -m
644 init
/corosync
-qdevice.sysconfig.example \
86 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
87 # /etc/sysconfig/corosync-qnetd
88 install -m
644 init
/corosync
-qnetd.sysconfig.example \
89 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
92 sed
-i
-e 's
/^
#User=/User=/' \
93 %{buildroot}%{_unitdir}/corosync
-qnetd.service
95 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
96 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
100 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
101 NSS certificates and an init script.
104 %if %{with systemd} && 0%{?systemd_post:1}
105 %systemd_post corosync
-qdevice.service
107 if [ $
1 -eq
1 ]; then
108 /sbin
/chkconfig
--add corosync
-qdevice ||
:
113 %if %{with systemd} && 0%{?systemd_preun:1}
114 %systemd_preun corosync
-qdevice.service
116 if [ $
1 -eq
0 ]; then
117 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
118 /sbin
/chkconfig
--del corosync
-qdevice ||
:
123 %if %{with systemd} && 0%{?systemd_postun:1}
124 %systemd_postun corosync
-qdevice.service
128 %dir %{_sysconfdir}/corosync
/qdevice
129 %dir %config(noreplace
) %{_sysconfdir}/corosync
/qdevice
/net
130 %dir %{_localstatedir}/run
/corosync
-qdevice
131 %{_sbindir}/corosync
-qdevice
132 %{_sbindir}/corosync
-qdevice
-net
-certutil
133 %{_sbindir}/corosync
-qdevice
-tool
134 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qdevice
136 %{_unitdir}/corosync
-qdevice.service
138 %{_initrddir}/corosync
-qdevice
140 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
141 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
142 %{_mandir}/man8
/corosync
-qdevice
.8*
144 %package -n corosync
-qnetd
145 Summary: The Corosync Cluster Engine Qdevice Network Daemon
147 Requires(pre
): shadow
-utils
153 %description -n corosync
-qnetd
154 This package contains the Corosync Cluster Engine Qdevice Network Daemon
,
155 script
for creating NSS certificates and an init script.
157 %pre -n corosync
-qnetd
158 getent group coroqnetd
>/dev
/null || groupadd
-r coroqnetd
159 getent passwd coroqnetd
>/dev
/null || \
160 useradd
-r
-g coroqnetd
-d
/ -s
/sbin
/nologin
-c "User
for corosync
-qnetd" coroqnetd
163 %post -n corosync
-qnetd
164 %if %{with systemd} && 0%{?systemd_post:1}
165 %systemd_post corosync
-qnetd.service
167 if [ $
1 -eq
1 ]; then
168 /sbin
/chkconfig
--add corosync
-qnetd ||
:
172 %preun -n corosync
-qnetd
173 %if %{with systemd} && 0%{?systemd_preun:1}
174 %systemd_preun corosync
-qnetd.service
176 if [ $
1 -eq
0 ]; then
177 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
178 /sbin
/chkconfig
--del corosync
-qnetd ||
:
182 %postun -n corosync
-qnetd
183 %if %{with systemd} && 0%{?systemd_postun:1}
184 %systemd_postun corosync
-qnetd.service
187 %files -n corosync
-qnetd
188 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
189 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
190 %{_bindir}/corosync
-qnetd
191 %{_bindir}/corosync
-qnetd
-certutil
192 %{_bindir}/corosync
-qnetd
-tool
193 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
195 %{_unitdir}/corosync
-qnetd.service
197 %{_initrddir}/corosync
-qnetd
199 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
200 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
201 %{_mandir}/man8
/corosync
-qnetd
.8*
204 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
205 - Autotools generated version