arch aarch64 targets armv7l:aarch64
+
swap-modules
-post "/opt/swap/sdk/deploy.sh"
- +/
+ post "/opt/swap/sdk/deploy.sh"
+ +/
+
+swap-modules-rpi3
+ provides "swap-modules"
+ provides "swap-modules = %{version}-%{release}"
+ post "ln -s /opt/swap/modules/rpi3 /opt/swap/sdk"
+ preun "rm /opt/swap/sdk"
+ +/
Vendor: Samsung
Source: swap-modules-3.0.tar.gz
+
+# Setup build config.
+# 0 - disable
+# 1 - enable
+%define BUILD_PACKAGE_RPI3 1
+
+
+# Validate build config.
+# If current architecture does not support configuration, it disables.
+%ifnarch aarch64
+ %define BUILD_PACKAGE_RPI3 0
+%endif
+
+
Requires: model-config
BuildRequires: perl
%endif
%install
+mkdir -p %{buildroot}/opt/swap/modules/
+
+%if %{BUILD_PACKAGE_RPI3}
+ cp -r /tmp/rpi3_swap_modules %{buildroot}/opt/swap/modules/rpi3
+%endif
+
mkdir -p %{buildroot}/opt/swap/sdk/
%ifarch armv7l
mv /tmp/tm1_swap_modules %{buildroot}/opt/swap/sdk/
%endif
%endif
/opt/swap/sdk/deploy.sh
+
+
+%if %{BUILD_PACKAGE_RPI3}
+%package rpi3
+Summary: SWAP modules for RPI3
+Provides: swap-modules
+Provides: swap-modules = %{version}-%{release}
+
+%description rpi3
+This package provides SWAP modules for RPI3
+
+%post rpi3
+ln -s /opt/swap/modules/rpi3 /opt/swap/sdk
+
+%preun rpi3
+rm /opt/swap/sdk
+
+%files rpi3
+%license LICENSE.GPL-2.0+
+/opt/swap/modules/rpi3/
+%endif # BUILD_PACKAGE_RPI3