[Build] Add RIDs of Tizen.6.0.0 and Set RIDs to vconf automatically (#1424)
authorJongHeonChoi <j-h.choi@samsung.com>
Tue, 10 Mar 2020 23:18:21 +0000 (08:18 +0900)
committerGitHub <noreply@github.com>
Tue, 10 Mar 2020 23:18:21 +0000 (08:18 +0900)
* [Build] Add RIDs of Tizen.6.0.0 and Set RIDs to vconf automatically

* Added to update RIDs with makerid.py

packaging/csapi-tizenfx.spec
packaging/csapi-tizenfx.spec.in
packaging/makerid.py [new file with mode: 0644]
packaging/makespec.sh
pkg/Tizen.NET/runtime.json

index 29a0714..db39db9 100644 (file)
@@ -10,6 +10,8 @@
 %define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
 %define DOTNET_NUGET_SOURCE /nuget
 
+%define TIZEN_NET_RUNTIME_IDENTIFIERS 4.0.0:5.0.0:5.5.0
+
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
 Version:    %{TIZEN_NET_RPM_VERSION}
@@ -182,6 +184,7 @@ install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
 %post
 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
+/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
 
 %files
 %license LICENSE
index 4a57610..2ea5198 100644 (file)
@@ -9,6 +9,8 @@
 %define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
 %define DOTNET_NUGET_SOURCE /nuget
 
+%define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
+
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
 Version:    %{TIZEN_NET_RPM_VERSION}
@@ -181,6 +183,7 @@ install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
 %post
 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
+/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
 
 %files
 %license LICENSE
diff --git a/packaging/makerid.py b/packaging/makerid.py
new file mode 100644 (file)
index 0000000..d6a5dca
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/python3
+
+import json
+import os
+
+scrpit_dir = os.path.dirname(os.path.abspath(__file__))
+runtime_dir = os.path.join(scrpit_dir, "../pkg/Tizen.NET/runtime.json")
+spec_dir = os.path.join(scrpit_dir, "csapi-tizenfx.spec")
+
+with open(runtime_dir) as json_file:
+    json_data = json.load(json_file)
+    json_string = json_data["runtimes"]
+
+    key_list = json_string.keys()
+    rid_list = []
+
+    for key in key_list:
+        key = key.replace("-armel", "")
+        key = key.replace("-x86", "")
+        key = key.replace("tizen.", "")
+        key = key.replace("tizen", "")
+        if key.strip():
+            rid_list.append(key)
+
+    rid_list = list(set(rid_list))
+    rid_list.sort()
+    
+    f = open(spec_dir,'r')
+    origin_data = f.read()
+    f.close()
+
+    new_data = origin_data.replace("@rid_version@", ':'.join(rid_list))
+
+    f = open(spec_dir, 'w')
+    f.write(new_data)
+    f.close()
index 6a57f61..7afceda 100755 (executable)
@@ -24,3 +24,6 @@ echo "# Auto-generated from $(basename $RPMSPEC_IN) by makespec.sh" | cat - $RPM
 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
+
+# Update RID
+$SCRIPT_DIR/makerid.py
index 8d5d3a0..1f5cd37 100644 (file)
@@ -67,6 +67,6 @@
         "tizen.5.5.0",
         "tizen.5.0.0-x86"
       ]
-    },
+    }
   }
 }