24a658af5cc7d34b540da65cff81355a6f01630e
[platform/core/csapi/tizenfx.git] / packaging / csapi-application.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-application
10 Summary:    Tizen Application API for C#
11 Version:    1.0.1
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 BuildRequires: mono-compiler
20 BuildRequires: mono-devel
21
22 BuildRequires: dotnet-build-tools
23
24 # NuGet for Dependencies
25 BuildRequires: csapi-tizen-nuget
26
27
28 %description
29 Tizen Application API for C#
30
31 %prep
32 %setup -q
33 cp %{SOURCE1} .
34
35 %define Assemblies Tizen.Applications
36
37 %build
38 for ASM in %{Assemblies}; do
39 # NuGet Restore
40 find $ASM/*.project.json -exec nuget restore {} \;
41 # Build
42 find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
43 # NuGet Pack
44 nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
45 done
46
47 %install
48 # Runtime Binary
49 mkdir -p %{buildroot}%{dotnet_assembly_path}
50 for ASM in %{Assemblies}; do
51 %if 0%{?_with_corefx}
52   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
53 %else
54   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
55 %endif
56 done
57 # NuGet
58 mkdir -p %{buildroot}/nuget
59 install -p -m 644 *.nupkg %{buildroot}/nuget
60
61 %files
62 %manifest %{name}.manifest
63 %license LICENSE
64 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
65
66 %package nuget
67 Summary:   NuGet package for %{name}
68 Group:     Development/Libraries
69
70 %description nuget
71 NuGet package for %{name}
72
73 %files nuget
74 /nuget/*.nupkg