[Update] Addding a macro for removing device-dependant package from ks 12/143412/1
authorwchang kim <wchang.kim@samsung.com>
Wed, 9 Aug 2017 23:58:41 +0000 (08:58 +0900)
committerwchang kim <wchang.kim@samsung.com>
Wed, 9 Aug 2017 23:58:41 +0000 (08:58 +0900)
file.

Change-Id: I1fae8553602b9c65d9c32fc4da4f48fdeea1dccc
Signed-off-by: Woochang Kim <wchang.kim@samsung.com>
packaging/building-blocks.spec
packaging/platform-preset-iot.inc

index 8ec5b21401d9627ed0c967a9b1b0408ed3360a33..e818528c73b41f7f152b49c20f4acdf3369da15e 100644 (file)
@@ -127,6 +127,40 @@ presets describing specific products.
        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 \
index 8aadf875ff35bd1b63ba2a177b7685599bd45e17..b8b8601244a5545d02bd345c697f80b0bbce71e0 100644 (file)
@@ -3,7 +3,7 @@
 
 %package root-Preset_iot_core
 Summary:    IOT Core Presets
-%list_with_require %{_datadir}/image-configurations/common-iot_core-2parts-armv7l-rpi3.ks
+%list_with_require_nodep_device %{_datadir}/image-configurations/common-iot_core-2parts-armv7l-rpi3.ks
 %description root-Preset_iot_core
 __EXPAND__: preset
 The packages of Tizen IoT Core.