%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
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
# 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
-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