From 694c4b04dbf916026f3217fbbcf04499e2aaa1f9 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 7 Oct 2022 10:08:46 -0400 Subject: [PATCH] Remove debbuild macros and depend on containers-common-extra Signed-off-by: Lokesh Mandvekar --- podman.spec | 73 ++++++++++++----------------------------------------- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/podman.spec b/podman.spec index ad0b408..53a2781 100644 --- a/podman.spec +++ b/podman.spec @@ -1,15 +1,3 @@ -%if "%{_vendor}" == "debbuild" -%global _unitdir %{_usr}/lib/systemd/system -%global _userunitdir %{_usr}/lib/systemd/user -%global _tmpfilesdir %{_usr}/lib/tmpfiles.d -# Older distros don't work yet -%if (0%{?debian} && 0%{?debian} <= 11) || (0%{?ubuntu} && 0%{?ubuntu} < 2204) -%define gobuild(o:) GO111MODULE=off %{_prefix}/lib/go-1.16/bin/go build -buildmode pie -tags=" ${BUILDTAGS:-}" -a -v -x %{?**}; -%else -%define gobuild(o:) GO111MODULE=off go build -buildmode pie -tags=" ${BUILDTAGS:-}" -a -v -x %{?**}; -%endif -%endif - %global with_debug 1 %if 0%{?with_debug} @@ -41,62 +29,32 @@ %global git_gvproxy https://%{import_path_gvproxy} %global commit_gvproxy fdc231ae7b8fe1aec4cf0b8777274fa21b70d789 -%global built_tag_strip 4.3.0-rc1 +%global built_tag v4.3.0-rc1 +%global built_tag_strip %(b=%{built_tag}; echo ${b:1}) +%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"}) Name: podman Epoch: 4 -Version: 4.3.0~rc1 -%if "%{_vendor}" == "debbuild" -Packager: Podman Debbuild Maintainers -License: ASL-2.0+ and BSD and ISC and MIT and MPLv2.0 -Release: 0%{?dist} -%else +Version: %{gen_version} License: ASL 2.0 and BSD and ISC and MIT and MPLv2.0 Release: %autorelease ExclusiveArch: %{golang_arches} -%endif Summary: Manage Pods, Containers and Container Images URL: https://%{name}.io/ -Source0: %{git0}/archive/v%{built_tag_strip}.tar.gz +# All SourceN files fetched from upstream +Source0: %{git0}/archive/%{built_tag}.tar.gz Source1: %{git_plugins}/archive/%{commit_plugins}/%{repo_plugins}-%{commit_plugins}.tar.gz Source2: %{git_gvproxy}/archive/%{commit_gvproxy}/%{repo_gvproxy}-%{commit_gvproxy}.tar.gz Provides: %{name}-manpages = %{epoch}:%{version}-%{release} BuildRequires: go-md2man -Requires: catatonit -Requires: iptables -Requires: nftables -%if "%{_vendor}" == "debbuild" -BuildRequires: git -BuildRequires: libassuan-dev -BuildRequires: libglib2.0-dev -BuildRequires: libgpg-error-dev -BuildRequires: libgpgme-dev -BuildRequires: libseccomp-dev -BuildRequires: libsystemd-dev -BuildRequires: pkg-config -%if (0%{?debian} && 0%{?debian} <= 11) || (0%{?ubuntu} && 0%{?ubuntu} < 2204) -BuildRequires: golang-1.16 -BuildRequires: libc6 < 2.32 -%else -BuildRequires: golang -BuildRequires: libc6 -%endif -Requires: conmon >= 2:2.0.30 -Requires: containers-common >= 4:1 -Requires: uidmap -%else -%if ! 0%{?centos} BuildRequires: btrfs-progs-devel -%endif BuildRequires: gcc BuildRequires: glib2-devel BuildRequires: glibc-devel BuildRequires: glibc-static BuildRequires: golang BuildRequires: git-core -%if 0%{?fedora} || 0%{?rhel} >= 9 BuildRequires: go-rpm-macros -%endif BuildRequires: gpgme-devel BuildRequires: libassuan-devel BuildRequires: libgpg-error-devel @@ -108,12 +66,18 @@ BuildRequires: make BuildRequires: ostree-devel BuildRequires: systemd BuildRequires: systemd-devel +Requires: catatonit Requires: conmon >= 2:2.0.30-2 -Requires: containers-common >= 4:1-46 -Requires: netavark >= 1.0.3-1 +%if 0%{?fedora} > 37 +Requires: containers-common-extra >= 4:1-78 +%else +%if 0%{?fedora} == 37 +Requires: containers-common-extra >= 4:1-73 +%else +Requires: containers-common-extra >= 4:1-62 +%endif +%endif Recommends: %{name}-gvproxy = %{epoch}:%{version}-%{release} -Suggests: containernetworking-plugins >= 0.9.1-1 -Suggests: qemu-user-static # vendored libraries # awk '{print "Provides: bundled(golang("$1")) = "$2}' go.mod | sort | uniq | sed -e 's/-/_/g' -e '/bundled(golang())/d' -e '/bundled(golang(go\|module\|replace\|require))/d' Provides: bundled(golang(github.com/BurntSushi/toml)) = v1.1.0 @@ -173,7 +137,6 @@ Provides: bundled(golang(github.com/uber/jaeger_client_go)) = v2.30.0+incompatib Provides: bundled(golang(github.com/ulikunitz/xz)) = v0.5.10 Provides: bundled(golang(github.com/vbauerster/mpb/v7)) = v7.4.2 Provides: bundled(golang(github.com/vishvananda/netlink)) = v1.1.1_0.20220115184804_dd687eb2f2d4 -%endif %description %{name} (Pod Manager) is a fully featured container engine that is a simple @@ -270,7 +233,6 @@ tar zxf %{SOURCE1} tar zxf %{SOURCE2} %build -%if "%{_vendor}" != "debbuild" %set_build_flags export CGO_CFLAGS=$CFLAGS # These extra flags present in $CFLAGS have been skipped for now as they break the build @@ -281,7 +243,6 @@ CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-an %ifarch x86_64 export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full" %endif -%endif export GO111MODULE=off export GOPATH=$(pwd)/_build:$(pwd) @@ -428,6 +389,4 @@ rm -f %{buildroot}%{_datadir}/user-tmpfiles.d/%{name}-docker.conf %{_libexecdir}/%{name}/gvproxy %changelog -%if "%{_vendor}" != "debbuild" %autochangelog -%endif