From 0234e54eee559ba9f9014a84673143ffb7a745b2 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Jun 10 2019 13:10:41 +0000 Subject: buildable on centos, deps updated Signed-off-by: Lokesh Mandvekar --- diff --git a/podman.spec b/podman.spec index 0bdd358..7bbff70 100644 --- a/podman.spec +++ b/podman.spec @@ -19,6 +19,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 @@ -36,13 +41,9 @@ %global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7}) Name: podman -# Epoch is 2 for f30 (rawhide), 1 for f28 and f29 -# BEWARE while using on other distros -%if 0%{?fedora} >= 30 +%if 0%{?fedora} Epoch: 2 -%else -Epoch: 1 -%endif +%endif # fedora Version: 1.4.0 Release: 1%{?dist} Summary: Manage Pods, Containers and Container Images @@ -50,9 +51,6 @@ License: ASL 2.0 URL: https://%{name}.io/ Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz Source1: %{git_conmon}/archive/%{commit_conmon}/conmon-%{shortcommit_conmon}.tar.gz -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -#ExclusiveArch: %%{?go_arches:%%{go_arches}}%%{!?go_arches:%%{ix86} x86_64 aarch64 %%{arm}} -ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: btrfs-progs-devel @@ -70,15 +68,23 @@ BuildRequires: ostree-devel 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 Recommends: fuse-overlayfs >= 0.3-8 +%else +Requires: %{name}-manpages = %{epoch}:%{version}-%{release} +Requires: container-selinux +Requires: slirp4netns >= 0.3-0 +%endif #fedora + # vendored libraries # awk '{print "Provides: bundled(golang("$1")) = "$2}' vendor.conf | sort @@ -212,6 +218,7 @@ BuildArch: noarch %description manpages Man pages for the %{name} commands +%if 0%{?fedora} %package remote Summary: (Experimental) Remote client for managing %{name} containers Recommends: %{name}-manpages = %{epoch}:%{version}-%{release} @@ -225,6 +232,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 @@ -412,15 +420,24 @@ ln -s ../../../../ src/%{import_path} popd ln -s vendor src export GOPATH=$(pwd)/_build:$(pwd) + +%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)" +%else +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="rmeoteclient 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 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)" %gobuild -o bin/%{name}-remote %{import_path}/cmd/%{name} +%endif # fedora # build conmon pushd conmon-%{commit_conmon} @@ -431,7 +448,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 \ @@ -518,6 +537,10 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} install -d -p %{buildroot}/%{_datadir}/%{name}/test/system cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/ +%triggerpostun -- %{name} < 1.1 +%{_bindir}/%{name} system renumber +exit 0 + #define license tag if not already defined %{!?_licensedir:%global license %doc} @@ -560,12 +583,10 @@ cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/ %files manpages %{_mandir}/man1/%{name}*.1* +%if 0%{?fedora} %files remote %{_bindir}/%{name}-remote - -%triggerpostun -- %{name} < 1.1 -%{_bindir}/%{name} system renumber -exit 0 +%endif # fedora %files tests %license LICENSE