File gross.spec of Package gross

Name: gross
Summary: Fast and efficient greylist server with DNSBL support
Version: 1.1.0~a1
Release: 1
License: ISC
URL: https://codeberg.org/bizdelnick/gross
Source0: %{name}-%{version}.tar.xz
Source1: gross.service
Source2: gross.sysusers

Requires: systemd
%if 0%{?suse_version}
Requires(pre): shadow
%else
Requires(pre): shadow-utils
%endif
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

%if 0%{?suse_version}
BuildRequires: cmake-full
%else
BuildRequires: cmake
BuildRequires: cmake-rpm-macros
%endif
BuildRequires: rubygem(asciidoctor)
BuildRequires: pkgconfig(libcares)
BuildRequires: sendmail-devel
BuildRequires: libspf2-devel

%if 0%{?rhel} > 8 || 0%{?fedora} > 29 || 0%{?suse_version}
BuildRequires: systemd-rpm-macros
%else
BuildRequires: systemd
%endif

%description
Gross is a greylisting server. The features that make gross stand out from
other greylisters are:

 - it's blazingly fast
 - it's amazingly resource efficient
 - it can be configured to query DNSBL databases, and enforce greylisting only
   for hosts that are found on those databases
 - it can block hosts that match multiple DNSBL's
 - it can be replicated and run parallel on two servers
 - it supports Sun Java System Messaging Server, Postfix, Sendmail and Exim.


%prep
%autosetup


%build
%cmake
%cmake_build

%check
%ctest --label-exclude net


%install
%cmake_install

%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/gross.service
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/gross.conf


%pre
getent group gross > /dev/null || groupadd -r gross
getent passwd gross > /dev/null || \
    useradd -r -d %{_localstatedir}/lib/gross -g gross \
    -s /sbin/nologin -c "Gross greylisting server" gross
exit 0


%post
%systemd_post gross.service


%preun
%systemd_preun gross.service


%postun
%systemd_postun_with_restart gross.service


%files
%defattr(-,root,root)
%doc README.md NEWS
%license COPYING
%config(noreplace) %{_sysconfdir}/grossd.conf
%{_sbindir}/grossd
%{_libdir}/gross
%{_mandir}/*/*
%{_unitdir}/gross.service
%{_sysusersdir}/gross.conf

%changelog
openSUSE Build Service is sponsored by