# debuginfo doesn't work yet
%global debug_package %{nil}
%global aardvark_dns_version v1.1.0
%global aardvark_dns_branch v1.1.0-rhel
%global aardvark_dns_commit0 4847c54770c2de4a0f9873ff5d99cad8609a0baf
%global aardvark_dns_shortcommit0 %(c=%{aardvark_dns_commit0}; echo ${c:0:7})
Epoch: 2
Name: aardvark-dns
Version: 1.1.0
License: ASL 2.0 and BSD and MIT
Release: 5%{?dist}
ExclusiveArch: %{rust_arches}
Summary: Authoritative DNS server for A/AAAA container records
URL: https://github.com/containers/aardvark-dns
%if 0%{?aardvark_dns_branch:1}
Source0: https://github.com/containers/aardvark-dns/tarball/%{aardvark_dns_commit0}/%{aardvark_dns_branch}-%{aardvark_dns_shortcommit0}.tar.gz
%else
Source0: https://github.com/containers/aardvark-dns/archive/%{aardvark_dns_commit0}/aardvark-dns-%{aardvark_dns_version}-%{aardvark_dns_shortcommit0}.tar.gz
%endif
Source1: https://github.com/containers/aardvark-dns/releases/download/%{aardvark_dns_version}/aardvark-dns-%{aardvark_dns_version}-vendor.tar.gz
BuildRequires: cargo
BuildRequires: git-core
BuildRequires: make
BuildRequires: rust-srpm-macros
Conflicts: netavark < %{epoch}:%{version}
%description
%{summary}
Forwards other request to configured resolvers.
Read more about configuration in `src/backend/mod.rs`.
%prep
tar fx %{SOURCE0}
%if 0%{?aardvark_dns_branch:1}
pushd containers-aardvark-dns-%{aardvark_dns_shortcommit0}
%else
pushd aardvark-dns-%{aardvark_dns_commit0}
%endif
tar fx %{SOURCE1}
mkdir -p .cargo
cat >.cargo/config << EOF
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
%build
%if 0%{?aardvark_dns_branch:1}
pushd containers-aardvark-dns-%{aardvark_dns_shortcommit0}
%else
pushd aardvark-dns-%{aardvark_dns_commit0}
%endif
%__scm_setup_git -q
%make_build build
popd
%install
%if 0%{?aardvark_dns_branch:1}
pushd containers-aardvark-dns-%{aardvark_dns_shortcommit0}
%else
pushd aardvark-dns-%{aardvark_dns_commit0}
%endif
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install
popd
%files
%if 0%{?aardvark_dns_branch:1}
%license containers-aardvark-dns-%{aardvark_dns_shortcommit0}/LICENSE
%else
%license aardvark-dns-%{aardvark_dns_commit0}/LICENSE
%endif
%dir %{_libexecdir}/podman
%{_libexecdir}/podman/%{name}
%changelog
* Thu Oct 20 2022 Jindrich Novy <jnovy@redhat.com> - 2:1.1.0-5
- fix "Two aardvark-dns instances trying to use the same port
on the same interface"
- Resolves: #2136306
* Wed Aug 24 2022 Jindrich Novy <jnovy@redhat.com> - 2:1.1.0-4
- remove windows binaries and regenerate vendor tarball
- Related: #2061316
* Tue Aug 23 2022 Jindrich Novy <jnovy@redhat.com> - 2:1.1.0-3
- conflict with older versions than aardvark-dns itself
- Related: #2061316
* Thu Aug 04 2022 Jindrich Novy <jnovy@redhat.com> - 2:1.1.0-2
- add Epoch to preserve upgrade path
- Related: #2061316
* Wed Aug 3 2022 Jindrich Novy <jnovy@redhat.com> 1.1.0-1
- initial import
- Related: #2061316