60f9ed8ac023006869e5cc348e240920cac33a25
[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 Name:       elm-sharp
10 Summary:    C# Binding for Elementary
11 Version:    1.1.0
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 BuildRequires: edje-tools
26
27 %description
28 C# Binding for Elementary
29
30 %prep
31 %setup -q
32 cp %{SOURCE1} .
33
34 %define Assemblies ElmSharp
35
36 %build
37 for ASM in %{Assemblies}; do
38 # NuGet Restore
39 find $ASM/*.project.json -exec nuget restore {} \;
40 # Build
41 find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
42 # NuGet Pack
43 nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
44 done
45
46 edje_cc -id ElmSharp/theme/%{profile}/HD/images/ \
47         -id ElmSharp/theme/%{profile}/HD/images/User_Input_Elements \
48         ElmSharp/theme/%{profile}/elm-sharp-theme-%{profile}.edc ElmSharp/theme/elm-sharp-theme.edj
49
50 %install
51 # Runtime Binary
52 mkdir -p %{buildroot}%{dotnet_assembly_path}
53 for ASM in %{Assemblies}; do
54 %if 0%{?_with_corefx}
55   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
56 %else
57   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
58 %endif
59 done
60 # NuGet
61 mkdir -p %{buildroot}/nuget
62 install -p -m 644 *.nupkg %{buildroot}/nuget
63 # Theme
64 mkdir %{buildroot}%{_datadir}/edje/elm-sharp -p
65 install -m 644 ElmSharp/theme/elm-sharp-theme.edj %{buildroot}%{_datadir}/edje/elm-sharp/
66
67 %files
68 %manifest %{name}.manifest
69 %license LICENSE
70 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
71 %attr(644,root,root) %{_datadir}/edje/elm-sharp/*.edj
72
73 %package nuget
74 Summary:   NuGet package for %{name}
75 Group:     Development/Libraries
76
77 %description nuget
78 NuGet package for %{name}
79
80 %files nuget
81 /nuget/*.nupkg