%define DOTNET_NUGET_SOURCE /nuget
%define TIZEN_NET_RUNTIME_IDENTIFIERS 4.0.0:5.0.0:5.5.0:6.0.0
+%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS tizen80:tizen70:tizen60:tizen50:tizen40:netstandard2.0
Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
/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
+/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
%files
%license LICENSE
%define DOTNET_NUGET_SOURCE /nuget
%define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
+%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS @tfm_support@
Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
/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
+/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
%files
%license LICENSE
# Update RID
python $SCRIPT_DIR/makerid.py
+
+# Update TFM
+python $SCRIPT_DIR/maketfm.py
--- /dev/null
+import os
+import xml.etree.ElementTree as ET
+
+scrpit_dir = os.path.dirname(os.path.abspath(__file__))
+spec_dir = os.path.join(scrpit_dir, "csapi-tizenfx.spec")
+tree = ET.parse("../pkg/Tizen.NET/Tizen.NET.nuspec")
+root = tree.getroot()
+
+tfm_list = []
+for meta_child in root.iter():
+ if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
+ for depen_child in meta_child:
+ if depen_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}dependencies":
+ for group in depen_child:
+ tfm = group.attrib["targetFramework"].lower()
+ tfm = tfm.replace(".", "")
+ tfm = tfm.replace("20", "2.0")
+ if tfm.strip():
+ tfm_list.append(tfm)
+
+tfm_list = list(set(tfm_list))
+tfm_list.sort(reverse=True)
+
+f = open(spec_dir,'r')
+origin_data = f.read()
+f.close()
+
+new_data = origin_data.replace("@tfm_support@", ':'.join(tfm_list))
+
+f = open(spec_dir, 'w')
+f.write(new_data)
+f.close()