[Build] Add packaging/version.txt 56/159956/1 4.0.1-preview1-00021
authorWonyoung Choi <wy80.choi@samsung.com>
Tue, 14 Nov 2017 02:18:59 +0000 (11:18 +0900)
committerWonyoung Choi <wy80.choi@samsung.com>
Tue, 14 Nov 2017 02:18:59 +0000 (11:18 +0900)
Change-Id: I0e8a92be1c53b2947f4659282899a69bb9f4f418

packaging/csapi-tizenfx.spec
packaging/csapi-tizenfx.spec.in
packaging/makespec.sh [new file with mode: 0755]
packaging/version.txt [new file with mode: 0644]

index 549ce55..b556e5c 100644 (file)
@@ -1,21 +1,18 @@
-# !! IMPORTANT !!
-# This packaging spec file is for developer testing only.
-# For Tizen release, the spec.in file should be used.
+# Auto-generated from csapi-tizenfx.spec.in by makespec.sh
+
+%define TIZEN_NET_API_VERSION 4
+%define TIZEN_NET_RPM_VERSION 4.0.1.999+nui61.3
+%define TIZEN_NET_NUGET_VERSION 4.0.1-preview1-99999
+%define TIZEN_NET_INTERNAL_NUGET_VERSION 4.0.1.999
 
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
 %define DOTNET_NUGET_SOURCE /nuget
 
-%define _tizenfx_bin_path Artifacts
-
-%define TIZEN_NET_API_VERSION 4
-%define TIZEN_NET_NUGET_VERSION 4.0.1-preview1-99999
-%define TIZEN_NET_INTERNAL_NUGET_VERSION 4.0.1.999
-
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
-Version:    99.99.99
+Version:    %{TIZEN_NET_RPM_VERSION}
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -23,15 +20,13 @@ URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
-BuildRequires: dotnet-build-tools
-
-BuildArch: noarch
+BuildArch:   noarch
 ExcludeArch: aarch64
 AutoReqProv: no
 
+BuildRequires: dotnet-build-tools
 Requires(post): vconf
 
-
 %description
 %{summary}
 
@@ -134,6 +129,8 @@ cp %{SOURCE1} .
 
 %build
 
+%define _tizenfx_bin_path Artifacts
+
 GetFileList() {
   PROFILE=$1
   cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
index 29f634d..71e6585 100644 (file)
@@ -1,17 +1,17 @@
+
+%define TIZEN_NET_API_VERSION @api_version@
+%define TIZEN_NET_RPM_VERSION @rpm_version@
+%define TIZEN_NET_NUGET_VERSION @nuget_version@
+%define TIZEN_NET_INTERNAL_NUGET_VERSION @internal_nuget_version@
+
 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
 %define DOTNET_NUGET_SOURCE /nuget
 
-%define _tizenfx_bin_path Artifacts
-
-%define TIZEN_NET_API_VERSION 4
-%define TIZEN_NET_NUGET_VERSION @nuget_version@
-%define TIZEN_NET_INTERNAL_NUGET_VERSION @internal_nuget_version@
-
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
-Version:    @rpm_version@
+Version:    %{TIZEN_NET_RPM_VERSION}
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -19,15 +19,13 @@ URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
-BuildRequires: dotnet-build-tools
-
-BuildArch: noarch
+BuildArch:   noarch
 ExcludeArch: aarch64
 AutoReqProv: no
 
+BuildRequires: dotnet-build-tools
 Requires(post): vconf
 
-
 %description
 %{summary}
 
@@ -130,6 +128,8 @@ cp %{SOURCE1} .
 
 %build
 
+%define _tizenfx_bin_path Artifacts
+
 GetFileList() {
   PROFILE=$1
   cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
diff --git a/packaging/makespec.sh b/packaging/makespec.sh
new file mode 100755 (executable)
index 0000000..d5edbb6
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+SCRIPT_FILE=$(readlink -f $0)
+SCRIPT_DIR=$(dirname $SCRIPT_FILE)
+
+VERSION_FILE=$SCRIPT_DIR/version.txt
+RPMSPEC=$SCRIPT_DIR/csapi-tizenfx.spec
+RPMSPEC_IN=$RPMSPEC.in
+
+source $VERSION_FILE
+
+while getopts ":r:n:i:" opt; do
+  case $opt in
+    r) RPM_VERSION=$OPTARG ;;
+    n) NUGET_VERSION=$OPTARG ;;
+    i) INTERNAL_NUGET_VERSION=$OPTARG ;;
+    :) echo "Option -$OPTARG requires an argument."; exit 1 ;;
+  esac
+done
+
+RPM_VERSION=$RPM_VERSION+$RPM_VERSION_SUFFIX
+
+# Update RPM Spec
+echo "# Auto-generated from $(basename $RPMSPEC_IN) by makespec.sh" | cat - $RPMSPEC_IN > $RPMSPEC
+sed -i -e "s/@api_version@/$API_VERSION/g" $RPMSPEC
+sed -i -e "s/@rpm_version@/$RPM_VERSION/g" $RPMSPEC
+sed -i -e "s/@nuget_version@/$NUGET_VERSION/g" $RPMSPEC
+sed -i -e "s/@internal_nuget_version@/$INTERNAL_NUGET_VERSION/g" $RPMSPEC
diff --git a/packaging/version.txt b/packaging/version.txt
new file mode 100644 (file)
index 0000000..34727c3
--- /dev/null
@@ -0,0 +1,10 @@
+# Tizen .NET API Level
+API_VERSION=4
+
+# Default Versions (will be replaced by CI)
+RPM_VERSION=4.0.1.999
+NUGET_VERSION=4.0.1-preview1-99999
+INTERNAL_NUGET_VERSION=4.0.1.999
+
+# RPM Version Suffix
+RPM_VERSION_SUFFIX=nui61.3