CODE CLEAN: remove rpmbuild warnings from Rpm.pm
[tools/building-blocks.git] / packaging / building-blocks.spec
1 # There are meta packages only.
2 %define __debug_install_post %{nil}
3 %define debug_package %{nil}
4
5 Name:           building-blocks
6 Version:        0.0.1
7 Release:        0
8 License:        Apache-2.0
9 Summary:        The Root of All Tizen Meta Packages (building blocks)
10 Url:            http://tizen.org
11 Group:          Meta
12 Source0:        %{name}-%{version}.tar.gz
13
14 Source1001:     domain-kernel.inc
15 Source1002:     domain-systemfw.inc
16 Source1010:     domain-appfw.inc
17 Source1020:     domain-window-system.inc
18 Source1030:     domain-graphics.inc
19 Source1040:     domain-network.inc
20 Source1050:     domain-multimedia.inc
21 Source1060:     domain-hal.inc
22 Source1070:     domain-service-framework.inc
23 Source1080:     domain-UI.inc
24 Source1090:     domain-UIX.inc
25 Source1100:     domain-security.inc
26
27 Source2001:     epicfeature-headless.inc
28 Source2010:     epicfeature-development.inc
29 Source2020:     epicfeature-platform.inc
30
31 Source3100:     platform-preset-mobile.inc
32 Source3200:     platform-preset-wearable.inc
33 Source3300:     platform-preset-tv.inc
34 Source3400:     platform-preset-ivi.inc
35 Source3500:     platform-preset-iot.inc
36 Source3600:     platform-preset-common.inc
37 Source3700:     platform-preset-home_appliance.inc
38 Source3800:     platform-preset-boards.inc
39
40 # To get .ks files
41 BuildRequires:  image-configurations
42
43 # To check the rules
44 BuildRequires:  python
45
46 # Root Categories
47 Suggests:       %{name}-category-domains
48 Suggests:       %{name}-category-epicfeatures
49 Suggests:       %{name}-category-presets
50
51 %description
52 The root of all Tizen building block meta packages.
53 Every root-level Tizen building block should be included by this.
54 Any "minimal" required packages should be somehow (directly or indirectly)
55 required (included) by this package.
56 In Tizen building blocks, "Requires" means mandatory package.
57 "Suggests" means optional package.
58 "Recommened" is reserved for future usage.
59 "Conflicts" is to unselect unconditionally.
60
61
62 %package        category-domains
63 Summary:        Tizen Techinical Domains
64 Suggests:       %{name}-root-Kernel
65 Suggests:       %{name}-root-SystemFW
66 Suggests:       %{name}-root-AppFW
67 Suggests:       %{name}-root-Window
68 Suggests:       %{name}-root-graphics
69 Suggests:       %{name}-root-network
70 Suggests:       %{name}-root-multimedia
71 Suggests:       %{name}-root-HAL
72 Suggests:       %{name}-root-serviceFW
73 Suggests:       %{name}-root-UI
74 Suggests:       %{name}-root-UIX
75 Suggests:       %{name}-root-security
76 %description    category-domains
77 This meta package lists all Tizen blocks (meta packages) designating
78 techinical domains.
79 %files          category-domains
80 # Intentionally empty
81
82
83 %package        category-epicfeatures
84 Summary:        Tizen Major Features
85 Suggests:       %{name}-root-feature_Headless
86 Suggests:       %{name}-root-feature_Headed
87 Suggests:       %{name}-root-feature_Development
88 Suggests:       %{name}-root-feature_Platform
89 %description    category-epicfeatures
90 This meta package lists all Tizen blocks (meta packages) designating
91 major features that are supposed to be orthogonal to each other
92 and to most domains.
93 %files          category-epicfeatures
94 # Intentionally empty
95
96
97 %package        category-presets
98 Summary:        Tizen Presets
99 Suggests:       %{name}-root-preset_boards
100 Suggests:       %{name}-root-preset_mobile
101 Suggests:       %{name}-root-preset_tv
102 Suggests:       %{name}-root-preset_wearable
103 Suggests:       %{name}-root-preset_ivi
104 Suggests:       %{name}-root-preset_iot
105 Suggests:       %{name}-root-preset_common
106 Suggests:       %{name}-root-preset_home_appliance
107 %description    category-presets
108 This meta pacakge lists all Tizen blocks (meta packages) designating
109 Tizen platform presets, HAL/device-support presets, and
110 presets describing specific products.
111 %files          category-presets
112 # Intentionally empty
113
114
115 # Do not try to include files unless RPMBUILD has already expanded source files to SOURCES
116 # Use Source1001 (domain-kernel) as the probing point.
117 %define include_if_mainbuild() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1001}"), "f") then print("%include "..rpm.expand("%{1}")) end}}
118
119 # Create a target device preset from .ks file used to create device iamge.
120 # This script writes build-spec when building the build-spec itself. :)
121 # Importing .kg file with list_with_require() based on image-configuration will work
122 # after Tizen:Unified starts to generate its own platform images.
123
124 # TODO1: How to interpret "- pkg"? just skip? or make it conflicted?
125 # TODO2: How to handle "no file error"?
126 %define list_with_require() %{expand:%{lua:if posix.access(rpm.expand("%{SOURCE1001}"), "f") then \
127         local start = 0 \
128         if posix.access(rpm.expand("%{1}")) then \
129                 for line in io.lines(rpm.expand("%{1}")) do \
130                         if (string.match(line, '%%end')) then break end \
131                         if (string.match(line, '%%packages')) then \
132                                 start = 1 \
133                         else \
134                                 if (start == 1) then \
135                                         if (string.match(line, '^#')) then \
136                                         elseif (string.match(line, '^-')) then \
137                                         elseif (string.match(line, '^$')) then \
138                                         else \
139                                                 print("Requires: "..line) \
140                                         end \
141                                 end \
142                         end \
143                 end \
144         else \
145                 print("Requires: CANNOT_FIND_REQUIRED_FILES\\n") \
146         end \
147 end}}
148
149 %prep
150 %setup
151
152 %build
153
154 # Auto require generation still requires further decision making. This shows the basic data for it in the build log.
155 ls -l %{_datadir}/image-configurations/*
156
157 # rule_checker returns non-zero if there is an error in *.inc, breaking the build
158 python ./rule_checker.py
159
160 %files
161
162 ############## DOMAINS ##################
163
164 # Include "Kernel" domain. The script should not execute "include" if the contexts is in GBS service in OBS or GBS-Export
165 %{include_if_mainbuild %{SOURCE1001}}
166
167 # Include "systemfw" domain. The script should not execute "include" if the contexts is in GBS service in OBS or GBS-Export
168 %{include_if_mainbuild %{SOURCE1002}}
169
170 # And other domains
171 %{include_if_mainbuild %{SOURCE1010}}
172 %{include_if_mainbuild %{SOURCE1020}}
173 %{include_if_mainbuild %{SOURCE1030}}
174 %{include_if_mainbuild %{SOURCE1040}}
175 %{include_if_mainbuild %{SOURCE1050}}
176 %{include_if_mainbuild %{SOURCE1060}}
177 %{include_if_mainbuild %{SOURCE1070}}
178 %{include_if_mainbuild %{SOURCE1080}}
179 %{include_if_mainbuild %{SOURCE1090}}
180 %{include_if_mainbuild %{SOURCE1100}}
181
182 ############## EPIC FEATURES ######################
183
184 # Include "headless" epic feature. The script should not execute "include" if the contexts is in GBS service in OBS or GBS-Export
185 %{include_if_mainbuild %{SOURCE2001}}
186
187 # Dev tools
188 %{include_if_mainbuild %{SOURCE2010}}
189
190 # Platform features
191 %{include_if_mainbuild %{SOURCE2020}}
192
193
194 ############# PLATFORM PRESET #####################
195
196 # Tizen Platform Presets.
197 # Unlike Preset-Recipes of TIC, you cannot deselect packages from these presets.
198 %{include_if_mainbuild %{SOURCE3100}}
199 %{include_if_mainbuild %{SOURCE3200}}
200 %{include_if_mainbuild %{SOURCE3300}}
201 %{include_if_mainbuild %{SOURCE3400}}
202 %{include_if_mainbuild %{SOURCE3500}}
203 %{include_if_mainbuild %{SOURCE3600}}
204 %{include_if_mainbuild %{SOURCE3700}}
205 %{include_if_mainbuild %{SOURCE3800}}
206
207