A new user interface for you! Read more...

File libgpiod.spec of Package libgpiod

#
# spec file for package libgpiod
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define libname libgpiod1

Name:           libgpiod
Version:        1.2
Release:        0
Summary:        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
BuildRequires:  autoconf-archive
BuildRequires:  automake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  kernel-devel >= 4.8
BuildRequires:  libkmod-devel
BuildRequires:  libtool
BuildRequires:  make
BuildRequires:  python3-devel

%description
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.

%package -n %{libname}
Summary:        C library for interacting with the linux GPIO character device
Group:          System/Libraries

%description -n %{libname}
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.

Library part.

%package devel
Summary:        Devel files for libgpiod
Group:          Development/Languages/C and C++
Requires:       %{name}

%description devel
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.

Devel files part.

%package -n python-%{name}
Summary:        Python binding for libgpiod
Group:          Development/Languages/Python

%description -n python-%{name}
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.

Python binding part.

%prep
%setup -q

%build
./autogen.sh
%configure \
	--enable-tools=yes \
	--enable-bindings-python \
	--enable-bindings-cxx 
make

%install
%make_install
rm -rf %{buildroot}%{_libdir}/*.{a,la}
rm -rf %{buildroot}%{python3_sitearch}/*.{a,la}

%post -n %{libname} -p /sbin/ldconfig
%postun	-n %{libname} -p /sbin/ldconfig

%files
%{_bindir}/gpio*

%files -n %{libname}
%{_libdir}/libgpiod*.so.*

%files devel
%{_includedir}/*.h*
%{_libdir}/*.so
%{_libdir}/pkgconfig/libgpiod.pc
%{_libdir}/pkgconfig/libgpiodcxx.pc

%files -n python-%{name}
%{python3_sitearch}/*.so

%changelog