Apply %dotnet rpm macros
authorWonYoung Choi <wy80.choi@samsung.com>
Fri, 6 Jan 2017 01:09:00 +0000 (10:09 +0900)
committerKangho Hur <kangho.hur@samsung.com>
Fri, 24 Mar 2017 04:18:58 +0000 (13:18 +0900)
Change-Id: Ib9cf095ef710a65e6f5e219e83d0adab830edf8f

packaging/xamarin-forms-tizen.spec

index 7c44bc1..ca3fca4 100644 (file)
@@ -1,11 +1,3 @@
-%{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
-
-%if 0%{?tizen_build_devel_mode}
-%define BUILDCONF Debug
-%else
-%define BUILDCONF Release
-%endif
-
 %define XF_VERSION 2.3.3.175
 ## %define XF_PRETAG pre3
 
@@ -45,29 +37,28 @@ BuildRequires: elm-sharp-nuget
 Allows one to use portable controls subsets that are mapped to native
 controls of Android, iOS, Windows Phone, and Tizen.
 
+%dotnet_import_sub_packages
+
 %prep
 %setup -q
 cp %{SOURCE1} .
 
 %build
 # Restore NuGet Dependencies
-find . -name *.Tizen.project.json -print0 | xargs -n1 -0 nuget restore
+%dotnet_restore Xamarin.Forms.Platform.Tizen
+%dotnet_restore Xamarin.Forms.Maps.Tizen
 
 # Build
-xbuild Xamarin.Forms.Tizen.sln \
-    /p:Configuration=%{BUILDCONF} \
-    /p:PackageSources=/nuget
+%dotnet_build Xamarin.Forms.Tizen.sln /p:PackageSources=/nuget
 
 # Create NuGet Packages
-nuget pack .nuspec/Xamarin.Forms.Platform.Tizen.nuspec \
-    -BasePath ./.nuspec -Version %{NUPKG_VERSION} \
-    -Properties "Configuration=%{BUILDCONF}"
+%dotnet_pack .nuspec/Xamarin.Forms.Platform.Tizen.nuspec %{NUPKG_VERSION} "-BasePath ./.nuspec"
 
 %install
 function install_asm()
 {
   mkdir -p %{buildroot}%{dotnet_assembly_path}
-  install -p -m 644 $1/bin/%{BUILDCONF}/$1.dll %{buildroot}%{dotnet_assembly_path}
+  install -p -m 644 $1/bin/%{_dotnet_build_conf}/$1.dll %{buildroot}%{dotnet_assembly_path}
 }
 
 install_asm Xamarin.Forms.Core
@@ -81,15 +72,5 @@ install -p -m 644 *.nupkg %{buildroot}/nuget
 %files
 %manifest %{name}.manifest
 %license LICENSE
-%attr(644,root,root) %{dotnet_assembly_path}/*.dll
-
-%package nuget
-Summary:   NuGet package for %{name}
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-
-%description nuget
-NuGet package for %{name}
+%attr(644,root,root) %{dotnet_assembly_files}
 
-%files nuget
-/nuget/*.nupkg