[Build] Disable struct validation by default (#1746)
[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
6 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
7 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
8 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
9 %define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
10 %define DOTNET_PRELOAD_PATH /usr/share/dotnet.tizen/preload
11 %define DOTNET_NUGET_SOURCE /nuget
12
13 %define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
14
15 Name:       csapi-tizenfx
16 Summary:    Assemblies of Tizen .NET
17 Version:    %{TIZEN_NET_RPM_VERSION}
18 Release:    1
19 Group:      Development/Libraries
20 License:    Apache-2.0 and MIT
21 URL:        https://www.tizen.org
22 Source0:    %{name}-%{version}.tar.gz
23 Source1:    %{name}.manifest
24
25 BuildArch:   noarch
26 ExcludeArch: aarch64
27 AutoReqProv: no
28
29 BuildRequires: dotnet-build-tools
30 Requires(post): /usr/bin/vconftool
31
32 # BuildRequires for StructValidator
33 %if %{defined enable_struct_test}
34 BuildRequires: coregl
35 BuildRequires: pkgconfig(elementary)
36 BuildRequires: pkgconfig(efl-extension)
37 BuildRequires: pkgconfig(capi-media-camera)
38 BuildRequires: pkgconfig(rua)
39 BuildRequires: pkgconfig(component-based-core-base)
40 BuildRequires: pkgconfig(notification)
41 BuildRequires: pkgconfig(capi-appfw-service-application)
42 BuildRequires: pkgconfig(capi-appfw-application)
43 BuildRequires: pkgconfig(capi-appfw-widget-application)
44 BuildRequires: pkgconfig(data-control)
45 BuildRequires: pkgconfig(capi-location-manager)
46 BuildRequires: pkgconfig(capi-media-vision)
47 BuildRequires: pkgconfig(capi-network-bluetooth)
48 BuildRequires: pkgconfig(capi-network-wifi-direct)
49 BuildRequires: pkgconfig(key-manager)
50 BuildRequires: pkgconfig(capi-system-sensor)
51 BuildRequires: pkgconfig(capi-system-runtime-info)
52 BuildRequires: pkgconfig(capi-ui-inputmethod)
53 BuildRequires: pkgconfig(stt-engine)
54 BuildRequires: pkgconfig(tts-engine)
55 BuildRequires: pkgconfig(chromium-efl)
56 %if "%{profile}" == "tv"
57 BuildRequires: pkgconfig(trustzone-nwd)
58 %else
59 BuildRequires: pkgconfig(capi-appfw-watch-application)
60 BuildRequires: pkgconfig(capi-telephony)
61 BuildRequires: pkgconfig(tef-libteec)
62 %endif
63 %endif
64
65 %description
66 %{summary}
67
68 %package nuget
69 Summary:   NuGet package for %{name}
70 Group:     Development/Libraries
71 AutoReqProv: no
72
73 %description nuget
74 NuGet package for %{name}
75
76 %package tools
77 Summary:   Tools for TizenFX
78 Group:     Development/Libraries
79 AutoReqProv: no
80
81 %description tools
82 Tools for TizenFX
83
84 %package dummy
85 Summary:   not used package
86 Group:     Development/Libraries
87 AutoReqProv: no
88
89 %description dummy
90 not used package
91
92 %package full
93 Summary:   All Tizen .NET assemblies
94 Group:     Development/Libraries
95 Requires:  %{name} = %{version}-%{release}
96 AutoReqProv: no
97
98 %description full
99 All Tizen .NET assemblies
100
101 %package debug
102 Summary:   All .pdb files of Tizen .NET
103 Group:     Development/Libraries
104 AutoReqProv: no
105
106 %description debug
107 All .pdb files of Tizen .NET
108
109 %package common
110 Summary:   Tizen .NET assemblies for Common profile
111 Group:     Development/Libraries
112 Requires:  %{name} = %{version}-%{release}
113 AutoReqProv: no
114
115 %description common
116 Tizen .NET assemblies for Common profile
117
118 %package mobile
119 Summary:   Tizen .NET assemblies for Mobile profile
120 Group:     Development/Libraries
121 Requires:  %{name} = %{version}-%{release}
122 AutoReqProv: no
123
124 %description mobile
125 Tizen .NET assemblies for Mobile profile
126
127 %package mobile-emul
128 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
129 Group:     Development/Libraries
130 Requires:  %{name} = %{version}-%{release}
131 AutoReqProv: no
132
133 %description mobile-emul
134 Tizen .NET assemblies for Emulator of Mobile profile
135
136 %package tv
137 Summary:   Tizen .NET assemblies for TV profile
138 Group:     Development/Libraries
139 Requires:  %{name} = %{version}-%{release}
140 AutoReqProv: no
141
142 %description tv
143 Tizen .NET assemblies for TV profile
144
145 %package wearable
146 Summary:   Tizen .NET assemblies for Wearable profile
147 Group:     Development/Libraries
148 Requires:  %{name} = %{version}-%{release}
149 AutoReqProv: no
150
151 %description wearable
152 Tizen .NET assemblies for Wearable profile
153
154 %prep
155 %setup -q
156 cp %{SOURCE1} .
157
158 %build
159 %{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
160
161 %define _tizenfx_bin_path Artifacts
162
163 rm -fr %{_tizenfx_bin_path}
164 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
165
166 %define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
167 %if %{defined profile}
168 %{build_cmd} --full /p:BuildProfile=%{profile}
169 %else
170 %{build_cmd} --full
171 %endif
172 %{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
173
174 %if %{defined enable_struct_test}
175 dotnet validate-struct %{_tizenfx_bin_path}/bin/public || echo "
176     #######################################################
177     ##################### W A R N I N G ###################
178     #######################################################
179     # The sturct size mismatches MUST BE FIXED.           #
180     # It will make building errors later                  #
181     #######################################################
182 "
183 %endif
184
185 # Generate filelist for rpm packaging
186 GetFileList() {
187   PROFILE=$1
188   cat packaging/PlatformFileList.txt | grep -v "\.preload" | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
189   for f in $(cat packaging/PlatformFileList.txt | grep -v -E "#$PROFILE[[:space:]]|#$PROFILE$|\.preload" | cut -d# -f1); do
190     if [ -f %{_tizenfx_bin_path}/bin/dummy/$f ]; then
191       echo "%{DOTNET_ASSEMBLY_PATH}/ref/$f"
192     fi
193   done
194   for f in $(cat packaging/PlatformFileList.txt | grep "\.preload" | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1); do
195     if [ -f packaging/preload/$f ]; then
196       echo "%{DOTNET_PRELOAD_PATH}/$f"
197     fi
198   done
199 }
200
201 GetFileList common > common.filelist
202 GetFileList mobile > mobile.filelist
203 GetFileList mobile-emul > mobile-emul.filelist
204 GetFileList tv > tv.filelist
205 GetFileList wearable > wearable.filelist
206
207 %install
208 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
209 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
210 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
211 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
212 mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
213 mkdir -p %{buildroot}%{DOTNET_PRELOAD_PATH}
214
215 # Install Runtime Assemblies
216 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
217 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
218
219 # Install Debug Symbols
220 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
221 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
222
223 # Install Resource files
224 [ -d %{_tizenfx_bin_path}/bin/public/res ] \
225   && install -p -m 644 %{_tizenfx_bin_path}/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
226 [ -d %{_tizenfx_bin_path}/bin/internal/res ] \
227   && install -p -m 644 %{_tizenfx_bin_path}/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
228
229 # Install Dummy Assemblies
230 install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
231
232 # Install NuGet Packages
233 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
234 install -p -m 644 packaging/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
235
236 # Install Tools
237 install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
238
239 # Install Preload
240 install -p -m 644 packaging/preload/*.preload %{buildroot}%{DOTNET_PRELOAD_PATH}
241
242 %post
243 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
244 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
245 /usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
246
247 %files
248 %license LICENSE
249 %license LICENSE.MIT
250
251 %files nuget
252 %{DOTNET_NUGET_SOURCE}/*.nupkg
253
254 %files tools
255 %manifest %{name}.manifest
256 %{DOTNET_TOOLS_PATH}/*
257
258 %files dummy
259
260 %files full
261 %manifest %{name}.manifest
262 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
263 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
264 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
265
266 %files debug
267 %manifest %{name}.manifest
268 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
269
270 %files common -f common.filelist
271 %manifest %{name}.manifest
272
273 %files mobile -f mobile.filelist
274 %manifest %{name}.manifest
275
276 %files mobile-emul -f mobile-emul.filelist
277 %manifest %{name}.manifest
278
279 %files tv -f tv.filelist
280 %manifest %{name}.manifest
281
282 %files wearable -f wearable.filelist
283 %manifest %{name}.manifest