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