packaging: add vcgencmd tool for raspberry pi 12/263312/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 5 Mar 2021 09:06:09 +0000 (18:06 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 1 Sep 2021 01:15:17 +0000 (01:15 +0000)
There is vcgencmd usage for raspberry pi, so add package only with
vcgencmd and dependent libraries and set exact RUNPATH to find
library in %{_libdir}/vc.

Note: picked commit from tizen branch and change install path to
/usr because /hal path is not added to tizen 6.0.

Change-Id: Ie0421c0be0f27ca014af6d369924f9b612b6b928
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
packaging/libomxil-vc4.spec

index 05627b0..8bd2583 100755 (executable)
@@ -30,6 +30,14 @@ Requires:      %{name} = %{version}
 %description   devel
 This package contains libraries and header files for developing applications that use Raspberry Pi GPU.
 
+%package -n    vcgencmd
+Group:         System/Tools
+Summary:       vcgencmd tools for the Raspberry Pi
+
+%description -n vcgencmd
+This package contains vcgencmd system tools for the Raspberry Pi.
+Source: https://github.com/raspberrypi/userland.git
+
 %prep
 %setup -q
 
@@ -38,7 +46,8 @@ BUILDTYPE=Release
 BUILDSUBDIR=`echo $BUILDTYPE | tr '[A-Z]' '[a-z]'`;
 mkdir -p build/armv7l-linux/$BUILDSUBDIR
 pushd build/armv7l-linux/$BUILDSUBDIR
-cmake -DCMAKE_BUILD_TYPE=Release ../../../
+cmake -DCMAKE_BUILD_TYPE=Release ../../../ \
+       -DCMAKE_INSTALL_RPATH=%{_libdir}/vc
 make %{?_smp_mflags}
 popd
 
@@ -89,6 +98,21 @@ cp -a %{_builddir}/%{name}-%{version}/vcinclude ./
 cp %{_builddir}/%{name}-%{version}/host_applications/linux/libs/bcm_host/include/bcm_host.h ./
 popd
 
+# install and package vcgencmd with RPATH
+BUILDTYPE=Release
+BUILDSUBDIR=`echo $BUILDTYPE | tr '[A-Z]' '[a-z]'`;
+pushd build/armv7l-linux/$BUILDSUBDIR
+make install \
+       DESTDIR=%{_builddir}/%{name}-%{version}/build/armv7l-linux/install \
+       INSTALL_ROOT=%{_builddir}/%{name}-%{version}/build/armv7l-linux/install
+popd
+
+mkdir -p %{buildroot}/%{_bindir}
+mkdir -p %{buildroot}/%{_libdir}/vc
+cp build/armv7l-linux/install/opt/vc/bin/vcgencmd %{buildroot}/%{_bindir}
+cp build/armv7l-linux/install/opt/vc/lib/libvchiq_arm.so %{buildroot}/%{_libdir}/vc
+cp build/armv7l-linux/install/opt/vc/lib/libvcos.so %{buildroot}/%{_libdir}/vc
+
 %clean
 [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
 
@@ -118,3 +142,8 @@ popd
 /opt/vc/include/*.h
 /opt/vc/lib/pkgconfig/*.pc
 
+%files -n vcgencmd
+%manifest packaging/%{name}.manifest
+%license LICENSE
+%{_bindir}/vcgencmd
+%{_libdir}/vc/*.so