]> git.proxmox.com Git - mirror_corosync-qdevice.git/blame - corosync-qdevice.spec.in
tests: Enlarge timeout for process-list test
[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
8%bcond_with runautogen
9%bcond_with systemd
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
JF
38BuildRequires: corosynclib-devel
39BuildRequires: groff
40BuildRequires: libqb-devel
41BuildRequires: nss-devel
42BuildRequires: sed
43
44%if %{with runautogen}
45BuildRequires: autoconf automake libtool
46%endif
9a1955a7
JF
47
48%prep
49%setup -q -n %{name}-%{version}%{?gittarver}
50
51%build
52%if %{with runautogen}
53./autogen.sh
54%endif
55
56%{configure} \
57%if %{with systemd}
58 --enable-systemd \
59%endif
60 --enable-qdevices \
61 --enable-qnetd \
62 --with-initddir=%{_initrddir} \
63 --with-systemddir=%{_unitdir}
64
65make %{_smp_mflags}
66
67%install
9a1955a7
JF
68make install DESTDIR=%{buildroot}
69
70## tree fixup
71# drop docs and html docs for now
72rm -rf %{buildroot}%{_docdir}/*
73mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
74# /etc/sysconfig/corosync-qdevice
75install -m 644 init/corosync-qdevice.sysconfig.example \
76 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
77# /etc/sysconfig/corosync-qnetd
78install -m 644 init/corosync-qnetd.sysconfig.example \
79 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
80
81%if %{with systemd}
82sed -i -e 's/^#User=/User=/' \
83 %{buildroot}%{_unitdir}/corosync-qnetd.service
84%else
85sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
86 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
87%endif
88
9a1955a7
JF
89%description
90This package contains the Corosync Cluster Engine Qdevice, script for creating
91NSS certificates and an init script.
92
93%post
94%if %{with systemd} && 0%{?systemd_post:1}
95%systemd_post corosync-qdevice.service
96%else
97if [ $1 -eq 1 ]; then
98 /sbin/chkconfig --add corosync-qdevice || :
99fi
100%endif
101
102%preun
103%if %{with systemd} && 0%{?systemd_preun:1}
104%systemd_preun corosync-qdevice.service
105%else
106if [ $1 -eq 0 ]; then
107 /sbin/service corosync-qdevice stop &>/dev/null || :
108 /sbin/chkconfig --del corosync-qdevice || :
109fi
110%endif
111
112%postun
113%if %{with systemd} && 0%{?systemd_postun:1}
debef989 114%systemd_postun corosync-qdevice.service
9a1955a7
JF
115%endif
116
117%files
9a1955a7
JF
118%dir %{_sysconfdir}/corosync/qdevice
119%dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
120%dir %{_localstatedir}/run/corosync-qdevice
121%{_sbindir}/corosync-qdevice
122%{_sbindir}/corosync-qdevice-net-certutil
123%{_sbindir}/corosync-qdevice-tool
124%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
125%if %{with systemd}
126%{_unitdir}/corosync-qdevice.service
127%else
128%{_initrddir}/corosync-qdevice
129%endif
130%{_mandir}/man8/corosync-qdevice-tool.8*
131%{_mandir}/man8/corosync-qdevice-net-certutil.8*
132%{_mandir}/man8/corosync-qdevice.8*
133
134%package -n corosync-qnetd
135Summary: The Corosync Cluster Engine Qdevice Network Daemon
9a1955a7
JF
136Requires: nss-tools
137Requires(pre): shadow-utils
9a1955a7
JF
138
139%if %{with systemd}
debef989 140%{?systemd_requires}
9a1955a7
JF
141%endif
142
143%description -n corosync-qnetd
144This package contains the Corosync Cluster Engine Qdevice Network Daemon,
145script for creating NSS certificates and an init script.
146
147%pre -n corosync-qnetd
148getent group coroqnetd >/dev/null || groupadd -r coroqnetd
149getent passwd coroqnetd >/dev/null || \
150 useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
151exit 0
152
153%post -n corosync-qnetd
154%if %{with systemd} && 0%{?systemd_post:1}
155%systemd_post corosync-qnetd.service
156%else
157if [ $1 -eq 1 ]; then
158 /sbin/chkconfig --add corosync-qnetd || :
159fi
160%endif
161
162%preun -n corosync-qnetd
163%if %{with systemd} && 0%{?systemd_preun:1}
164%systemd_preun corosync-qnetd.service
165%else
166if [ $1 -eq 0 ]; then
167 /sbin/service corosync-qnetd stop &>/dev/null || :
168 /sbin/chkconfig --del corosync-qnetd || :
169fi
170%endif
171
172%postun -n corosync-qnetd
173%if %{with systemd} && 0%{?systemd_postun:1}
debef989 174%systemd_postun corosync-qnetd.service
9a1955a7
JF
175%endif
176
177%files -n corosync-qnetd
9a1955a7
JF
178%dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
179%dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
180%{_bindir}/corosync-qnetd
181%{_bindir}/corosync-qnetd-certutil
182%{_bindir}/corosync-qnetd-tool
183%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
184%if %{with systemd}
185%{_unitdir}/corosync-qnetd.service
186%else
187%{_initrddir}/corosync-qnetd
188%endif
189%{_mandir}/man8/corosync-qnetd-tool.8*
190%{_mandir}/man8/corosync-qnetd-certutil.8*
191%{_mandir}/man8/corosync-qnetd.8*
192
193%changelog
194* @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
195- Autotools generated version