[Build] Add a flag to skip native deps checking
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizenfx.spec.in
1
2 %define TIZEN_NET_API_VERSION @api_version@
3 %define TIZEN_NET_RPM_VERSION @rpm_version@
4 %define TIZEN_NET_NUGET_VERSION @nuget_version@
5 %define TIZEN_NET_INTERNAL_NUGET_VERSION @internal_nuget_version@
6 %define NATIVE_DALI_VERSION @dali_version@
7 %define CHECK_NATIVE_DEPS @check_native_deps@
8
9 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
10 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
11 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
12 %define DOTNET_NUGET_SOURCE /nuget
13
14 Name:       csapi-tizenfx
15 Summary:    Assemblies of Tizen .NET
16 Version:    %{TIZEN_NET_RPM_VERSION}
17 Release:    1
18 Group:      Development/Libraries
19 License:    Apache-2.0
20 URL:        https://www.tizen.org
21 Source0:    %{name}-%{version}.tar.gz
22 Source1:    %{name}.manifest
23
24 BuildArch:   noarch
25 ExcludeArch: aarch64
26 AutoReqProv: no
27
28 BuildRequires: dotnet-build-tools
29 Requires(post): /usr/bin/vconftool
30
31 %if 0%{CHECK_NATIVE_DEPS}
32 BuildRequires: dali = %{NATIVE_DALI_VERSION}
33 %endif
34
35 %description
36 %{summary}
37
38 %package nuget
39 Summary:   NuGet package for %{name}
40 Group:     Development/Libraries
41 AutoReqProv: no
42
43 %description nuget
44 NuGet package for %{name}
45
46 %package dummy
47 Summary:   Dummy assemblies of Tizen .NET
48 Group:     Development/Libraries
49 AutoReqProv: no
50
51 %description dummy
52 Dummy assemblies of Tizen .NET
53
54 %package full
55 Summary:   All Tizen .NET assemblies
56 Group:     Development/Libraries
57 Requires:  %{name} = %{version}-%{release}
58 AutoReqProv: no
59
60 %description full
61 All Tizen .NET assemblies
62
63 %package debug
64 Summary:   All .pdb files of Tizen .NET
65 Group:     Development/Libraries
66 AutoReqProv: no
67
68 %description debug
69 All .pdb files of Tizen .NET
70
71 %package common
72 Summary:   Tizen .NET assemblies for Common profile
73 Group:     Development/Libraries
74 Requires:  %{name} = %{version}-%{release}
75 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
76 AutoReqProv: no
77
78 %description common
79 Tizen .NET assemblies for Common profile
80
81 %package mobile
82 Summary:   Tizen .NET assemblies for Mobile profile
83 Group:     Development/Libraries
84 Requires:  %{name} = %{version}-%{release}
85 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
86 AutoReqProv: no
87
88 %description mobile
89 Tizen .NET assemblies for Mobile profile
90
91 %package mobile-emul
92 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
93 Group:     Development/Libraries
94 Requires:  %{name} = %{version}-%{release}
95 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
96 AutoReqProv: no
97
98 %description mobile-emul
99 Tizen .NET assemblies for Emulator of Mobile profile
100
101 %package tv
102 Summary:   Tizen .NET assemblies for TV profile
103 Group:     Development/Libraries
104 Requires:  %{name} = %{version}-%{release}
105 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
106 AutoReqProv: no
107
108 %description tv
109 Tizen .NET assemblies for TV profile
110
111 %package ivi
112 Summary:   Tizen .NET assemblies for IVI profile
113 Group:     Development/Libraries
114 Requires:  %{name} = %{version}-%{release}
115 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
116 AutoReqProv: no
117
118 %description ivi
119 Tizen .NET assemblies for IVI profile
120
121 %package wearable
122 Summary:   Tizen .NET assemblies for Wearable profile
123 Group:     Development/Libraries
124 Requires:  %{name} = %{version}-%{release}
125 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
126 AutoReqProv: no
127
128 %description wearable
129 Tizen .NET assemblies for Wearable profile
130
131 %prep
132 %setup -q
133 cp %{SOURCE1} .
134
135 %build
136
137 %define _tizenfx_bin_path Artifacts
138
139 GetFileList() {
140   PROFILE=$1
141   cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
142 }
143
144 GetFileList common > common.filelist
145 GetFileList mobile > mobile.filelist
146 GetFileList mobile-emul > mobile-emul.filelist
147 GetFileList tv > tv.filelist
148 GetFileList ivi > ivi.filelist
149 GetFileList wearable > wearable.filelist
150
151 rm -fr %{_tizenfx_bin_path}
152 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
153 ./build.sh --full
154 ./build.sh --dummy
155 ./build.sh --pack %{TIZEN_NET_NUGET_VERSION} %{TIZEN_NET_INTERNAL_NUGET_VERSION}
156
157 %install
158 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
159 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
160 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
161 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
162
163 # Install Runtime Assemblies
164 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
165 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
166
167 # Install Debug Symbols
168 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
169 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
170
171 # Install Resource files
172 [ -d %{_tizenfx_bin_path}/bin/public/res ] \
173   && install -p -m 644 %{_tizenfx_bin_path}/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
174 [ -d %{_tizenfx_bin_path}/bin/internal/res ] \
175   && install -p -m 644 %{_tizenfx_bin_path}/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
176
177 # Install Dummy Assemblies
178 install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
179
180 # Install NuGet Packages
181 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
182
183 %post
184 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
185
186
187 %files
188 %license LICENSE
189
190 %files nuget
191 %{DOTNET_NUGET_SOURCE}/*.nupkg
192
193 %files dummy
194 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
195
196 %files full
197 %manifest %{name}.manifest
198 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
199 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
200
201 %files debug
202 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
203
204 %files common -f common.filelist
205 %manifest %{name}.manifest
206
207 %files mobile -f mobile.filelist
208 %manifest %{name}.manifest
209
210 %files mobile-emul -f mobile-emul.filelist
211 %manifest %{name}.manifest
212
213 %files tv -f tv.filelist
214 %manifest %{name}.manifest
215
216 %files ivi -f ivi.filelist
217 %manifest %{name}.manifest
218
219 %files wearable -f wearable.filelist
220 %manifest %{name}.manifest