From d4f1452cd662c039625c2a7bf3337c5cf6dc1f39 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Mon, 19 Dec 2016 16:21:39 +0900 Subject: [PATCH] Apply dotnet RPM macros Change-Id: I2d477725f5a544741275f85b5474be233f2ac524 --- packaging/csapi-tizen.spec | 68 +++++++--------------------------------------- 1 file changed, 10 insertions(+), 58 deletions(-) diff --git a/packaging/csapi-tizen.spec b/packaging/csapi-tizen.spec index 9834ef7..cbacadf 100644 --- a/packaging/csapi-tizen.spec +++ b/packaging/csapi-tizen.spec @@ -1,12 +1,3 @@ -%{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework} -%{!?mono_assembly_path: %define mono_assembly_path /opt/usr/lib/assembly} - -%if 0%{?tizen_build_devel_mode} -%define BUILDCONF Debug -%else -%define BUILDCONF Release -%endif - Name: csapi-tizen Summary: Tizen API for C# Version: 1.0.2 @@ -17,72 +8,33 @@ URL: https://www.tizen.org Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest -AutoReqProv: no -ExcludeArch: aarch64 %ix86 +BuildRequires: dotnet-build-tools -BuildRequires: mono-compiler -BuildRequires: mono-devel +%define Assemblies Tizen -BuildRequires: dotnet-build-tools +%dotnet_import_common %description -Tizen API for C# +%{summary} + +%dotnet_import_sub_packages %prep %setup -q cp %{SOURCE1} . -%define Assemblies Tizen - %build for ASM in %{Assemblies}; do -# NuGet Restore -find $ASM/*.project.json -exec nuget restore {} \; -# Build -find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \; -# NuGet Pack -nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF} +%dotnet_build $ASM +%dotnet_pack $ASM/$ASM.nuspec %{version} done %install -# Runtime Binary -mkdir -p %{buildroot}%{dotnet_assembly_path} -mkdir -p %{buildroot}%{mono_assembly_path} for ASM in %{Assemblies}; do -%if 0%{?_with_corefx} - install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path} -%else - install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path} -%endif -install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{mono_assembly_path} +%dotnet_install $ASM done -# NuGet -mkdir -p %{buildroot}/nuget -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 - -%description nuget -NuGet package for %{name} - -%files nuget -/nuget/*.nupkg - -%package mono -Summary: %{name} for Mono Runtime -Group: Development/Libraries - -%description mono -%{name} for Mono Runtime - -%files mono -%manifest %{name}.manifest -%license LICENSE -%attr(644,root,root) %{mono_assembly_path}/*.dll +%attr(644,root,root) %{dotnet_assembly_files} -- 2.7.4