2a5cd6d
# Conditionals
2a5cd6d
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
2a5cd6d
# to disable or enable specific features
699c206
%bcond_without userflags
2a5cd6d
%bcond_with runautogen
2a5cd6d
%bcond_without systemd
2a5cd6d
2a5cd6d
%global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
2a5cd6d
%global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
2a5cd6d
2a5cd6d
Name: corosync-qdevice
2a5cd6d
Summary: The Corosync Cluster Engine Qdevice
6f06896
Version: 3.0.3
0780fe5
Release: 5%{?gitver}%{?dist}
b49cdd5
License: BSD-3-Clause
2a5cd6d
URL: https://github.com/corosync/corosync-qdevice
2a5cd6d
Source0: https://github.com/corosync/corosync-qdevice/releases/download/v%{version}%{?gittarver}/%{name}-%{version}%{?gittarver}.tar.gz
2a5cd6d
2a5cd6d
# Runtime bits
2a5cd6d
Requires: corosync >= 2.4.0
2a5cd6d
Requires: corosynclib >= 2.4.0
2a5cd6d
Requires: nss-tools
2a5cd6d
2a5cd6d
%if %{with systemd}
2a5cd6d
%{?systemd_requires}
2a5cd6d
BuildRequires: systemd
2a5cd6d
BuildRequires: systemd-devel
2a5cd6d
%else
2a5cd6d
Requires(post): /sbin/chkconfig
2a5cd6d
Requires(preun): /sbin/chkconfig
2a5cd6d
%endif
2a5cd6d
2a5cd6d
# Build bits
29845c7
BuildRequires: gcc
2a5cd6d
BuildRequires: corosynclib-devel
2a5cd6d
BuildRequires: libqb-devel
2a5cd6d
BuildRequires: sed
fe0af05
BuildRequires: groff
fe0af05
BuildRequires: nss-devel
2a5cd6d
2a5cd6d
%if %{with runautogen}
2a5cd6d
BuildRequires: autoconf automake libtool
2a5cd6d
%endif
cb7dbcf
BuildRequires: make
2a5cd6d
2a5cd6d
%prep
2a5cd6d
%setup -q -n %{name}-%{version}%{?gittarver}
2a5cd6d
2a5cd6d
%build
2a5cd6d
%if %{with runautogen}
2a5cd6d
./autogen.sh
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%{configure} \
699c206
%if %{with userflags}
699c206
	--enable-user-flags \
699c206
%endif
2a5cd6d
%if %{with systemd}
2a5cd6d
	--enable-systemd \
2a5cd6d
%endif
2a5cd6d
	--enable-qdevices \
2a5cd6d
	--enable-qnetd \
2a5cd6d
	--with-initddir=%{_initrddir} \
fe0af05
	--with-systemddir=%{_unitdir} \
fe0af05
	--docdir=%{_docdir}
