4ff9645ea035874ab3521c0f2db7e591bda63a17
[platform/core/csapi/tizenfx.git] / packaging / elm-sharp.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 %define DEV_VERSION beta-002
10
11 Name:       elm-sharp
12 Summary:    C# Binding for Elementary
13 Version:    1.1.0
14 Release:    1
15 Group:      Development/Libraries
16 License:    Apache-2.0
17 URL:        https://www.tizen.org
18 Source0:    %{name}-%{version}.tar.gz
19 Source1:    %{name}.manifest
20
21 AutoReqProv: no
22 ExcludeArch: aarch64 %ix86
23
24 BuildRequires: mono-compiler
25 BuildRequires: mono-devel
26
27 BuildRequires: dotnet-build-tools
28 BuildRequires: edje-tools
29
30 %description
31 C# Binding for Elementary
32
33 %prep
34 %setup -q
35 cp %{SOURCE1} .
36
37 %define Assemblies ElmSharp
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}%{?DEV_VERSION:-%{DEV_VERSION}} -Properties Configuration=%{BUILDCONF}
47 done
48
49 edje_cc -id ElmSharp/theme/%{profile}/HD/images/ \
50         -id ElmSharp/theme/%{profile}/HD/images/User_Input_Elements \
51         ElmSharp/theme/%{profile}/elm-sharp-theme-%{profile}.edc ElmSharp/theme/elm-sharp-theme.edj
52
53 %install
54 # Runtime Binary
55 mkdir -p %{buildroot}%{dotnet_assembly_path}
56 for ASM in %{Assemblies}; do
57 %if 0%{?_with_corefx}
58   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
59 %else
60   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
61 %endif
62 done
63 # NuGet
64 mkdir -p %{buildroot}/nuget
65 install -p -m 644 *.nupkg %{buildroot}/nuget
66 # Theme
67 mkdir %{buildroot}%{_datadir}/edje/elm-sharp -p
68 install -m 644 ElmSharp/theme/elm-sharp-theme.edj %{buildroot}%{_datadir}/edje/elm-sharp/
69
70 %files
71 %manifest %{name}.manifest
72 %license LICENSE
73 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
74 %attr(644,root,root) %{_datadir}/edje/elm-sharp/*.edj
75
76 %package nuget
77 Summary:   NuGet package for %{name}
78 Group:     Development/Libraries
79
80 %description nuget
81 NuGet package for %{name}
82
83 %files nuget
84 /nuget/*.nupkg