2 Commits

Author SHA256 Message Date
3778107eea Accepting request 1302440 from hardware
OBS-URL: https://build.opensuse.org/request/show/1302440
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libgpiod?expand=0&rev=17
2025-09-02 18:02:39 +00:00
d1190ba969 - version update to 2.2.2
* don't implicity unquote unnamed lines in gpioinfo
  * remove useless variable in reconfigure example
  * don't let struct line_config balloon out of control and trigger an OOM
  * drop python3-config check from configure.ac

OBS-URL: https://build.opensuse.org/package/show/hardware/libgpiod?expand=0&rev=38
2025-09-02 13:57:37 +00:00
5 changed files with 162 additions and 44 deletions

4
gpiod-sysusers.conf Normal file
View File

@@ -0,0 +1,4 @@
#Type Name ID GECOS Home directory Shell
g gpio -
u gpio-manager - "gpio-manager account" - -
m gpio-manager gpio

Binary file not shown.

3
libgpiod-2.2.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0b1380c3cbabbb49b82f709b3288376d98347d4436613407d19cc4cbbfc45a6
size 297220

View File

@@ -1,7 +1,18 @@
-------------------------------------------------------------------
Wed Jun 18 06:32:01 UTC 2025 - pgajdos@suse.com
Tue Sep 2 13:32:45 UTC 2025 - pgajdos@suse.com
- tests build for openSUSE only [bsc#1243926]
- version update to 2.2.2
* don't implicity unquote unnamed lines in gpioinfo
* remove useless variable in reconfigure example
* don't let struct line_config balloon out of control and trigger an OOM
* drop python3-config check from configure.ac
-------------------------------------------------------------------
Mon Jun 16 14:42:34 UTC 2025 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Upgrade to 2.2.1
* Major rework / Breaks API
* Support Catch2 v3
-------------------------------------------------------------------
Fri Oct 14 08:01:13 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package libgpiod
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,45 +16,51 @@
#
%define libgpiod_soversion 2
%define libgpiodcxx_soversion 1
%define libgpiomockup_soversion 0
# Tests are only available for kernel 5.5+ (so TW and 15.4+ only)
%define libgpiod_soversion 3
%define libgpiodbus_soversion 1
%define libgpiodcxx_soversion 2
%define libgpiodglib_soversion 1
%define libgpiosim_soversion 1
# Enable tests on openSUSE only - bsc#1243926
%if 0%{?is_opensuse}
%bcond_without libgpiod_tests
%else
%bcond_with libgpiod_tests
%endif
# Enable python
%bcond_without libgpiod_python
Name: libgpiod
Version: 1.6.3
Version: 2.2.2
Release: 0
Summary: C library and tools for interacting with the linux GPIO character device
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/
Source0: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-%{version}.tar.gz
BuildRequires: autoconf
Source1: gpiod-sysusers.conf
BuildRequires: autoconf >= 2.71
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libgudev-1_0-devel >= 230
BuildRequires: libkmod-devel
BuildRequires: libtool
BuildRequires: make
%if %{with libgpiod_python}
BuildRequires: python3-devel >= 3.5
%if %{with libgpiod_tests}
%if 0%{suse_version} > 1550
# Only Tumbleweed bumped Catch2 to version 3.x
BuildRequires: Catch2-2-devel
%else
BuildRequires: Catch2-devel
BuildRequires: python3-pip
BuildRequires: python3-setuptools
%endif
%if %{with libgpiod_tests}
BuildRequires: Catch2-devel
BuildRequires: glib2-devel >= 2.50
BuildRequires: kernel-devel >= 5.5
BuildRequires: pkgconfig(libudev)
%else
BuildRequires: kernel-devel >= 4.8
%endif
BuildRequires: systemd
%description
The libgpiod library encapsulates the ioctl calls and data structures
@@ -64,8 +70,6 @@ GPIO sysfs interface in Linux 4.8.
%package utils
Summary: Tools for interacting with the linux GPIO character device
Group: Development/Libraries/C and C++
Provides: libgpiod = %{version}-%{release}
Obsoletes: libgpiod < %{version}-%{release}
%description utils
The libgpiod library encapsulates the ioctl calls and data structures
@@ -86,6 +90,18 @@ GPIO sysfs interface in Linux 4.8.
C library part.
%package -n libgpiodbus%{libgpiodbus_soversion}
Summary: DBus for libgpiod
Group: System/Libraries
Conflicts: libgpiod1
%description -n libgpiodbus%{libgpiodbus_soversion}
The libgpiod library encapsulates the ioctl calls and data structures
of the GPIO character devices, the latter of which superseded the
GPIO sysfs interface in Linux 4.8.
DBus part.
%package -n libgpiodcxx%{libgpiodcxx_soversion}
Summary: C++library for interacting with the linux GPIO character device
Group: System/Libraries
@@ -98,17 +114,29 @@ GPIO sysfs interface in Linux 4.8.
C++ library part.
%package -n libgpiomockup%{libgpiomockup_soversion}
Summary: C library for interacting with the linux GPIO character device
%package -n libgpiod-glib%{libgpiodglib_soversion}
Summary: GLib2 binding for libgpiod
Group: System/Libraries
Conflicts: libgpiod1
%description -n libgpiomockup%{libgpiomockup_soversion}
%description -n libgpiod-glib%{libgpiodglib_soversion}
The libgpiod library encapsulates the ioctl calls and data structures
of the GPIO character devices, the latter of which superseded the
GPIO sysfs interface in Linux 4.8.
GPIO mockup library part.
Glib2 binding part.
%package -n libgpiosim%{libgpiosim_soversion}
Summary: C library for controlling the gpio-sim kernel module
Group: System/Libraries
Conflicts: libgpiod1
%description -n libgpiosim%{libgpiosim_soversion}
The libgpiod library encapsulates the ioctl calls and data structures
of the GPIO character devices, the latter of which superseded the
GPIO sysfs interface in Linux 4.8.
GPIO sim library part. (This aims at replacing the old gpio-mockup)
%package devel
Summary: Devel files for libgpiod
@@ -117,7 +145,7 @@ Requires: %{name} = %{version}
Requires: libgpiod%{libgpiod_soversion} = %{version}
Requires: libgpiodcxx%{libgpiodcxx_soversion} = %{version}
%if %{with libgpiod_tests}
Requires: libgpiomockup%{libgpiomockup_soversion} = %{version}
Requires: libgpiosim%{libgpiosim_soversion} = %{version}
%endif
%description devel
@@ -127,6 +155,7 @@ GPIO sysfs interface in Linux 4.8.
Devel files part.
%if %{with libgpiod_python}
%package -n python3-gpiod
Summary: Python binding for libgpiod
Group: Development/Languages/Python
@@ -139,67 +168,141 @@ of the GPIO character devices, the latter of which superseded the
GPIO sysfs interface in Linux 4.8.
Python binding part.
%endif
%package manager
Summary: DBus manager for GPIO
Requires: %{name}%{?_isa} = %{version}-%{release}
%description manager
DBus manager for interacting with GPIO character devices.
%prep
%autosetup -p1
# python bindings build is set to use isolation. Remove this for distro build so it uses the
# system installed dependencies instead of trying to use pip to install from the network
sed -i 's/-m build/-m pip wheel --wheel-dir dist --no-build-isolation ./' bindings/python/Makefile*
# Once the following commit is merged, replace the above line with the command below:
# https://lore.kernel.org/linux-gpio/20250407181116.1070816-1-yselkowi@redhat.com/T/#u
#sed -i 's/-m pip wheel/& --no-build-isolation/' bindings/python/Makefile*
%build
./autogen.sh
%configure \
--enable-dbus \
--enable-systemd \
%if %{with libgpiod_tests}
--enable-tests \
--enable-tests \
%endif
--enable-tools=yes \
--enable-bindings-python \
--enable-bindings-cxx
--enable-tools=yes \
%if %{with libgpiod_python}
--enable-bindings-python \
%else
--disable-bindings-python \
%endif
--enable-bindings-glib \
--enable-bindings-cxx \
--disable-bindings-rust \
--disable-static
make %{?_smp_mflags}
%install
%make_install
rm -rf %{buildroot}%{_libdir}/*.{a,la}
rm -rf %{buildroot}%{python3_sitearch}/*.{a,la}
%if %{with libgpiod_tests}
# Fix scripts interpreters
sed -i 's#%{_bindir}/env bash#/bin/bash#' %{buildroot}/%{_bindir}/gpio-tools-test
sed -i 's#%{_bindir}/env bats#%{_bindir}/bats#' %{buildroot}/%{_bindir}/gpio-tools-test.bats
sed -i 's#%{_bindir}/env python3#%{_bindir}/python3#' %{buildroot}/%{_bindir}/gpiod_py_test.py
# Install sysusers file
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/gpiod.conf
# Fix udev rule location
%ifnarch %{ix86} %{arm}
mkdir -p %{buildroot}/%{_udevrulesdir}/
mv -f %{buildroot}/%{_libdir}/udev/rules.d/90-gpio.rules %{buildroot}/%{_udevrulesdir}/90-gpio.rules
%endif
# Remove libtool archives.
find %{buildroot} -name '*.la' -delete
%post -n libgpiod%{libgpiod_soversion} -p /sbin/ldconfig
%postun -n libgpiod%{libgpiod_soversion} -p /sbin/ldconfig
%post -n libgpiodcxx%{libgpiodcxx_soversion} -p /sbin/ldconfig
%postun -n libgpiodcxx%{libgpiodcxx_soversion} -p /sbin/ldconfig
%post -n libgpiodbus%{libgpiodbus_soversion} -p /sbin/ldconfig
%postun -n libgpiodbus%{libgpiodbus_soversion} -p /sbin/ldconfig
%post -n libgpiod-glib%{libgpiodglib_soversion} -p /sbin/ldconfig
%postun -n libgpiod-glib%{libgpiodglib_soversion} -p /sbin/ldconfig
%if %{with libgpiod_tests}
%post -n libgpiomockup%{libgpiomockup_soversion} -p /sbin/ldconfig
%postun -n libgpiomockup%{libgpiomockup_soversion} -p /sbin/ldconfig
%post -n libgpiosim%{libgpiosim_soversion} -p /sbin/ldconfig
%postun -n libgpiosim%{libgpiosim_soversion} -p /sbin/ldconfig
%endif
%pre manager
%service_add_pre gpio-manager.service
%post manager
%service_add_post gpio-manager.service
%preun manager
%service_del_preun gpio-manager.service
%postun manager
%service_del_postun gpio-manager.service
%files
%license COPYING
%doc README.md
%{_sysusersdir}/gpiod.conf
%{_udevrulesdir}/90-gpio.rules
%files utils
%{_bindir}/gpio*
%{_bindir}/gpiodetect
%{_bindir}/gpioget
%{_bindir}/gpioinfo
%{_bindir}/gpiomon
%{_bindir}/gpionotify
%{_bindir}/gpioset
#%%{_mandir}/man*/gpio*
%files -n libgpiod%{libgpiod_soversion}
%{_libdir}/libgpiod.so.%{libgpiod_soversion}
%{_libdir}/libgpiod.so.%{libgpiod_soversion}.*
%files -n libgpiodbus%{libgpiodbus_soversion}
%{_libdir}/libgpiodbus.so.%{libgpiodbus_soversion}
%{_libdir}/libgpiodbus.so.%{libgpiodbus_soversion}.*
%files -n libgpiodcxx%{libgpiodcxx_soversion}
%{_libdir}/libgpiodcxx.so.%{libgpiodcxx_soversion}
%{_libdir}/libgpiodcxx.so.%{libgpiodcxx_soversion}.*
%files -n libgpiod-glib%{libgpiodglib_soversion}
%{_libdir}/libgpiod-glib.so.%{libgpiodglib_soversion}
%{_libdir}/libgpiod-glib.so.%{libgpiodglib_soversion}.*
%if %{with libgpiod_tests}
%files -n libgpiomockup%{libgpiomockup_soversion}
%{_libdir}/libgpiomockup.so.%{libgpiomockup_soversion}
%{_libdir}/libgpiomockup.so.%{libgpiomockup_soversion}.*
%files -n libgpiosim%{libgpiosim_soversion}
%{_libdir}/libgpiosim.so.%{libgpiosim_soversion}
%{_libdir}/libgpiosim.so.%{libgpiosim_soversion}.*
%endif
%files devel
%{_includedir}/*.h*
%dir %{_includedir}/gpiod-glib/
%{_includedir}/gpiod-glib/*.h
%dir %{_includedir}/gpiodcxx/
%{_includedir}/gpiodcxx/*.hpp
%{_libdir}/*.so
%{_libdir}/pkgconfig/libgpiod.pc
%{_libdir}/pkgconfig/libgpiodcxx.pc
%{_libdir}/pkgconfig/gpiod-glib.pc
%if %{with libgpiod_python}
%files -n python3-gpiod
%{python3_sitearch}/*.so
%{python3_sitearch}/gpiod/
%{python3_sitearch}/gpiod-*.dist-info
%endif
%files manager
%{_bindir}/gpio-manager
%{_bindir}/gpiocli
%config %{_sysconfdir}/dbus-1/system.d/io.gpiod1.conf
%{_datadir}/dbus-1/interfaces/io.gpiod1.xml
%{_unitdir}/gpio-manager.service
%changelog