3842adaca226b413e36538ab9d401597a576db07
[platform/core/csapi/tizenfx.git] / packaging / csapi-system.spec
1 %{!?dotnet_assembly_path: %define dotnet_assembly_path %{_datadir}/assembly}
2 %{!?dotnet_core_path: %define dotnet_core_path %{_datadir}/tizen.net/ref}
3
4 %if 0%{?tizen_build_devel_mode}
5 %define BUILDCONF Debug
6 %else
7 %define BUILDCONF Release
8 %endif
9
10 Name:       csapi-system
11 Summary:    Tizen System API for C#
12 Version:    1.0.0
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 # Mono
21 BuildRequires: mono-compiler
22 BuildRequires: mono-devel
23
24 # .NETCore
25 %if 0%{?_with_corefx}
26 AutoReqProv: no
27 BuildRequires: corefx-managed-32b-ref
28 %endif
29
30 # C# API Requires
31 BuildRequires: csapi-tizen
32 BuildRequires: csapi-uifw
33
34 %description
35 Tizen System API for C#
36
37 %prep
38 %setup -q
39 cp %{SOURCE1} .
40
41 %define Assemblies Tizen.System
42
43 %build
44 for ASM in %{Assemblies}; do
45 xbuild $ASM/$ASM.csproj \
46 %if 0%{?_with_corefx}
47         /p:NoStdLib=True \
48         /p:TargetFrameworkVersion=v5.0 \
49         /p:AddAdditionalExplicitAssemblyReferences=False \
50         /p:CoreFxPath=%{dotnet_core_path} \
51 %endif
52         /p:Configuration=%{BUILDCONF} \
53         /p:ReferencePath=%{dotnet_assembly_path}
54 done
55
56 %install
57 mkdir -p %{buildroot}%{dotnet_assembly_path}
58 for ASM in %{Assemblies}; do
59 install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
60 done
61
62 %files
63 %manifest %{name}.manifest
64 %license LICENSE
65 %attr(644,root,root) %{dotnet_assembly_path}/*.dll