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