Initial update
[platform/core/csapi/badge.git] / packaging / csapi-badge.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-badge
11 Summary:    Tizen badge 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 Requries
31 BuildRequires: csapi-tizen
32
33 %description
34 Tizen badge API for C#
35
36 %prep
37 %setup -q
38 cp %{SOURCE1} .
39
40 %define Assemblies Tizen.Applications.Badge
41
42 %build
43 for ASM in %{Assemblies}; do
44 xbuild $ASM/$ASM.csproj \
45 %if 0%{?_with_corefx}
46         /p:NoStdLib=True \
47         /p:TargetFrameworkVersion=v5.0 \
48         /p:AddAdditionalExplicitAssemblyReferences=False \
49         /p:CoreFxPath=%{dotnet_core_path} \
50 %endif
51         /p:Configuration=%{BUILDCONF} \
52         /p:ReferencePath=%{dotnet_assembly_path}
53 done
54
55 %install
56 mkdir -p %{buildroot}%{dotnet_assembly_path}
57 for ASM in %{Assemblies}; do
58 install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
59 done
60
61 %files
62 %manifest %{name}.manifest
63 %license LICENSE
64 %attr(644,root,root) %{dotnet_assembly_path}/*.dll