Add the swap-modules-rpi3 package build 48/183348/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 4 Jul 2018 09:10:49 +0000 (12:10 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 4 Jul 2018 16:51:14 +0000 (19:51 +0300)
For enabling/disabling build of the swap-modules-rpi3 package
set BUILD_PACKAGE_RPI3 to 1/0.

Change-Id: Ib69beb17dc664abb00a13f7cfd1c6b64eaa87c1d
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
packaging/baselibs.conf
packaging/swap-modules.spec

index b09b3c9..483e88e 100644 (file)
@@ -1,4 +1,12 @@
 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"
+  +/
index 222e96b..5fa4fd4 100755 (executable)
@@ -9,6 +9,20 @@ Group: System Environment/Kernel
 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
@@ -94,6 +108,12 @@ cd modules
 %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/
@@ -138,3 +158,24 @@ install -m 770 modules/deploy.sh -t %{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