summaryrefslogtreecommitdiff
path: root/packaging/building-blocks.spec
blob: 9632b2d9356878fd906333f3e82b3b0402a5db61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# There are meta packages only.
%define __debug_install_post %{nil}
%define debug_package %{nil}
%define tizen_feature() sed -i 's#\\\(\\\"%{1}\\\".\\\+>\\\).\\\+\\\(</key>\\\)#\\\1%{2}\\\2#' %{_sysconfdir}/config/model-config.xml;
%define tizen_hal_feature() sed -i 's#\\\(\\\"%{1}\\\".\\\+>\\\).\\\+\\\(</key>\\\)#\\\1%{2}\\\2#' %{_hal_sysconfdir}/config/model-config.xml;

%define dotnet_feature "on"

Name:		building-blocks
Version:	7.0.0
Release:	0
License:	Apache-2.0
Summary:	The Root of All Tizen Meta Packages (building blocks)
Url:		http://tizen.org
Group:		Meta
Source0:	%{name}-%{version}.tar.gz

# Domains are rearranged by API sets according to developer.tizen.org
Source1200:	domain-apis.inc
Source1201:	domain-apis-account.inc
Source1202:	domain-apis-appfw.inc
Source1203:	domain-apis-base.inc
Source1204:	domain-apis-content.inc
Source1205:	domain-apis-context.inc
Source1206:	domain-apis-location.inc
Source1207:	domain-apis-maps.inc
Source1208:	domain-apis-messaging.inc
Source1209:	domain-apis-multimedia.inc
Source1210:	domain-apis-network.inc
Source1211:	domain-apis-security.inc
Source1212:	domain-apis-social.inc
Source1213:	domain-apis-system.inc
Source1214:	domain-apis-telephony.inc
Source1215:	domain-apis-ui.inc
Source1216:	domain-apis-uix.inc
Source1217:	domain-apis-web.inc
Source1218:	domain-apis-machinelearning.inc

Source1300: domain-features.inc
Source1301: domain-features-dotnet.inc
Source1302: domain-features-webapi.inc
Source1303: domain-features-esplusplayer.inc
Source1304: domain-features-bootanimation.inc
Source1305: domain-features-starter.inc
Source1306: domain-features-upgrade.inc
Source1307: domain-features-tool_and_locale.inc
Source1308: domain-features-recovery.inc
Source1309: domain-features-setup.inc
Source1310: domain-features-resource_manager.inc
Source1311: domain-features-diagnostics.inc
Source1312: domain-features-power_manager.inc
Source1313: domain-features-mode_supervisor.inc

%if %{dotnet_feature} == "on"
Source1400:	domain-csapis.inc
Source1401:	domain-csapis-account.inc
Source1402:	domain-csapis-appfw.inc
Source1403:	domain-csapis-content.inc
Source1404:	domain-csapis-context.inc
Source1405:	domain-csapis-location.inc
Source1406:	domain-csapis-maps.inc
Source1407:	domain-csapis-messaging.inc
Source1408:	domain-csapis-multimedia.inc
Source1409:	domain-csapis-network.inc
Source1410:	domain-csapis-security.inc
Source1411:	domain-csapis-social.inc
Source1412:	domain-csapis-system.inc
Source1413:	domain-csapis-telephony.inc
Source1414:	domain-csapis-ui.inc
Source1415:	domain-csapis-uix.inc
Source1416:	domain-csapis-web.inc
Source1417:	domain-csapis-machinelearning.inc
%endif

Source1500:	domain-halapis.inc

Source2010:	epicfeature-development.inc
Source2020:	epicfeature-application.inc

Source3500:	platform-preset-iot.inc
Source3501:	platform-preset-iot-headless-images.inc
Source3502:	platform-preset-iot-headed-images.inc
Source3503:	platform-preset-partitions.inc

Source3800:	platform-preset-boards.inc
%ifarch %{arm} aarch64
Source3811:	platform-preset-boards-rpi3-hal-backend.inc
Source3815:	platform-preset-boards-rpi4-hal-backend.inc
Source3816:	platform-preset-boards-generic-hal-backend.inc
Source3820:	platform-preset-boards-common.inc
Source3813:	platform-preset-boards-vim3-hal-backend.inc
%endif
%ifarch armv7l
Source3812:	platform-preset-boards-artik530-hal-backend.inc
%endif
%ifarch aarch64
Source3814:	platform-preset-boards-c4-hal-backend.inc
%endif
%ifarch %{ix86} x86_64
Source3803: platform-preset-boards-emul.inc
%endif

