acrn-hypervisor: Autospec creation for version 2018w32.3.140000p

This commit is contained in:
Miguel Bernal Marin 2018-08-08 11:39:12 -05:00
parent 47a075a106
commit 77a000544b
4 changed files with 94 additions and 5 deletions

View File

@ -0,0 +1,85 @@
From 49e4eed64f703fef287bae3d302841e1050fd7a1 Mon Sep 17 00:00:00 2001
From: Wei Liu <weix.w.liu@intel.com>
Date: Mon, 6 Aug 2018 10:09:27 +0800
Subject: [PATCH] DM: add tag info while no repo in release
there is no git repo, which download from github release,
however, acrn-dm -v will get tag info from this repo, in
such case, the tag info was null.
this patch will fix nul tag, which get it from CL mock build.
Tracked-On: #676
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
---
Makefile | 4 +++-
devicemodel/Makefile | 21 ++++++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 7c3e073..c0e0215 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,8 @@ DM_OUT := $(ROOT_OUT)/devicemodel
TOOLS_OUT := $(ROOT_OUT)/tools
MISC_OUT := $(ROOT_OUT)/misc
DOC_OUT := $(ROOT_OUT)/doc
+BUILD_VERSION ?=
+BUILD_TAG ?=
export TOOLS_OUT
.PHONY: all hypervisor devicemodel tools misc doc
@@ -27,7 +29,7 @@ sbl-hypervisor:
devicemodel: tools
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean
- make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT)
+ make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG)
tools:
mkdir -p $(TOOLS_OUT)
diff --git a/devicemodel/Makefile b/devicemodel/Makefile
index 314f21f..a72b5b2 100644
--- a/devicemodel/Makefile
+++ b/devicemodel/Makefile
@@ -5,6 +5,8 @@ include ../VERSION
FULL_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)$(EXTRA_VERSION)
BASEDIR := $(shell pwd)
DM_OBJDIR ?= $(CURDIR)/build
+DM_BUILD_VERSION ?=
+DM_BUILD_TAG ?=
CC ?= gcc
@@ -154,16 +156,21 @@ distclean:
include/version.h:
touch include/version.h
- @COMMIT=`git rev-parse --verify --short HEAD 2>/dev/null`;\
- DIRTY=`git diff-index --name-only HEAD`;\
- if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
- DAILY_TAG=`git tag --merged HEAD|grep "acrn"|tail -n 1`;\
+ if [ "$(DM_BUILD_VERSION)"x = x -o "$(DM_BUILD_TAG)"x = x ];then\
+ COMMIT=`git rev-parse --verify --short HEAD 2>/dev/null`;\
+ DIRTY=`git diff-index --name-only HEAD`;\
+ if [ -n "$$DIRTY" ];then PATCH="$$COMMIT-dirty";else PATCH="$$COMMIT";fi;\
+ DAILY_TAG=`git tag --merged HEAD|grep "acrn"|tail -n 1`;\
+ else\
+ PATCH=$(DM_BUILD_VERSION);\
+ DAILY_TAG=$(DM_BUILD_TAG);\
+ fi;\
TIME=`date "+%Y-%m-%d %H:%M:%S"`;\
USER=`id -u -n`; \
echo "/*" > include/version.h; \
- sed 's/^/ * /' ../LICENSE >> include/version.h; \
- echo " */" >> include/version.h; \
- echo "" >> include/version.h; \
+ sed 's/^/ * /' ../LICENSE >> include/version.h;\
+ echo " */" >> include/version.h;\
+ echo "" >> include/version.h;\
echo "#define DM_MAJOR_VERSION $(MAJOR_VERSION)" >> include/version.h;\
echo "#define DM_MINOR_VERSION $(MINOR_VERSION)" >> include/version.h;\
echo "#define DM_EXTRA_VERSION "\"$(EXTRA_VERSION)\""" >> include/version.h;\
--
2.18.0

View File

@ -5,7 +5,7 @@
%define keepstatic 1
Name : acrn-hypervisor
Version : 2018w32.3.140000p
Release : 60
Release : 61
URL : https://github.com/projectacrn/acrn-hypervisor/archive/acrn-2018w32.3-140000p.tar.gz
Source0 : https://github.com/projectacrn/acrn-hypervisor/archive/acrn-2018w32.3-140000p.tar.gz
Summary : No detailed summary available
@ -38,6 +38,7 @@ BuildRequires : telemetrics-client-dev
# Suppress stripping binaries
%define __strip /bin/true
%define debug_package %{nil}
Patch1: 0001-DM-add-tag-info-while-no-repo-in-release.patch
%description
This directory contains configuration files to ignore errors found in
@ -100,17 +101,19 @@ license components for the acrn-hypervisor package.
%prep
%setup -q -n acrn-hypervisor-acrn-2018w32.3-140000p
%patch1 -p1
%build
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost,127.0.0.1,0.0.0.0
export LANG=C
export SOURCE_DATE_EPOCH=1533720813
make %{?_smp_mflags} all sbl-hypervisor
export SOURCE_DATE_EPOCH=1533746342
make %{?_smp_mflags} all sbl-hypervisor BUILD_VERSION=”%{version}_%{release}” BUILD_TAG=”%{version}” \
-
%install
export SOURCE_DATE_EPOCH=1533720813
export SOURCE_DATE_EPOCH=1533746342
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/share/doc/acrn-hypervisor
cp LICENSE %{buildroot}/usr/share/doc/acrn-hypervisor/LICENSE

View File

@ -1 +1 @@
60
61

1
series Normal file
View File

@ -0,0 +1 @@
0001-DM-add-tag-info-while-no-repo-in-release.patch