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