# To get .ks files
BuildRequires:	image-configurations

# To check the rules
BuildRequires:	python

# Root Categories
Suggests:	%{name}-category-domains
Suggests:	%{name}-category-epicfeatures
Suggests:	%{name}-category-Presets

%description
The root of all Tizen building block meta packages.
Every root-level Tizen building block should be included by this.
Any "minimal" required packages should be somehow (directly or indirectly)
required (included) by this package.
In Tizen building blocks,
"Requires" means mandatory package.
"Suggests" means optional package.
"Recommends" is reserved for future usage.
"Conflicts" is to unselect unconditionally.


%package	category-domains
Summary:	Tizen Techinical Domains
Suggests:	%{name}-root-domain_API
Suggests:   %{name}-root-domain_Feature
%if %{dotnet_feature} == "on"
Suggests:	%{name}-root-domain_CSAPI
%endif
#Suggests:	%{name}-root-domain_WebAPI
Suggests:	%{name}-root-domain_HALAPI
%description	category-domains
This meta package lists all Tizen blocks (meta packages) designating
technical domains.
%files		category-domains
# Intentionally empty


%package	category-epicfeatures
Summary:	Tizen Major Features
Suggests:	%{name}-root-feature_Development
Suggests:	%{name}-root-feature_App
%description	category-epicfeatures
This meta package lists all Tizen blocks (meta packages) designating
major features that are supposed to be orthogonal to each other
and to most domains.
%files		category-epicfeatures
# Intentionally empty


%package	category-Preset
Summary:	Tizen Presets
Suggests:	%{name}-root-Preset_boards
Suggests:	%{name}-root-Preset_iot_core
Suggests:	%{name}-root-Preset_iot_headed
Suggests:	%{name}-root-Preset_iot_headless
Suggests:	%{name}-root-Preset_img_headless
Suggests:	%{name}-root-Preset_img_headed
Suggests:	%{name}-root-Preset_partition
%description	category-Preset
This meta pacakge lists all Tizen blocks (meta packages) designating
Tizen platform presets, HAL/device-support presets, and
presets describing specific products.
%files		category-Preset
# Intentionally empty


# Do not try to include files unless RPMBUILD has already expanded source files to SOURCES
# Use Source1001 (domain-kernel) as the probing point.
%define include_if_mainbuild() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then print("%include "..rpm.expand("%{1}").." ") end}}

# Create a target device preset from .ks file used to create device iamge.
# This script writes build-spec when building the build-spec itself. :)
# Importing .ks file with list_with_require() based on image-configuration will work
# after Tizen:Unified starts to generate its own platform images.
%define list_with_require() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \
	local start = 0 \
	if posix.access(rpm.expand("%{1}")) then \
		for line in io.lines(rpm.expand("%{1}")) do \
			if (string.match(line, '%%end')) then break end \
			if (string.match(line, '%%packages')) then \
				start = 1 \
			else \
				if (start == 1) then \
					if (string.match(line, '#')) then \
					elseif (string.sub(line, 1, 1) == '-') then \
					elseif (string.len(line) == 0) then\
					else \
						print("Requires: "..line) \
						print("\\n") \
					end \
				end \
			end \
		end \
	else \
		print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \
	end \
end}}

# Create a target device preset from .ks file used to create device iamge.
# This script writes build-spec when building the build-spec itself. :)
# Importing .ks file with list_with_require() based on image-configuration will work
# after Tizen:Unified starts to generate its own platform images.
# Removing the target-dependent files.
%define list_with_require_nodep_device() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \
	local start = 0 \
	if posix.access(rpm.expand("%{1}")) then \
		for line in io.lines(rpm.expand("%{1}")) do \
			if (string.match(line, '%%end')) then break end \
			if (string.match(line, '%%packages')) then \
				start = 1 \
			else \
				if (start == 1) then \
					if (string.match(line, '#')) then \
					elseif (string.sub(line, 1, 1) == '-') then \
					elseif (string.len(line) == 0) then\
					elseif (string.match(line,"model%-config")) then\
					elseif (string.match(line,"pepper")) then\
					elseif (string.match(line,"system%-plugin")) then\
					elseif (string.match(line,"vconf%-internal%-keys%-config%-profile")) then\
					else \
						print("Requires: "..line) \
						print("\\n") \
					end \
				end \
			end \
		end \
	else \
		print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \
	end \
end}}


