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