%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
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
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}"
/opt/vc/include/*.h
/opt/vc/lib/pkgconfig/*.pc
+%files -n vcgencmd
+%manifest packaging/%{name}.manifest
+%license LICENSE
+%{_bindir}/vcgencmd
+%{_libdir}/vc/*.so