# Create Suggests List of blocks with yaml file list
# DIRECTORY, Prefix-To-Be-Removed, Prefix-for-block-name
%define list_suggest() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \
	for f in posix.files(rpm.expand("%{1}")) do \
		local line =  string.sub(f, string.len(rpm.expand("%{2}"))+2) \
		local prefix = string.sub(f, 1, string.len(rpm.expand("%{2}"))) \
		if (string.sub(line, 1, 10) == 'adaptation') then \
		elseif (string.sub(line, 1, 4) == 'boot') then \
		elseif (prefix == rpm.expand("%{2}")) then \
			line = string.gsub(line, "-", "_")
			print("Suggests: %{name}-"..rpm.expand("%{3}").."zblock_"..line) \
			print("\\n") \
		end \
	end \
end}}


# Requires the created suggests list of blocks with yaml file list
# DIRECTORY, Prefix-To-Be-Removed, Prefix-for-block-name
%define list_suggest_linkreq() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \
	for f in posix.files(rpm.expand("%{1}")) do \
		local line =  string.sub(f, string.len(rpm.expand("%{2}"))+2) \
		local prefix = string.sub(f, 1, string.len(rpm.expand("%{2}"))) \
		if (string.sub(line, 1, 10) == 'adaptation') then \
		elseif (string.sub(line, 1, 4) == 'boot') then \
		elseif (prefix == rpm.expand("%{2}")) then \
			line = string.gsub(line, "-", "_")
			print("Requires: %{name}-"..rpm.expand("%{3}").."zblock_"..line) \
			print("\\n") \
		end \
	end \
end}}


# Create Requires List of packages for all blocks with yaml file list
# DIRECTORY, Prefix-To-Be-Removed, Prefix-for-block-name
%define list_require() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1200}"), "f") then \
	for f in posix.files(rpm.expand("%{1}")) do \
		local line =  string.sub(f, string.len(rpm.expand("%{2}"))+2) \
		local prefix = string.sub(f, 1, string.len(rpm.expand("%{2}"))) \
		if (string.sub(line, 1, 10) == 'adaptation') then \
		elseif (string.sub(line, 1, 4) == 'boot') then \
		elseif (prefix == rpm.expand("%{2}")) then \
			local pkg = rpm.expand("%{3}").."zblock_"..string.gsub(line, "-", "_") \
			local summary_available = 0 \
			local filename = rpm.expand("%{1}").."/"..f \
			print("\\n") \
			print("%package "..pkg.."\\n") \
			if posix.access(filename) then \
				for tag in io.lines(filename) do \
					if (string.sub(tag, 1, 8) == "Summary:") then \
						print(tag) \
						print("\\n") \
						summary_available = 1 \
						break \
					end \
				end \
			end \
			if (summary_available == 0) then \
				print("Summary: "..f) \
				print("\\n") \
			end \
			if posix.access(filename) then \
				for line in io.lines(rpm.expand("%{1}").."/"..f) do \
					if (string.match(line, 'Packages:')) then \
						start = 1 \
					elseif (string.sub(line, 1, 2) == '- ') then \
						if (start == 1) then \
							print("Requires: "..string.sub(line, 3)) \
							print("\\n") \
						end \
					elseif (string.sub(line, 1, 1) == '#') then \
					elseif (string.len(line) == 0) then \
					else \
						start = 0
					end \
				end \
			else \
				print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \
			end \
			print("%description "..pkg.."\\n") \
			print("Auto Generated Block (zblock) of "..f.."\\n") \
			print("%files "..pkg.."\\n") \
			print("\\n\\n\\n") \
		end \
	end \
end}}

%prep
%setup

%build

