init package

This commit is contained in:
yafen 2024-04-28 21:28:56 +08:00
parent ef6492443e
commit bd22ac2c43
4 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,8 @@
--- a/overlaycheck/overlaycheck
+++ b/overlaycheck/overlaycheck
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
use strict;
use warnings;

View File

@ -0,0 +1,19 @@
--- a/overlaycheck/CMakeLists.txt
+++ b/overlaycheck/CMakeLists.txt
@@ -7,4 +7,4 @@ project(overlaycheck)
#add executables
install(PROGRAMS overlaycheck DESTINATION ${CMAKE_INSTALL_BINDIR})
-install(FILES overlaycheck_exclusions.txt DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES overlaycheck_exclusions.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/raspi-utils)
--- a/overlaycheck/overlaycheck
+++ b/overlaycheck/overlaycheck
@@ -99,7 +99,7 @@ my @cpp_cmd = ('arm-linux-gnueabihf-cpp'
'assembler-with-cpp');
my $DTC = "$kerndir/scripts/dtc/dtc";
-my $exclusions_file = $0 . "_exclusions.txt";
+my $exclusions_file = "/usr/share/raspi-utils/overlaycheck_exclusions.txt";
my @warnings_to_suppress = ('unit_address_vs_reg',
'simple_bus_reg',
'unit_address_format',

86
raspberrypi-utils.spec Normal file
View File

@ -0,0 +1,86 @@
%global _completions_dir /usr/share/bash-completion/completions
%global _usrshare_dir /usr/share/raspi-utils
%global commitid 6b669633d75d22d45d5218e5af6d7a83db52e42c
%global debug_package %{nil}
Name: raspberrypi-utils
Version: 20240428
Release: 1
Summary: Collection of Raspberry Pi utilities (scripts and simple applications)
License: BSD-3-Clause
URL: https://github.com/raspberrypi/utils
Source0: https://github.com/raspberrypi/utils/archive/%{commitid}/utils-%{commitid}.tar.gz
Patch0001: 0001-overlaycheck-perl.patch
Patch0002: 0002-overlaycheck-CMakeLists.patch
BuildRequires: cmake dtc-devel python3 gcc gcc-c++
# Conflicts: libraspberrypi-bin
AutoReq: no
AutoProv: yes
Provides: raspberrypi-utils = %{version}-%{release}
ExclusiveArch: aarch64
ExclusiveOS: Linux
%description
This package contains collection of scripts and simple applications on Raspberry Pi.
%prep
%setup -q -n %{name}-%{version} -c
mv utils-%{commitid} %{name}-%{version}
cd %{name}-%{version}
%patch0001 -p1
%patch0002 -p1
%build
cd %{name}-%{version}
cmake -B build
cmake --build build
%install
cd %{name}-%{version}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_completions_dir}
mkdir -p %{buildroot}%{_usrshare_dir}
mkdir -p %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man7
install -m 0755 build/dtmerge/dtmerge %{buildroot}%{_bindir}
install -m 0755 build/dtmerge/dtoverlay %{buildroot}%{_bindir}
install -m 0755 build/eeptools/eepdump %{buildroot}%{_bindir}
install -m 0755 build/eeptools/eepmake %{buildroot}%{_bindir}
install -m 0755 build/pinctrl/pinctrl %{buildroot}%{_bindir}
install -m 0755 build/vcgencmd/vcgencmd %{buildroot}%{_bindir}
install -m 0755 build/vclog/vclog %{buildroot}%{_bindir}
install -m 0755 build/vcmailbox/vcmailbox %{buildroot}%{_bindir}
install -m 0755 otpset/otpset %{buildroot}%{_bindir}
install -m 0755 overlaycheck/overlaycheck %{buildroot}%{_bindir}
install -m 0755 ovmerge/ovmerge %{buildroot}%{_bindir}
install -m 0755 raspinfo/raspinfo %{buildroot}%{_bindir}
install -m 0755 eeptools/eepflash.sh %{buildroot}%{_bindir}
pushd %{buildroot}%{_bindir}
ln -sf dtoverlay dtparam
popd
install -m 0644 pinctrl/pinctrl-completion.bash %{buildroot}%{_completions_dir}/pinctrl
install -m 0644 vcgencmd/vcgencmd-completion.bash %{buildroot}%{_completions_dir}/vcgencmd
install -m 0644 overlaycheck/overlaycheck_exclusions.txt %{buildroot}%{_usrshare_dir}
gzip -c dtmerge/dtmerge.1 > %{buildroot}%{_mandir}/man1/dtmerge.1.gz
gzip -c dtmerge/dtoverlay.1 > %{buildroot}%{_mandir}/man1/dtoverlay.1.gz
gzip -c dtmerge/dtparam.1 > %{buildroot}%{_mandir}/man1/dtparam.1.gz
gzip -c vcgencmd/vcgencmd.1 > %{buildroot}%{_mandir}/man1/vcgencmd.1.gz
gzip -c vcmailbox/vcmailbox.1 > %{buildroot}%{_mandir}/man1/vcmailbox.1.gz
gzip -c vcmailbox/raspiotp.7 > %{buildroot}%{_mandir}/man7/raspiotp.7.gz
gzip -c vcmailbox/raspirev.7 > %{buildroot}%{_mandir}/man7/raspirev.7.gz
gzip -c vcmailbox/vcmailbox.7 > %{buildroot}%{_mandir}/man7/vcmailbox.7.gz
%files
%defattr (-, root, root)
%license %{name}-%{version}/LICENCE
%{_bindir}/*
%{_mandir}/*
%{_completions_dir}/*
%dir %{_usrshare_dir}
%{_usrshare_dir}/*
%changelog
* Sun Apr 28 2024 Yafen Fang<yafen@iscas.ac.cn> - 20240428-1
- init package

Binary file not shown.