From 3ef272983c95e2591a15eaf771125681fc05a79f Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mar 23 2017 14:06:31 +0000 Subject: appropriate NVR string for `docker version` When docker is built as an rpm using the spec file, `docker version` will display the appropriate NVR of the rpm. If docker is built via ways other than the spec file, `docker version` will display "" Signed-off-by: Lokesh Mandvekar --- diff --git a/docker.spec b/docker.spec index 5b48868..88048dd 100644 --- a/docker.spec +++ b/docker.spec @@ -126,6 +126,7 @@ Source23: %{git11}/archive/%{commit11}/tini-%{shortcommit11}.tar.gz #Patch0: build-with-debug-info.patch %endif +BuildRequires: sed BuildRequires: git BuildRequires: cmake BuildRequires: glibc-static @@ -573,6 +574,11 @@ tar zxf %{SOURCE23} %build # set up temporary build gopath, and put our directory there mkdir _build + +%global version_tag %{name}-%{version}-%{release}.%{_arch} +%{__sed} -r -i 's/^([\t ]*PkgVersion:[\t ]*)"",$/\1"%{version_tag}",/' daemon/info.go +%{__sed} -r -i 's/^([\t ]*PkgVersion:[\t ]*)"",$/\1"%{version_tag}",/' api/client/system/version.go + pushd _build mkdir -p src/%{provider}.%{provider_tld}/{%{repo},projectatomic} ln -s $(dirs +1 -l) src/%{import_path}