%global debug_package %{nil} %global rpm_version %(rpm --version | awk '{print $3}') Name: rpmtool Version: 0.5.1 Release: 1%{?dist} Summary: A CLI for rpm packages. License: GPL-2.0 URL: https://github.com/ps-gill/rpmtool Source0: https://github.com/ps-gill/rpmtool/archive/refs/tags/v%{version}.tar.gz ExclusiveArch: x86_64 BuildRequires: git BuildRequires: golang-bin BuildRequires: rpm BuildRequires: rpm-devel Requires: dnf-plugins-core Requires: rpm Requires: rpm-build-libs Requires: rpm-libs Requires: rpm-sign-libs Requires: sequoia-sq Conflicts: python3-rpmtool %description A CLI for rpm packages. %prep %autosetup -n %{name}-%{version} %build %if "%{rpm_version}" < "4.20.0" export CGO_CFLAGS="${CGO_CFLAGS:+$CGO_CFLAGS }-DRPMTOOL_LEGACY" %endif go build %install install --mode=0755 -D rpmtool %{buildroot}%{_bindir}/rpmtool %files %doc README.md %license LICENSE %{_bindir}/rpmtool %changelog %autochangelog