Fix code for building with corefx
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizen.spec
index 131f68c..ab45199 100644 (file)
@@ -1,4 +1,5 @@
 %{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly}
+%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
 
 %if 0%{?tizen_build_devel_mode}
 %define BUILDCONF Debug
@@ -20,9 +21,11 @@ Source1:    %{name}.manifest
 BuildRequires: mono-compiler
 BuildRequires: mono-devel
 
-# P/Invoke Build Requires
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(capi-base-common)
+# .NETCore
+%if 0%{?_with_corefx}
+AutoReqProv: no
+BuildRequires: corefx-managed-32b-ref
+%endif
 
 %description
 Tizen API for C#
@@ -36,22 +39,23 @@ cp %{SOURCE1} .
 %build
 for ASM in %{Assemblies}; do
 xbuild $ASM/$ASM.csproj \
+%if 0%{?_with_corefx}
+        /p:NoStdLib=True \
+        /p:TargetFrameworkVersion=v5.0 \
+        /p:AddAdditionalExplicitAssemblyReferences=False \
+        /p:CoreFxPath=%{dotnet_core_path} \
+%endif
         /p:Configuration=%{BUILDCONF} \
         /p:ReferencePath=%{dotnet_assembly_path}
 done
 
 %install
-# Assemblies
 mkdir -p %{buildroot}%{dotnet_assembly_path}
 for ASM in %{Assemblies}; do
 install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
 done
 
-# License
-mkdir -p %{buildroot}%{_datadir}/license
-cp LICENSE %{buildroot}%{_datadir}/license/%{name}
-
 %files
 %manifest %{name}.manifest
+%license LICENSE
 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
-%attr(644,root,root) %{_datadir}/license/%{name}