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