%global snapshot_date 20230420 %global snapshot_commit cc1ca18fb0689b01cc2ca2aa4b400dcee624a213 %global package_release 11 %global snapshot_commit_short %(c=%{snapshot_commit}; echo ${c:0:7}) %global snapshot_info %{snapshot_date}git%{snapshot_commit_short} %global github_user_name raspberrypi %global github_repo_name userland %global udev_rule 92-local-vchiq-permissions.rules Name: %{github_user_name}-%{github_repo_name} Version: 0 Release: %{package_release}.%{snapshot_info}%{?dist} Summary: ARM-side programs for interfacing to Raspberry Pi GPU License: BSD URL: https://github.com/%{github_user_name}/%{github_repo_name} ExclusiveArch: %{arm} aarch64 Source0: https://github.com/%{github_user_name}/%{github_repo_name}/archive/%{snapshot_commit}/%{github_repo_name}-%{snapshot_commit}.tar.gz BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make # For '_udevrulesdir' RPM macro BuildRequires: systemd-rpm-macros %description %{name} includes ARM-side binaries and libraries used on Raspberry Pi. It provides the 'vcgencmd' program, which can be used to get information from Raspberry Pi's VideoCore GPU. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains files for developing programs based on the libraries provided by the %{name} package. %package static Summary: Static libraries for %{name} %description static This package contains static libraries for %{name}. %prep %setup -q -n %{github_repo_name}-%{snapshot_commit} # Library path fix-up grep -lr 'DESTINATION lib' | xargs sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' grep -lr '${exec_prefix}/lib' | xargs sed -i 's/${exec_prefix}\/lib/${exec_prefix}\/%{_lib}/' grep -lr '${CMAKE_INSTALL_PREFIX}/lib' | xargs sed -i 's/${CMAKE_INSTALL_PREFIX}\/lib/${CMAKE_INSTALL_PREFIX}\/%{_lib}/' grep -lr '${VIDEOCORE_BUILD_DIR}/lib' | xargs sed -i 's/${VIDEOCORE_BUILD_DIR}\/lib/${VIDEOCORE_BUILD_DIR}\/%{_lib}/' # Manual pages path fix-up grep -lr 'DESTINATION man' | xargs sed -i 's/DESTINATION man/DESTINATION share\/man/g' %build # Generate Makefile using cmake /usr/bin/cmake \ -DCMAKE_BUILD_TYPE=Release \ -DVMCS_INSTALL_PREFIX=%{_prefix} \ %ifarch aarch64 -DARM64=ON \ %endif . %make_build %install %make_install # Remove the source code of 'hello_pi' test apps rm -r %{buildroot}%{_usrsrc}/hello_pi # Install udev rule mkdir -p %{buildroot}%{_udevrulesdir} cat > %{buildroot}%{_udevrulesdir}/%{udev_rule} <<- _EOF_ KERNEL=="vchiq",GROUP="video",MODE="0660" _EOF_ chmod 0644 %{buildroot}%{_udevrulesdir}/%{udev_rule} %post udevadm trigger /dev/vchiq %files %license LICENCE %{_bindir}/* %{_libdir}/*.so %{_mandir}/* %{_udevrulesdir}/%{udev_rule} %files devel %{_includedir}/* %{_libdir}/pkgconfig/* %files static %{_libdir}/*.a %changelog * Sun Apr 23 2023 Leo - 0-11.20230420gitcc1ca18 - New upstream Git snapshot * Tue Mar 8 2022 Leo - 0-10.20220202git8fa944c - Update udev rule for latest kernel versions * Wed Feb 2 2022 Leo - 0-9.20220202git8fa944c - New upstream Git snapshot * Tue Sep 28 2021 Leo - 0-8.20210928git6e8f786 - New upstream Git snapshot - Change URL to udev rule for vchiq * Mon Apr 26 2021 Leo - 0-7.20210426git45a0022 - New upstream Git snapshot - Add support for manual pages * Fri Mar 19 2021 Leo - 0-6.20210319git3fd8527 - New upstream Git snapshot * Mon Jan 11 2021 Leo - 0-5.20210111git4a0a19b - New upstream Git snapshot * Fri Oct 23 2020 Leo - 0-4.20201023gite432bc3 - New upstream Git snapshot - Let new udev rule take effect immediately after installation * Wed Sep 23 2020 Leo - 0-3.20200813gitf73fca0 - Add udev rule for vhciq - Move all shared objects from devel to main package * Thu Aug 13 2020 Leo - 0-2.20200813gitf73fca0 - New upstream Git snapshot * Fri Jul 31 2020 Leo - 0-1.20200728git3e59217 - Initial build