Merge remote-tracking branch 'origin/master' into tizen
[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 mobile
110 Summary:   Tizen .NET assemblies for Mobile profile
111 Group:     Development/Libraries
112 Requires:  %{name} = %{version}-%{release}
113 AutoReqProv: no
114
115 %description mobile
116 Tizen .NET assemblies for Mobile profile
117
118 %package tv
119 Summary:   Tizen .NET assemblies for TV profile
120 Group:     Development/Libraries
121 Requires:  %{name} = %{version}-%{release}
122 AutoReqProv: no
123
124 %description tv
125 Tizen .NET assemblies for TV profile
126
127 %package wearable
128 Summary:   Tizen .NET assemblies for Wearable profile
129 Group:     Development/Libraries
130 Requires:  %{name} = %{version}-%{release}
131 AutoReqProv: no
132
133 %description wearable
134 Tizen .NET assemblies for Wearable profile
135
136 %prep
137 %setup -q
138 cp %{SOURCE1} .
139
140 %build
141
142 # configure for ASAN
143 %{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
144
145 # prepare for build
146 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
147 %define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
148
149 # build full assemblies
150 %if %{defined profile}
151 %{build_cmd} --full /p:BuildProfile=%{profile}
152 %else
153 %{build_cmd} --full
154 %endif
155
156 # pack nuget package
157 %{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
158
159 # check validation of struct size
160 %if %{defined enable_struct_test}
161 dotnet validate-struct Artifacts/bin/public || echo "
162     #######################################################
163     ##################### W A R N I N G ###################
164     #######################################################
165     # The sturct size mismatches MUST BE FIXED.           #
166     # It will make building errors later                  #
167     #######################################################
168 "
169 %endif
170
171
172 %install
173 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
174 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
175 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
176 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
177 mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
178 mkdir -p %{buildroot}%{DOTNET_PRELOAD_PATH}
179
180 # Install Runtime Assemblies
181 install -p -m 644 Artifacts/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
182 install -p -m 644 Artifacts/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
183
184 # Install Debug Symbols
185 install -p -m 644 Artifacts/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
186 install -p -m 644 Artifacts/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
187
188 # Install Resource files
189 [ -d Artifacts/bin/public/res ] \
190   && cp -fr Artifacts/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
191 [ -d Artifacts/bin/internal/res ] \
192   && cp -fr Artifacts/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
193
194 # Install Dummy Assemblies
195 install -p -m 644 Artifacts/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
196
197 # Install Preload
198 install -p -m 644 Artifacts/preload/*.preload %{buildroot}%{DOTNET_PRELOAD_PATH}
199
200 # Install NuGet Packages
201 install -p -m 644 Artifacts/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
202 install -p -m 644 packaging/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
203
204 # Install Tools
205 install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
206
207
208 %post
209 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
210 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
211 /usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
212
213 %files
214 %license LICENSE
215 %license LICENSE.MIT
216
217 %files nuget
218 %{DOTNET_NUGET_SOURCE}/*.nupkg
219
220 %files tools
221 %manifest %{name}.manifest
222 %{DOTNET_TOOLS_PATH}/*
223
224 %files dummy
225
226 %files full
227 %manifest %{name}.manifest
228 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
229 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
230 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
231 %attr(644,root,root) %{DOTNET_PRELOAD_PATH}/*
232
233 %files debug
234 %manifest %{name}.manifest
235 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
236
237 %files mobile -f Artifacts/mobile.filelist
238 %manifest %{name}.manifest
239
240 %files tv -f Artifacts/tv.filelist
241 %manifest %{name}.manifest
242
243 %files wearable -f Artifacts/wearable.filelist
244 %manifest %{name}.manifest