Prepare Tizen 4.0 Unified Build Environment 30/104130/4 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/4.0/unified/20170816.012333 accepted/tizen/4.0/unified/20170816.015246 accepted/tizen/4.0/unified/20170828.222904 accepted/tizen/common/20161214.160934 accepted/tizen/ivi/20161214.090351 accepted/tizen/mobile/20161214.090316 accepted/tizen/tv/20161214.090323 accepted/tizen/unified/20170309.035704 accepted/tizen/wearable/20161214.090344 submit/tizen/20161214.083242 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100006 submit/tizen_4.0_unified/20170814.115522 submit/tizen_unified/20170308.100413 tizen_4.0.m1_release
authorHyungGi Lee <hyunggi.lee@samsung.com>
Mon, 12 Dec 2016 10:56:01 +0000 (19:56 +0900)
committerHyungGi Lee <hyunggi.lee@samsung.com>
Mon, 12 Dec 2016 14:02:49 +0000 (23:02 +0900)
- create ks file for all profiles in the same repos
- remove profile macro
- for legacy support  with legacy_imageconfig macro

Change-Id: I3bbb53113296019f9784d46ddfcecaf38e3dc1ff

packaging/image-configurations.spec

index 5ca807b..2f3a5c8 100644 (file)
@@ -4,6 +4,11 @@
 %define _profile base
 %endif
 
+%if "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}"=="tv" || "%{?profile}" == "ivi" || "%{?profile}" == "common"
+%define _with_legacy_imageconfig 1
+%endif
+%bcond_with legacy_imageconfig
+
 %define baseline tizen-3.0
 
 Summary:       Create kickstart files for Tizen images
@@ -19,7 +24,15 @@ Source1001:  image-configurations.manifest
 BuildArch:     noarch
 BuildRequires:  kickstarter >= 0.15
 BuildRequires:  meta-generic
+%if %{with legacy_imageconfig}
 BuildRequires:  meta-%{_profile}
+%else
+BuildRequires: meta-common
+BuildRequires: meta-mobile
+BuildRequires: meta-wearable
+BuildRequires: meta-tv
+BuildRequires: meta-ivi
+%endif
 BuildRequires:  package-groups
 BuildRequires:  python
 
@@ -35,10 +48,11 @@ cp %{SOURCE1001} .
 
 # merge the configuration files from generic and the current profile
 # in the same input dir to make kickstarter aware of the generic scripts.
+%if %{with legacy_imageconfig}
 mkdir -p input
 for profile in generic %_profile; do
-       pdir=%{_datadir}/image-configurations/$profile
-       [ -d $pdir ] && cp -a $pdir/* input/
+    pdir=%{_datadir}/image-configurations/$profile
+    [ -d $pdir ] && cp -a $pdir/* input/
 done
 
 pdir=%{_datadir}/package-groups
@@ -50,6 +64,31 @@ kickstarter -c input/%_profile.yaml \
     -T input/%_profile-targets.yaml \
     -t %{_repository} \
     -i image-configs.xml
+%else
+echo "<image-configs>" > image-configs.xml
+for profile in common mobile tv wearable ivi; do
+    mkdir -p input-$profile
+    for pn in generic $profile; do
+        pdir=%{_datadir}/image-configurations/$pn
+        [ -d $pdir ] && cp -a $pdir/* input-$profile/
+    done
+
+    kickstarter -c input-$profile/$profile.yaml \
+        -e input-$profile/configs \
+        -r input-$profile/$profile-repos.yaml \
+        -T input-$profile/$profile-targets.yaml \
+        -t %{_repository} \
+        -i image-configs_$profile.xml
+
+    cat image-configs_$profile.xml | sed 's/<image-configs>//g' |sed 's/<\/image-configs>//g' >> image-configs.xml
+done
+echo "</image-configs>" >> image-configs.xml
+
+# copy groups.xml file to input for convert_ks.py
+mkdir -p input
+pdir=%{_datadir}/package-groups
+[ -d "$pdir" ] && cp "$pdir/group.xml" input/
+%endif
 
 %install