2ccbb9de1e73db0d308806321460d96ec56fe1cd
[platform/core/csapi/tizenfx.git] / packaging / csapi-maps.spec
1 %{!?dotnet_assembly_path: %define dotnet_assembly_path /opt/usr/share/dotnet.tizen/framework}
2
3 %if 0%{?tizen_build_devel_mode}
4 %define BUILDCONF Debug
5 %else
6 %define BUILDCONF Release
7 %endif
8
9 Name:       csapi-maps
10 Summary:    Tizen Map Service API for C#
11 Version:    1.0.8
12 Release:    1
13 Group:      Development/Libraries
14 License:    Apache-2.0
15 URL:        https://www.tizen.org
16 Source0:    %{name}-%{version}.tar.gz
17 Source1:    %{name}.manifest
18
19 AutoReqProv: no
20 ExcludeArch: aarch64
21
22 BuildRequires: mono-compiler
23 BuildRequires: mono-devel
24
25 BuildRequires: dotnet-build-tools
26 BuildRequires: csapi-tizen-nuget
27 BuildRequires: elm-sharp-nuget
28
29 %description
30 Tizen Map Service API for C#
31
32 %prep
33 %setup -q
34 cp %{SOURCE1} .
35
36 %define Assemblies Tizen.Maps
37
38 %build
39 for ASM in %{Assemblies}; do
40 # NuGet Restore
41 find $ASM/*.project.json -exec nuget restore {} \;
42 # Build
43 find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
44 # NuGet Pack
45 nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
46 done
47
48 %install
49 # Runtime Binary
50 mkdir -p %{buildroot}%{dotnet_assembly_path}
51 mkdir -p %{buildroot}%{dotnet_assembly_path}/res
52 for ASM in %{Assemblies}; do
53 %if 0%{?_with_corefx}
54   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
55 %else
56   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
57 %endif
58   install -p -m 644 $ASM/res/*.png %{buildroot}%{dotnet_assembly_path}/res
59 done
60 # NuGet
61 mkdir -p %{buildroot}/nuget
62 install -p -m 644 *.nupkg %{buildroot}/nuget
63
64 %files
65 %manifest %{name}.manifest
66 %license LICENSE
67 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
68 %attr(644,root,root) %{dotnet_assembly_path}/res/*.png
69
70 %package nuget
71 Summary:   NuGet package for %{name}
72 Group:     Development/Libraries
73
74 %description nuget
75 NuGet package for %{name}
76
77 %files nuget
78 /nuget/*.nupkg