# COPR spec for dog (https://copr.fedorainfracloud.org/coprs/kentobias/dog/). # # Rendered by scripts/render_packaging.py from packaging/copr/dog.spec when .copr/Makefile builds # the SRPM: Version: and the %changelog entry come from Cargo.toml in the checkout COPR cloned, so # nothing in the repository records a release. Recording one is the mistake: it would have to be # bumped by hand after every tag, and a stale value builds the wrong release without any error. # # Source0 is a LOCAL tarball that .copr/Makefile builds from that checkout, not a tag URL, so # a PR can build its own SRPM and the package is the code COPR actually cloned. # # Written for COPR with "Enable internet access during builds" ON, so `cargo build` resolves # crates.io at build time and there is no vendor tarball. Two consequences, both deliberate: # 1. --locked is load-bearing. With network access and no vendoring it is the only thing # pinning what gets resolved to what CI tested. Never drop it. # 2. This will NOT build in koji. Fedora proper requires offline builds, so shipping there # would need a vendor tarball as Source1. COPR is the endpoint. Name: dog Version: 0.8.0 Release: 1%{?dist} Summary: Command-line DNS client with colourful output, DoT, DoH and JSON License: GPL-3.0-or-later URL: https://github.com/l1a/dog Source0: %{name}-%{version}.tar.gz ExclusiveArch: x86_64 aarch64 BuildRequires: cargo BuildRequires: rust BuildRequires: gcc # The man page is written in Markdown (man/dog.1.md) and rendered here, not committed. BuildRequires: pandoc %description dog is a command-line DNS client, like dig but friendlier. It prints colourful, readable output, takes simple arguments (dog example.com MX @1.1.1.1), speaks DNS over UDP, TCP, TLS and HTTPS, can emit JSON, and knows 35 record types, including HTTPS, SVCB, TLSA and the DNSSEC types. %prep %autosetup -n %{name}-%{version} %build # Keep cargo's state inside the build tree rather than $HOME. export CARGO_HOME=%{_builddir}/cargo-home # Fedora's own rustc flags, from rust-srpm-macros. They carry -Cdebuginfo=2 -Cstrip=none, which # is what makes rpm's debuginfo extraction work: without them a Rust release build has no DWARF # and the build fails on an empty debuginfo package. This is not a debug build; -Copt-level=3 is # in there, and rpm moves the symbols into -debuginfo and strips the main package. # # Deliberately NOT %%cargo_prep/%%cargo_build: those assume Fedora's offline, vendored workflow # and write a cargo config with offline = true, which would fight this network-enabled build. export RUSTFLAGS="%{build_rustflags}" cargo build --release --locked # The same substitution `just man` does; man/dog.1.md carries a literal VERSION placeholder. sed 's/{{VERSION}}/%{version}/g' man/dog.1.md | pandoc --standalone -f markdown -t man > dog.1 %install # Not stripped here: rpm's own pass extracts the symbols into the debuginfo subpackage first. install -Dpm0755 target/release/dog %{buildroot}%{_bindir}/dog install -Dpm0644 dog.1 %{buildroot}%{_mandir}/man1/dog.1 # Generated by the binary just built, so they cannot disagree with the actual CLI. Safe because # COPR builds each architecture natively; a cross-build would need a host binary. install -d %{buildroot}%{bash_completions_dir} install -d %{buildroot}%{zsh_completions_dir} install -d %{buildroot}%{fish_completions_dir} target/release/dog --completions bash > %{buildroot}%{bash_completions_dir}/dog target/release/dog --completions zsh > %{buildroot}%{zsh_completions_dir}/_dog target/release/dog --completions fish > %{buildroot}%{fish_completions_dir}/dog.fish %check export CARGO_HOME=%{_builddir}/cargo-home # Hermetic: the suite parses arguments and renders output; it makes no DNS queries. cargo test --release --locked %files %license LICENSE %doc README.md %{_bindir}/dog # The glob is load-bearing: rpm compresses man pages on install, so the packaged path is # dog.1.gz, and asserting the uncompressed name reports it missing when it is present. %{_mandir}/man1/dog.1* %{bash_completions_dir}/dog %{zsh_completions_dir}/_dog %{fish_completions_dir}/dog.fish %changelog * Mon Oct 26 2026 Ken Tobias <634380+l1a@users.noreply.github.com> - 0.8.0-1 - Release 0.8.0: https://github.com/l1a/dog/releases/tag/v0.8.0