Blame corosync-qdevice.spec

2a5cd6d
# Conditionals
2a5cd6d
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
2a5cd6d
# to disable or enable specific features
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
61d1628
Version: 3.0.0
aab0d44
Release: 5%{?gitver}%{?dist}
2a5cd6d
License: BSD
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
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} \
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
2a5cd6d
make %{_smp_mflags}
2a5cd6d
2a5cd6d
%install
2a5cd6d
make install DESTDIR=%{buildroot}
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
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
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.