Add sub rpm for Mono Runtime
[platform/core/csapi/tizen.git] / packaging / csapi-tizen.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-tizen
11 Summary:    Tizen 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
22 BuildRequires: mono-compiler
23 BuildRequires: mono-devel
24
25 BuildRequires: dotnet-build-tools
26
27 %description
28 Tizen API for C#
29
30 %prep
31 %setup -q
32 cp %{SOURCE1} .
33
34 %define Assemblies Tizen
35
36 %build
37 for ASM in %{Assemblies}; do
38 # NuGet Restore
39 find $ASM/*.project.json -exec nuget restore {} \;
40 # Build
41 find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
42 # NuGet Pack
43 nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
44 done
45
46 %install
47 # Runtime Binary
48 mkdir -p %{buildroot}%{dotnet_assembly_path}
49 for ASM in %{Assemblies}; do
50 %if 0%{?_with_corefx}
51   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
52 %else
53   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
54 %endif
55 install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{mono_assembly_path}
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
75
76 %package mono
77 Summary:   %{name} for Mono Runtime
78 Group:     Development/Libraries
79
80 %description mono
81 %{name} for Mono Runtime
82
83 %files mono
84 %manifest %{name}.manifest
85 %license LICENSE
86 %attr(644,root,root) %{mono_assembly_path}/*.dll