From 9a4372d544a2b6438717a42899bb2b881dffc0eb Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Jul 04 2019 14:29:54 +0000 Subject: build 1.4.4 for centos re-add centos conditionals This reverts commit 4a519ff85c09f11c02189ab19e0a96b357483cd9. Signed-off-by: Lokesh Mandvekar --- diff --git a/podman.spec b/podman.spec index dc9b2ae..4ed5f81 100644 --- a/podman.spec +++ b/podman.spec @@ -1,12 +1,15 @@ -%{?python_enable_dependency_generator} %global with_devel 0 %global with_bundled 1 %global with_debug 1 %global with_check 0 %global with_unit_test 0 +%if 0%{?fedora} %bcond_without varlink %define gogenerate go generate +%else +%bcond_with varlink +%endif %if 0%{?with_debug} %global _find_debuginfo_dwz_opts %{nil} @@ -15,6 +18,11 @@ %global debug_package %{nil} %endif +%if ! 0%{?gobuild:1} +%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**}; +%define gogenerate go generate +%endif + %global provider github %global provider_tld com %global project containers @@ -32,7 +40,9 @@ %global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7}) Name: podman +%if 0%{?fedora} Epoch: 2 +%endif # fedora Version: 1.4.4 Release: 1%{?dist} Summary: Manage Pods, Containers and Container Images @@ -58,16 +68,25 @@ BuildRequires: pkgconfig BuildRequires: make BuildRequires: systemd BuildRequires: systemd-devel -Requires: runc >= 2:1.0.0-57 Requires: containers-common Requires: containernetworking-plugins >= 0.7.5-1 Requires: iptables Requires: nftables +%if 0%{?fedora} Recommends: %{name}-manpages = %{epoch}:%{version}-%{release} Recommends: container-selinux Recommends: slirp4netns >= 0.3.0-2 Recommends: fuse-overlayfs >= 0.3-8 Recommends: libvarlink-util >= 18-1 +Requires: runc >= 2:1.0.0-57 +%else +#### DO NOT REMOVE - NEEDED FOR CENTOS +Requires: %{name}-manpages = %{version}-%{release} +Requires: container-selinux +Requires: slirp4netns >= 0.3.0-2 +Requires: runc >= 1.0.0-57 +%endif #fedora + # vendored libraries # awk '{print "Provides: bundled(golang("$1")) = "$2}' vendor.conf | sort @@ -182,7 +201,12 @@ Provides: bundled(golang(k8s.io/utils)) = 258e2a2fa64568210fbd6267cf1d8fd87c3cb8 %package docker Summary: Emulate Docker CLI using %{name} BuildArch: noarch +%if 0%{?fedora} Requires: %{name} = %{epoch}:%{version}-%{release} +%else +#### DO NOT REMOVE - NEEDED FOR CENTOS +Requires: %{name} = %{version}-%{release} +%endif # fedora Conflicts: docker Conflicts: docker-latest Conflicts: docker-ce @@ -201,9 +225,8 @@ BuildArch: noarch %description manpages Man pages for the %{name} commands -%files manpages -%{_mandir}/man1/%{name}*.1* - +#### DO NOT REMOVE - NEEDED FOR CENTOS +%if 0%{?fedora} %package remote Summary: (Experimental) Remote client for managing %{name} containers Recommends: %{name}-manpages = %{epoch}:%{version}-%{release} @@ -217,6 +240,7 @@ run %{name}-remote in production. %{name}-remote uses the varlink connection to connect to a %{name} client to manage pods, containers and container images. %{name}-remote supports ssh connections as well. +%endif #fedora %if 0%{?with_devel} %package devel @@ -378,9 +402,9 @@ This package contains unit tests for project providing packages with %{import_path} prefix. %endif +%if 0%{?fedora} %package tests Summary: Tests for %{name} - Requires: %{name} = %{epoch}:%{version}-%{release} Requires: bats Requires: jq @@ -389,6 +413,7 @@ Requires: jq %{summary} This package contains system tests for %{name} +%endif # fedora %prep %autosetup -Sgit -n %{repo}-%{commit0} @@ -405,18 +430,25 @@ popd ln -s vendor src export GOPATH=$(pwd)/_build:$(pwd) -export GO111MODULE=off +%if 0%{?fedora} %gogenerate ./cmd/%{name}/varlink/... +%endif # fedora # build %%{name} +%if 0%{?fedora} export BUILDTAGS="systemd varlink seccomp exclude_graphdriver_devicemapper $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) $(hack/ostree_tag.sh) $(hack/selinux_tag.sh)" -export GO111MODULE=off +%else +#### DO NOT REMOVE - NEEDED FOR CENTOS +export GO111MODULE=off +export BUILDTAGS="systemd seccomp exclude_graphdriver_devicemapper $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) $(hack/ostree_tag.sh) $(hack/selinux_tag.sh)" +%endif # fedora %gobuild -o bin/%{name} %{import_path}/cmd/%{name} +%if 0%{?fedora} # build %%{name}-remote export BUILDTAGS="remoteclient systemd varlink seccomp exclude_graphdriver_devicemapper $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) $(hack/ostree_tag.sh) $(hack/selinux_tag.sh)" -export GO111MODULE=off %gobuild -o bin/%{name}-remote %{import_path}/cmd/%{name} +%endif # fedora # build conmon pushd conmon-%{commit_conmon} @@ -427,7 +459,9 @@ popd install -dp %{buildroot}%{_unitdir} PODMAN_VERSION=%{version} %{__make} PREFIX=%{buildroot}%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} \ install.bin \ +%if 0%{?fedora} install.remote \ +%endif # fedora install.man \ install.cni \ install.systemd \ @@ -510,8 +544,10 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %gotest %{import_path}/pkg/registrar %endif +%if 0%{?fedora} install -d -p %{buildroot}/%{_datadir}/%{name}/test/system cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/ +%endif # fedora %triggerpostun -- %{name} < 1.1 %{_bindir}/%{name} system renumber @@ -554,12 +590,18 @@ exit 0 %doc README.md CONTRIBUTING.md pkg/hooks/README-hooks.md install.md code-of-conduct.md transfer.md %endif +%files manpages +%{_mandir}/man1/%{name}*.1* + +#### DO NOT REMOVE - NEEDED FOR CENTOS +%if 0%{?fedora} %files remote %{_bindir}/%{name}-remote %files tests %license LICENSE %{_datadir}/%{name}/test +%endif # fedora %changelog * Tue Jul 02 2019 bbaude - 2:1.4.4-1