83f61c
%global _hardened_build 1
83f61c
83f61c
Summary: A RFC 1413 ident protocol daemon
83f61c
Name: authd
83f61c
Version: 1.4.4
83f61c
Release: 5%{?dist}.1
83f61c
License: GPLv2+
83f61c
URL: https://github.com/InfrastructureServices/authd
83f61c
Obsoletes: pidentd < 3.2
83f61c
Provides: pidentd = 3.2
83f61c
Requires(post): openssl
83f61c
Source0: https://github.com/InfrastructureServices/authd/releases/download/v1.4.4/authd-1.4.4.tar.gz
83f61c
Source1: auth.socket
83f61c
Source2: auth@.service
83f61c
BuildRequires:  gcc
83f61c
BuildRequires: openssl-devel gettext help2man systemd-units
83f61c
Requires(post): systemd-units
83f61c
Requires(preun): systemd-units
83f61c
Requires(postun): systemd-units
83f61c
83f61c
Patch0: authd-covscan.patch
83f61c
83f61c
%description
83f61c
authd is a small and fast RFC 1413 ident protocol daemon
83f61c
with both xinetd server and interactive modes that
83f61c
supports IPv6 and IPv4 as well as the more popular features
83f61c
of pidentd.
83f61c
83f61c
%prep
83f61c
%autosetup
83f61c
83f61c
%build
83f61c
make prefix=%{_prefix} CFLAGS="%{optflags}" \
83f61c
        LDFLAGS="-lcrypto %{build_ldflags}"
83f61c
83f61c
%install
83f61c
%make_install datadir=%{buildroot}/%{_datadir} \
83f61c
	sbindir=%{buildroot}/%{_sbindir}
83f61c
83f61c
install -d %{buildroot}%{_unitdir}/
83f61c
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/
83f61c
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/
83f61c
83f61c
install -d %{buildroot}%{_sysconfdir}/
83f61c
touch %{buildroot}%{_sysconfdir}/ident.key
83f61c
83f61c
install -d %{buildroot}/%{_mandir}/man1/
83f61c
help2man -N -v -V %{buildroot}/%{_sbindir}/in.authd -o \
83f61c
         %{buildroot}/%{_mandir}/man1/in.authd.1
83f61c
83f61c
%find_lang %{name}
83f61c
83f61c
%post
83f61c
/usr/sbin/adduser -s /sbin/nologin -u 98 -r -d '/' ident 2>/dev/null || true
83f61c
/usr/bin/openssl rand -base64 -out %{_sysconfdir}/ident.key 32
83f61c
echo CHANGE THE LINE ABOVE TO A PASSPHRASE >> %{_sysconfdir}/ident.key
83f61c
/bin/chown ident:ident %{_sysconfdir}/ident.key
83f61c
chmod o-rw %{_sysconfdir}/ident.key
83f61c
%systemd_post auth.socket
83f61c
83f61c
%postun
83f61c
%systemd_postun_with_restart auth.socket
83f61c
83f61c
%preun
83f61c
%systemd_preun auth.socket
83f61c
83f61c
%files -f authd.lang
83f61c
%license COPYING
83f61c
%verify(not md5 size mtime user group) %config(noreplace) %attr(640,root,root) %{_sysconfdir}/ident.key
83f61c
%doc COPYING README.html rfc1413.txt
83f61c
%{_sbindir}/in.authd
83f61c
%{_mandir}/*/*
83f61c
%{_unitdir}/*
83f61c
83f61c
%changelog
83f61c
* Wed Jul 17 2019 Pavel Zhukov <pzhukov@redhat.com> - 1.4.4-5.1
83f61c
- Resolves: #1722492 - Partially revert covscan fix 
83f61c
83f61c
* Mon Feb 18 2019 Pavel Zhukov <pzhukov@redhat.com> - 1.4.4-5
83f61c
- Related: #1642073 - Properly pass hardened ld flags
83f61c
- Fix covscan reported errors
83f61c
83f61c
* Sun Feb 17 2019 Pavel Zhukov <pzhukov@redhat.com> - 1.4.4-2
83f61c
- Related: #1642073 - Rebuild with RHEL CFLAGS
83f61c
- Enabled hardered build
83f61c
83f61c
* Tue Feb 12 2019 Pavel Zhukov <pzhukov@redhat.com> - 1.4.4-1
83f61c
- Import from Fedora
83f61c
- New release (v1.4.4)
83f61c
- New upstream URL
83f61c
83f61c