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