# Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/coredns/coredns %global goipath github.com/coredns/coredns Version: 1.14.7 %global tag v1.14.7 %gometa -L -f Name: coredns Release: %autorelease Summary: DNS server that chains plugins # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools. Regenerate with: # spectool -g -S coredns.spec # go_vendor_archive create --config go-vendor-tools.toml coredns.spec # go_vendor_license --config go-vendor-tools.toml --path coredns.spec \ # report --update-spec Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: coredns.service Source4: coredns-sysusers.conf Source5: coredns-tmpfiles.conf Source6: Corefile Source7: README.Fedora # Provides the %%go_vendor_license_* macros used below. Must be a static # BuildRequires: they are needed before %%generate_buildrequires runs. BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros %{?sysusers_requires_compat} %{?systemd_requires} %description CoreDNS is a DNS server that chains plugins. Each plugin performs a DNS function, such as serving zone data from file, caching, forwarding to an upstream resolver, or exporting metrics. Plugins are enabled and ordered through a Corefile, letting a single server act as an authoritative name server, a recursive cache, or a service-discovery backend. %prep %goprep -p1 tar -xf %{S:1} cp -p %{S:7} . %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on %gobuild -o %{gobuilddir}/bin/coredns %{goipath} %install %go_vendor_license_install -c %{S:2} install -D -p -m 0755 %{gobuilddir}/bin/coredns %{buildroot}%{_bindir}/coredns install -D -p -m 0644 %{S:3} %{buildroot}%{_unitdir}/coredns.service install -D -p -m 0644 %{S:4} %{buildroot}%{_sysusersdir}/coredns.conf install -D -p -m 0644 %{S:5} %{buildroot}%{_tmpfilesdir}/coredns.conf install -D -p -m 0644 %{S:6} %{buildroot}%{_sysconfdir}/coredns/Corefile install -d -m 0755 %{buildroot}%{_sharedstatedir}/coredns # Pre-generated man pages shipped by upstream in man/ install -d -m 0755 %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man5 %{buildroot}%{_mandir}/man7 install -p -m 0644 man/coredns.1 %{buildroot}%{_mandir}/man1/ install -p -m 0644 man/corefile.5 %{buildroot}%{_mandir}/man5/ install -p -m 0644 man/coredns-*.7 %{buildroot}%{_mandir}/man7/ %check %go_vendor_license_check -c %{S:2} %if %{with check} # Upstream's ./test/ directory holds integration tests that want a live # network and an etcd instance. Everything else passes offline. # # The package list goes through a shell variable on purpose. EL9 parses the # spec for the SRPM with only go-srpm-macros installed, and its fallback # %%gotest() declares no options, so a literal "-v" (from grep) sitting on the # %%gotest line is parsed as a macro option and aborts the build. gotestpkgs=$(go list ./... | grep -v '/test$') %gotest ${gotestpkgs} %endif %pre %sysusers_create_package %{name} %{S:4} %post %systemd_post coredns.service %tmpfiles_create_package %{name} %{S:5} %preun %systemd_preun coredns.service %postun %systemd_postun_with_restart coredns.service %files -f %{go_vendor_license_filelist} # CODE_OF_CONDUCT.md, CONTRIBUTING.md and SECURITY.md are symlinks into # .github/ upstream, so reference the targets to avoid shipping dangling links. %doc README.Fedora %doc ADOPTERS.md GOVERNANCE.md README.md plugin.md notes %doc .github/CODE_OF_CONDUCT.md .github/CONTRIBUTING.md .github/SECURITY.md %{_bindir}/coredns %{_unitdir}/coredns.service %{_sysusersdir}/coredns.conf %{_tmpfilesdir}/coredns.conf %dir %{_sysconfdir}/coredns %config(noreplace) %{_sysconfdir}/coredns/Corefile %dir %attr(0755,coredns,coredns) %{_sharedstatedir}/coredns %{_mandir}/man1/coredns.1* %{_mandir}/man5/corefile.5* %{_mandir}/man7/coredns-*.7* %changelog %autochangelog