Merge packaging information to csproj
[platform/core/csapi/badge.git] / packaging / csapi-badge.spec
index 8fb1013..b36d469 100755 (executable)
@@ -1,15 +1,6 @@
-%{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
-%{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
-
-%if 0%{?tizen_build_devel_mode}
-%define BUILDCONF Debug
-%else
-%define BUILDCONF Release
-%endif
-
 Name:       csapi-badge
 Summary:    Tizen Badge API for C#
-Version:    1.0.0
+Version:    1.0.6
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -17,94 +8,37 @@ URL:        https://www.tizen.org
 Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
-# Mono
-BuildRequires: mono-compiler
-BuildRequires: mono-devel
-
-# .NETCore
-%if 0%{?_with_corefx}
 AutoReqProv: no
-BuildRequires: corefx-managed-32b-ref
-%endif
+ExcludeArch: aarch64
 
 BuildRequires: dotnet-build-tools
 
-# C# API Requries
-BuildRequires: csapi-tizen-devel
+# C# API Requires
+BuildRequires: csapi-tizen-nuget
+
+%define Assemblies Tizen.Applications.Badge
 
 %description
-Tizen Badge API for C#
+%{summary}
+
+%dotnet_import_sub_packages
 
 %prep
 %setup -q
 cp %{SOURCE1} .
 
-%define Assemblies Tizen.Applications.Badge
-
 %build
-# Build for Net45
 for ASM in %{Assemblies}; do
-if [ -e $ASM/$ASM.Net45.csproj ]; then
-  xbuild $ASM/$ASM.Net45.csproj \
-         /p:Configuration=%{BUILDCONF} \
-         /p:DotnetAssemblyPath=%{dotnet_assembly_path}/devel/net45 \
-         /p:OutputPath=bin/net45
-fi
-
-# Build for Dotnet
-%if 0%{?_with_corefx}
-if [ -e $ASM/$ASM.csproj ]; then
-  xbuild $ASM/$ASM.csproj \
-         /p:Configuration=%{BUILDCONF} \
-         /p:DotnetAssemblyPath=%{dotnet_assembly_path}/devel/netstandard1.6 \
-         /p:CoreFxPath=%{dotnet_core_path} \
-         /p:OutputPath=bin/netstandard1.6
-fi
-%endif
-
-# Make NuGet package
-dotnet-gbs pack $ASM/$ASM.nuspec --PackageVersion=%{version} --PackageFiles=$ASM/bin
-
+%dotnet_build $ASM
+%dotnet_pack $ASM
 done
 
 %install
-mkdir -p %{buildroot}%{dotnet_assembly_path}/devel
 for ASM in %{Assemblies}; do
-  cp -fr $ASM/bin/* %{buildroot}%{dotnet_assembly_path}/devel
-%if 0%{?_with_corefx}
-  install -p -m 644 $ASM/bin/netstandard1.6/$ASM.dll %{buildroot}%{dotnet_assembly_path}
-%else
-  install -p -m 644 $ASM/bin/net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
-%endif
+%dotnet_install $ASM
 done
 
-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 devel
-Summary:   Development package for %{name}
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-AutoReqProv: no
-
-%description devel
-Development package for %{name}
-
-%files devel
-%{dotnet_assembly_path}/devel/*
-
-%package nuget
-Summary:   NuGet package for %{name}
-Group:     Development/Libraries
-Requires:  %{name} = %{version}-%{release}
-
-%description nuget
-NuGet package for %{name}
-
-%files nuget
-/nuget/*.nupkg
+%attr(644,root,root) %{dotnet_assembly_files}