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