Name: tang
Version: 6
Release: 2%{?dist}
Summary: Network Presence Binding Daemon
License: GPLv3+
URL: https://github.com/latchset/%{name}
Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.bz2
Patch0001: 0001-Move-key-generation-to-tang.patch
BuildRequires: jose >= 8
BuildRequires: libjose-devel >= 8
BuildRequires: libjose-zlib-devel >= 8
BuildRequires: libjose-openssl-devel >= 8
BuildRequires: http-parser-devel >= 2.7.1-1
BuildRequires: systemd-devel
BuildRequires: pkgconfig
BuildRequires: systemd
BuildRequires: curl
BuildRequires: coreutils
BuildRequires: grep
BuildRequires: sed
BuildRequires: gcc
BuildRequires: autoconf
BuildRequires: automake
%{?systemd_requires}
Requires: coreutils
Requires: jose >= 8
Requires: grep
Requires: sed
Requires(pre): shadow-utils
%description
Tang is a small daemon for binding data to the presence of a third party.
%package nagios
Summary: Nagios plugin for testing Tang Daemon
%description nagios
This package provides a Nagios plugin used to test the Tang Network Presence Binding Daemon.
%prep
%setup -q
%patch0001 -p1
%build
autoreconf -i
%configure
make %{?_smp_mflags} V=1
%install
rm -rf $RPM_BUILD_ROOT
%make_install
echo "User=%{name}" >> $RPM_BUILD_ROOT/%{_unitdir}/%{name}d@.service
%{__mkdir_p} $RPM_BUILD_ROOT/%{_localstatedir}/db/%{name}
%check
if ! make %{?_smp_mflags} check; then
cat test-suite.log
false
fi
%pre
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_localstatedir}/cache/%{name} -s /sbin/nologin \
-c "Tang Network Presence Daemon user" %{name}
exit 0
%post
%systemd_post %{name}d.socket
%preun
%systemd_preun %{name}d.socket
%postun
%systemd_postun_with_restart %{name}d.socket
%files
%license COPYING
%attr(0700, %{name}, %{name}) %{_localstatedir}/db/%{name}
%{_unitdir}/%{name}d@.service
%{_unitdir}/%{name}d.socket
%{_libexecdir}/%{name}d-keygen
%{_libexecdir}/%{name}d
%{_mandir}/man8/tang.8*
%files nagios
%license COPYING
%{_libdir}/nagios/plugins/%{name}
%{_mandir}/man1/tang-nagios.1*
%changelog
* Mon Mar 30 2020 Sergio Correia <scorreia@redhat.com> - 6-2
- Move key generation to tang
- Permissions of /var/db/tang set to 0700
Resolves rhbz#1703445
* Wed Jun 14 2017 Nathaniel McCallum <npmccallum@redhat.com> - 6-1
- New upstream release
- Resolves rhbz#1436264
- Resolves rhbz#1436279
* Wed Mar 15 2017 Nathaniel McCallum <npmccallum@redhat.com> - 4-1
- Import SRPM from Fedora (tang-4-3.fc26)
- Remove nagios dependency
- Adjust http-parser version for RHEL