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