# Setup build config.
# 0 - disable
# 1 - enable
+%define BUILD_PACKAGE_TM1 1
%define BUILD_PACKAGE_TM2 1
%define BUILD_PACKAGE_TW2 1
%define BUILD_PACKAGE_RPI3 1
# Validate build config.
# If current architecture does not support configuration, it disables.
+%ifnarch %arm
+ %define BUILD_PACKAGE_TM1 0
+%endif
%ifnarch aarch64
%define BUILD_PACKAGE_TM2 0
%define BUILD_PACKAGE_TW2 0
%install
mkdir -p %{buildroot}/opt/swap/modules/
+%if %{BUILD_PACKAGE_TM1}
+ cp -r /tmp/tm1_swap_modules %{buildroot}/opt/swap/modules/tm1
+%endif
+
%if %{BUILD_PACKAGE_TM2}
cp -r /tmp/tm2_swap_modules %{buildroot}/opt/swap/modules/tm2
%endif
/opt/swap/sdk/deploy.sh
+%if %{BUILD_PACKAGE_TM1}
+%package tm1
+Summary: SWAP modules for TM1
+Provides: swap-modules
+Provides: swap-modules = %{version}-%{release}
+
+%description tm1
+This package provides SWAP modules for TM1
+
+%post tm1
+ln -s /opt/swap/modules/tm1 /opt/swap/sdk
+
+%preun tm1
+rm /opt/swap/sdk
+
+%files tm1
+%license LICENSE.GPL-2.0+
+/opt/swap/modules/tm1/
+%endif # BUILD_PACKAGE_TM1
+
%if %{BUILD_PACKAGE_TM2}
%package tm2
Summary: SWAP modules for TM2