3bbf2c9b4a32ef516ac91a91c093eb5b9f7ecc55
[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.0.7
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 ElmSharp/theme/%{profile}/elm-sharp-theme-%{profile}.edc ElmSharp/theme/elm-sharp-theme.edj
47
48 %install
49 # Runtime Binary
50 mkdir -p %{buildroot}%{dotnet_assembly_path}
51 for ASM in %{Assemblies}; do
52 %if 0%{?_with_corefx}
53   install -p -m 644 $ASM/bin/%{BUILDCONF}/$ASM.dll %{buildroot}%{dotnet_assembly_path}
54 %else
55   install -p -m 644 $ASM/bin/%{BUILDCONF}/Net45/$ASM.dll %{buildroot}%{dotnet_assembly_path}
56 %endif
57 done
58 # NuGet
59 mkdir -p %{buildroot}/nuget
60 install -p -m 644 *.nupkg %{buildroot}/nuget
61 # Theme
62 mkdir %{buildroot}%{_datadir}/edje/elm-sharp -p
63 install -m 644 ElmSharp/theme/elm-sharp-theme.edj %{buildroot}%{_datadir}/edje/elm-sharp/
64
65 %files
66 %manifest %{name}.manifest
67 %license LICENSE
68 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
69 %attr(644,root,root) %{_datadir}/edje/elm-sharp/*.edj
70
71 %package nuget
72 Summary:   NuGet package for %{name}
73 Group:     Development/Libraries
74
75 %description nuget
76 NuGet package for %{name}
77
78 %files nuget
79 /nuget/*.nupkg