2a5cd6d
5912992
%make_build
2a5cd6d
2a5cd6d
%install
5912992
%make_install
2a5cd6d
2a5cd6d
## tree fixup
2a5cd6d
# drop docs and html docs for now
2a5cd6d
rm -rf %{buildroot}%{_docdir}/*
2a5cd6d
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
2a5cd6d
# /etc/sysconfig/corosync-qdevice
e5177a4
install -p -m 644 init/corosync-qdevice.sysconfig.example \
2a5cd6d
   %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
2a5cd6d
# /etc/sysconfig/corosync-qnetd
e5177a4
install -p -m 644 init/corosync-qnetd.sysconfig.example \
2a5cd6d
   %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
2a5cd6d
2a5cd6d
%if %{with systemd}
2a5cd6d
sed -i -e 's/^#User=/User=/' \
2a5cd6d
   %{buildroot}%{_unitdir}/corosync-qnetd.service
2a5cd6d
%else
2a5cd6d
sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
2a5cd6d
   %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%description
2a5cd6d
This package contains the Corosync Cluster Engine Qdevice, script for creating
2a5cd6d
NSS certificates and an init script.
2a5cd6d
2a5cd6d
%post
2a5cd6d
%if %{with systemd} && 0%{?systemd_post:1}
2a5cd6d
%systemd_post corosync-qdevice.service
2a5cd6d
%else
2a5cd6d
if [ $1 -eq 1 ]; then
2a5cd6d
	/sbin/chkconfig --add corosync-qdevice || :
2a5cd6d
fi
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%preun
2a5cd6d
%if %{with systemd} && 0%{?systemd_preun:1}
2a5cd6d
%systemd_preun corosync-qdevice.service
2a5cd6d
%else
2a5cd6d
if [ $1 -eq 0 ]; then
2a5cd6d
	/sbin/service corosync-qdevice stop &>/dev/null || :
2a5cd6d
	/sbin/chkconfig --del corosync-qdevice || :
2a5cd6d
fi
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%postun
2a5cd6d
%if %{with systemd} && 0%{?systemd_postun:1}
2a5cd6d
%systemd_postun corosync-qdevice.service
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%files
e5177a4
%license LICENSE
2a5cd6d
%dir %{_sysconfdir}/corosync/qdevice
2a5cd6d
%dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
2a5cd6d
%dir %{_localstatedir}/run/corosync-qdevice
2a5cd6d
%{_sbindir}/corosync-qdevice
2a5cd6d
%{_sbindir}/corosync-qdevice-net-certutil
2a5cd6d
%{_sbindir}/corosync-qdevice-tool
2a5cd6d
%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
2a5cd6d
%if %{with systemd}
2a5cd6d
%{_unitdir}/corosync-qdevice.service
2a5cd6d
%else
2a5cd6d
%{_initrddir}/corosync-qdevice
2a5cd6d
%endif
2a5cd6d
%{_mandir}/man8/corosync-qdevice-tool.8*
2a5cd6d
%{_mandir}/man8/corosync-qdevice-net-certutil.8*
2a5cd6d
%{_mandir}/man8/corosync-qdevice.8*
2a5cd6d
699c206
%package -n corosync-qdevice-devel
699c206
Summary: The Corosync Cluster Engine Qdevice Network Development Kit
699c206
Requires: pkgconfig
699c206
699c206
%description -n corosync-qdevice-devel
699c206
This package contains files used to develop using
699c206
The Corosync Cluster Engine Qdevice
699c206
699c206
%files -n corosync-qdevice-devel
699c206
%license LICENSE
699c206
%{_datadir}/pkgconfig/corosync-qdevice.pc
699c206
2a5cd6d
%package -n corosync-qnetd
2a5cd6d
Summary: The Corosync Cluster Engine Qdevice Network Daemon
2a5cd6d
Requires: nss-tools
2a5cd6d
Requires(pre): shadow-utils
2a5cd6d
2a5cd6d
%if %{with systemd}
2a5cd6d
%{?systemd_requires}
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%description -n corosync-qnetd
2a5cd6d
This package contains the Corosync Cluster Engine Qdevice Network Daemon,
2a5cd6d
script for creating NSS certificates and an init script.
2a5cd6d
2a5cd6d
%pre -n corosync-qnetd
2a5cd6d
getent group coroqnetd >/dev/null || groupadd -r coroqnetd
2a5cd6d
getent passwd coroqnetd >/dev/null || \
2a5cd6d
    useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
2a5cd6d
exit 0
2a5cd6d
2a5cd6d
%post -n corosync-qnetd
2a5cd6d
%if %{with systemd} && 0%{?systemd_post:1}
2a5cd6d
%systemd_post corosync-qnetd.service
2a5cd6d
%else
2a5cd6d
if [ $1 -eq 1 ]; then
2a5cd6d
	/sbin/chkconfig --add corosync-qnetd || :
2a5cd6d
fi
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%preun -n corosync-qnetd
2a5cd6d
%if %{with systemd} && 0%{?systemd_preun:1}
2a5cd6d
%systemd_preun corosync-qnetd.service
2a5cd6d
%else
2a5cd6d
if [ $1 -eq 0 ]; then
2a5cd6d
	/sbin/service corosync-qnetd stop &>/dev/null || :
2a5cd6d
	/sbin/chkconfig --del corosync-qnetd || :
2a5cd6d
fi
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%postun -n corosync-qnetd
2a5cd6d
%if %{with systemd} && 0%{?systemd_postun:1}
2a5cd6d
%systemd_postun corosync-qnetd.service
2a5cd6d
%endif
2a5cd6d
2a5cd6d
%files -n corosync-qnetd
e5177a4
%license LICENSE
2a5cd6d
%dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
2a5cd6d
%dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
2a5cd6d
%{_bindir}/corosync-qnetd
2a5cd6d
%{_bindir}/corosync-qnetd-certutil
2a5cd6d
%{_bindir}/corosync-qnetd-tool
2a5cd6d
%config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
2a5cd6d
%if %{with systemd}
2a5cd6d
%{_unitdir}/corosync-qnetd.service
2a5cd6d
%else
2a5cd6d
%{_initrddir}/corosync-qnetd
2a5cd6d
%endif
2a5cd6d
%{_mandir}/man8/corosync-qnetd-tool.8*
2a5cd6d
%{_mandir}/man8/corosync-qnetd-certutil.8*
2a5cd6d
%{_mandir}/man8/corosync-qnetd.8*
2a5cd6d
2a5cd6d
%changelog
0780fe5
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-5
0780fe5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
0780fe5
3025b3d
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-4
3025b3d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
3025b3d
b85940e
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-3
b85940e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
b85940e
b49cdd5
* Tue Jun 06 2023 Jan Friesse <jfriesse@redhat.com> - 3.0.3-2
b49cdd5
- migrated to SPDX license
b49cdd5
6f06896
* Wed Mar 22 2023 Jan Friesse <jfriesse@redhat.com> - 3.0.3-1
6f06896
- New upstream release
6f06896
1180625
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
1180625
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
1180625
8da824c
* Thu Nov 03 2022 Jan Friesse <jfriesse@redhat.com> - 3.0.2-1
8da824c
- New upstream release
8da824c
b683d58
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-4
b683d58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
b683d58
90816ff
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-3
90816ff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
90816ff
f55fa33
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.1-2
f55fa33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
f55fa33
699c206
* Mon Nov 23 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.1-1
699c206
- New upstream release
699c206
7282512
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-10
7282512
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
7282512
5912992
* Wed Jul 22 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.0-9
5912992
- Use make macros
5912992
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
5912992
a48a927
* Wed May 13 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.0-8
a48a927
- Really rebuild for the new libqb
a48a927
6d32525
* Wed May 13 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.0-7
6d32525
- Rebuild for new libqb
6d32525
67d4a69
* Thu Mar 26 2020 Jan Friesse <jfriesse@redhat.com> - 3.0.0-6
67d4a69
- Add CI tests
67d4a69
- Enable gating
67d4a69
aab0d44
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
aab0d44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
aab0d44
0139b3f
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-4
0139b3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0139b3f
e5177a4
* Wed Mar 20 2019 Jan Friesse <jfriesse@redhat.com> - 3.0.0-3
e5177a4
- Add license and use install -p
e5177a4
d7b6f4d
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-2
d7b6f4d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d7b6f4d
61d1628
* Wed Dec 12 2018 Jan Friesse <jfriesse@redhat.com> - 3.0.0-1
61d1628
- New upstream release
61d1628
fe0af05
* Fri Nov 23 2018 Jan Friesse <jfriesse@redhat.com> - 2.93.0-1
fe0af05
- New upstream release
fe0af05
6e890ea
* Thu Aug 09 2018 Jan Friesse <jfriesse@redhat.com> - 2.92.0-1
6e890ea
- New upstream release
6e890ea
a729a5d
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.91.0-2
a729a5d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a729a5d
5c4f272
* Fri Apr 27 2018 Jan Friesse <jfriesse@redhat.com> - 2.91.0-1
5c4f272
- New upstream release
5c4f272
638352c
* Thu Mar 22 2018 Jan Friesse <jfriesse@redhat.com> - 2.90.0-4
638352c
- Rebuild for new Corosync
638352c
effa879
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.90.0-3
effa879
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
effa879
2a5cd6d
* Wed Jan 24 2018 Jan Friesse <jfriesse@redhat.com> - 2.90.0-2
2a5cd6d
- Fix spec file according to advices given in review by
2a5cd6d
  Robert-André Mauchin <zebob.m@gmail.com>
2a5cd6d
2a5cd6d
* Tue Jan 23 2018 Jan Friesse <jfriesse@redhat.com> - 2.90.0-1
2a5cd6d
- First upstream packaged version of corosync for rawhide review.