# Auto require generation still requires further decision making. This shows the basic data for it in the build log.
ls -l %{_datadir}/image-configurations/*

mkdir -p %{buildroot}/opt/share/bb
cp -f mapping*.xml %{buildroot}/opt/share/bb
cp -f make_tizenfx_from_bb.sh %{buildroot}/opt/share/bb
cp -f make_ABB_tag.sh %{buildroot}/opt/share/bb

# rule_checker returns non-zero if there is an error in *.inc, breaking the build
python ./rule_checker.py

%files

############## DOMAINS ##################
%{include_if_mainbuild %{SOURCE1200}}
%{include_if_mainbuild %{SOURCE1201}}
%{include_if_mainbuild %{SOURCE1202}}
%{include_if_mainbuild %{SOURCE1203}}
%{include_if_mainbuild %{SOURCE1204}}
%{include_if_mainbuild %{SOURCE1205}}
%{include_if_mainbuild %{SOURCE1206}}
%{include_if_mainbuild %{SOURCE1207}}
%{include_if_mainbuild %{SOURCE1208}}
%{include_if_mainbuild %{SOURCE1209}}
%{include_if_mainbuild %{SOURCE1210}}
%{include_if_mainbuild %{SOURCE1211}}
%{include_if_mainbuild %{SOURCE1212}}
%{include_if_mainbuild %{SOURCE1213}}
%{include_if_mainbuild %{SOURCE1214}}
%{include_if_mainbuild %{SOURCE1215}}
%{include_if_mainbuild %{SOURCE1216}}
%{include_if_mainbuild %{SOURCE1217}}
%{include_if_mainbuild %{SOURCE1218}}

%{include_if_mainbuild %{SOURCE1300}}
%{include_if_mainbuild %{SOURCE1301}}
%{include_if_mainbuild %{SOURCE1302}}
%{include_if_mainbuild %{SOURCE1303}}
%{include_if_mainbuild %{SOURCE1304}}
%{include_if_mainbuild %{SOURCE1305}}
%{include_if_mainbuild %{SOURCE1306}}
%{include_if_mainbuild %{SOURCE1307}}
%{include_if_mainbuild %{SOURCE1308}}
%{include_if_mainbuild %{SOURCE1309}}
%{include_if_mainbuild %{SOURCE1310}}
%{include_if_mainbuild %{SOURCE1311}}
%{include_if_mainbuild %{SOURCE1312}}
%{include_if_mainbuild %{SOURCE1313}}

%if %{dotnet_feature} == "on"
%{include_if_mainbuild %{SOURCE1400}}
%{include_if_mainbuild %{SOURCE1401}}
%{include_if_mainbuild %{SOURCE1402}}
%{include_if_mainbuild %{SOURCE1403}}
%{include_if_mainbuild %{SOURCE1404}}
%{include_if_mainbuild %{SOURCE1405}}
%{include_if_mainbuild %{SOURCE1406}}
%{include_if_mainbuild %{SOURCE1407}}
%{include_if_mainbuild %{SOURCE1408}}
%{include_if_mainbuild %{SOURCE1409}}
%{include_if_mainbuild %{SOURCE1410}}
%{include_if_mainbuild %{SOURCE1411}}
%{include_if_mainbuild %{SOURCE1412}}
%{include_if_mainbuild %{SOURCE1413}}
%{include_if_mainbuild %{SOURCE1414}}
%{include_if_mainbuild %{SOURCE1415}}
%{include_if_mainbuild %{SOURCE1416}}
%{include_if_mainbuild %{SOURCE1417}}
%endif

%{include_if_mainbuild %{SOURCE1500}}
############## EPIC FEATURES ######################

# Dev tools
%{include_if_mainbuild %{SOURCE2010}}

# Platform features
%{include_if_mainbuild %{SOURCE2020}}


############# PLATFORM PRESET #####################

# Tizen Platform Presets.
# Unlike Preset-Recipes of TIC, you cannot deselect packages from these presets.
%{include_if_mainbuild %{SOURCE3500}}
%{include_if_mainbuild %{SOURCE3501}}
%{include_if_mainbuild %{SOURCE3502}}
%{include_if_mainbuild %{SOURCE3503}}

%{include_if_mainbuild %{SOURCE3800}}
%ifarch %{arm} aarch64
%{include_if_mainbuild %{SOURCE3811}}
%{include_if_mainbuild %{SOURCE3815}}
%{include_if_mainbuild %{SOURCE3816}}
%{include_if_mainbuild %{SOURCE3820}}
%{include_if_mainbuild %{SOURCE3813}}
%endif
%ifarch armv7l
%{include_if_mainbuild %{SOURCE3812}}
%endif
%ifarch aarch64
%{include_if_mainbuild %{SOURCE3814}}
%endif
%ifarch %{ix86} x86_64
%{include_if_mainbuild %{SOURCE3803}}
%endif
%package	mapping-files
Summary:	Some mapping-files for building-blocks
Requires:	sed
Requires:	rpm
Requires:	grep
Requires:	gawk
%description	mapping-files
This package includes some mapping-files for building-blocks such as tct, rootstrap and tizenfx.
%files		mapping-files
/opt/share/bb/mapping-bb-rs.xml
/opt/share/bb/mapping-bb-tizenfx.xml
/opt/share/bb/mapping-bb-tct.xml
/opt/share/bb/make_tizenfx_from_bb.sh
/opt/share/bb/make_ABB_tag.sh