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