diff --git a/09-filelayout.patch b/09-filelayout.patch new file mode 100644 index 0000000..0d902e3 --- /dev/null +++ b/09-filelayout.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -33,7 +33,7 @@ LL2 = -L. -lpigpiod_if -pthread -lr + + LL3 = -L. -lpigpiod_if2 -pthread -lrt + +-prefix = /usr/local ++prefix = /usr + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + includedir = $(prefix)/include + diff --git a/pigpio-1.79.tar.gz b/pigpio-1.79.tar.gz new file mode 100644 index 0000000..f4a5e00 Binary files /dev/null and b/pigpio-1.79.tar.gz differ diff --git a/pigpio.spec b/pigpio.spec new file mode 100644 index 0000000..bde9461 --- /dev/null +++ b/pigpio.spec @@ -0,0 +1,70 @@ +%global _lib_path /usr/lib +%global _include_path /usr/include +%global _bin_path /usr/bin +%global _man1_path /usr/man/man1 +%global _man3_path /usr/man/man3 +%global _opt_path /opt/pigpio/cgi +%global _doc_path /usr/share/doc/pigpio +%global _service_path /usr/lib/systemd/system +%global debug_package %{nil} + +Name: pigpio +Version: 1.79 +Release: 1 +Summary: library for GPIO on RPi +License: Unlicense +URL: https://github.com/joan2937/pigpio +Source0: https://github.com/joan2937/pigpio/archive/%{version}/pigpio-%{version}.tar.gz + +Patch0000: 09-filelayout.patch +Patch0001: remove-broken-comments-from-top-of-manpa.patch +Patch0002: pigpiod-service.patch + +BuildRequires: make >= 3.78 +BuildRequires: gcc >= 3.4.2 +AutoReq: no +AutoProv: yes + +Provides: pigpio = %{version}-%{release} + +ExclusiveArch: aarch64 +ExclusiveOS: Linux + +%description +Library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO) + +%prep +%setup -q -n %{name}-%{version} -c +mv %{name} %{name}-%{version} + +cd %{name}-%{version} +%patch0000 -p1 +%patch0001 -p1 +%patch0002 -p1 + +%build +cd %{name}-%{version} +make + +%install +mkdir -p %{buildroot}%{_service_path} +mkdir -p %{buildroot}%{_doc_path} +cd %{name}-%{version} +make install DESTDIR=%{buildroot} +install -p -m 644 util/pigpiod.service %{buildroot}%{_service_path} +install -p -m 644 UNLICENCE %{buildroot}%{_doc_path} + +%files +%defattr (-, root, root) +%doc +/usr/lib/* +/usr/include/* +/usr/bin/* +/usr/lib/systemd/system/* +/usr/man/man1/* +/usr/man/man3/* +/usr/share/doc/pigpio/* + +%changelog +* Mon May 17 2021 Yafen Fang - 1.79-1 +- init package \ No newline at end of file diff --git a/pigpiod-service.patch b/pigpiod-service.patch new file mode 100644 index 0000000..f9aa94d --- /dev/null +++ b/pigpiod-service.patch @@ -0,0 +1,16 @@ +--- a/util/pigpiod.service ++++ b/util/pigpiod.service +@@ -1,10 +1,9 @@ + [Unit] +-Description=Pigpio daemon +- ++Description=Daemon required to control GPIO pins via pigpio + [Service] ++ExecStart=/usr/bin/pigpiod -l ++ExecStop=/bin/systemctl kill pigpiod + Type=forking +-PIDFile=pigpio.pid +-ExecStart=/usr/bin/pigpiod + + [Install] + WantedBy=multi-user.target diff --git a/remove-broken-comments-from-top-of-manpa.patch b/remove-broken-comments-from-top-of-manpa.patch new file mode 100644 index 0000000..49df5d9 --- /dev/null +++ b/remove-broken-comments-from-top-of-manpa.patch @@ -0,0 +1,48 @@ +From: Peter Michael Green +Date: Thu, 10 Jan 2019 15:14:35 +0000 +X-Dgit-Generated: 1.68-1 62ec7220f74092d1ccfa9b156f09c5a2bcd5b50e +Subject: Remove broken comments from top of manpages. + + +--- + +--- a/pig2vcd.1 ++++ b/pig2vcd.1 +@@ -1,7 +1,4 @@ + +-." Process this file with +-." groff -man -Tascii pig2vcd.1 +-." + .TH pig2vcd 1 2012-2020 Linux "pigpio archive" + .SH NAME + pig2vd - A utility to convert pigpio notifications to VCD. +--- a/pigpiod_if.3 ++++ b/pigpiod_if.3 +@@ -1,7 +1,4 @@ + +-." Process this file with +-." groff -man -Tascii pigpiod_if.3 +-." + .TH pigpiod_if 3 2012-2020 Linux "pigpio archive" + .SH NAME + pigpiod_if - A C library to interface to the pigpio daemon. +--- a/pigpiod_if2.3 ++++ b/pigpiod_if2.3 +@@ -1,7 +1,4 @@ + +-." Process this file with +-." groff -man -Tascii pigpiod_if2.3 +-." + .TH pigpiod_if2 3 2012-2020 Linux "pigpio archive" + .SH NAME + pigpiod_if2 - A C library to interface to the pigpio daemon. +--- a/pigs.1 ++++ b/pigs.1 +@@ -1,7 +1,4 @@ + +-." Process this file with +-." groff -man -Tascii foo.1 +-." + .TH pigs 1 2012-2020 Linux "pigpio archive" + .SH NAME + pigs - command line socket access to the pigpio daemon.