]> git.pld-linux.org Git - packages/libgpiod.git/blob - libgpiod.spec
- updated to 2.0 (API reworked, new sonames)
[packages/libgpiod.git] / libgpiod.spec
1 # TODO:
2 # - rust bindings (--enable-bindings-rust, needs vendoring; BR: cargo, rust)
3 # - tests (BR: kmod-devel >= 18, libmount-devel >= 2.33.1, glib2-devel >= 1:2.50 for library; bats for tools; catch2 for C++)
4 #
5 # Conditional build:
6 %bcond_without  apidocs         # Doxygen API documentation
7 %bcond_without  python          # Python binding
8 %bcond_without  static_libs     # static libraries
9 #
10 Summary:        Library and tools for interacting with the Linux GPIO character device
11 Summary(pl.UTF-8):      Biblioteka i narzędzia do obsługi linuksowych urządzeń znakowych GPIO
12 Name:           libgpiod
13 Version:        2.0
14 Release:        1
15 License:        LGPL v2.1+
16 Group:          Libraries
17 Source0:        https://www.kernel.org/pub/software/libs/libgpiod/%{name}-%{version}.tar.xz
18 # Source0-md5:  5ee9ddc16c21c62dabbf83986c6709e2
19 Patch0:         %{name}-python.patch
20 URL:            https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/
21 %{?with_apidocs:BuildRequires:  doxygen}
22 BuildRequires:  help2man
23 BuildRequires:  libstdc++-devel >= 6:7
24 BuildRequires:  linux-libc-headers >= 6:5.5
25 %{?with_python:BuildRequires:   python3-devel >= 1:3.2}
26 BuildRequires:  tar >= 1:1.22
27 BuildRequires:  xz
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Since Linux 4.8 the GPIO sysfs interface is deprecated. User space
32 should use the character device instead. This library encapsulates the
33 ioctl calls and data structures behind a straightforward API.
34
35 %description -l pl.UTF-8
36 Od wersja Linuksa 4.8 interfejs sysfs do GPIO jest przestarzały.
37 Przestrzeń użytkownika powinna zamiast niego używać urządzenia
38 znakowego. Ta biblioteka kryje wywołania ioctl i struktury danych za
39 bezpośrednim API.
40
41 %package devel
42 Summary:        Header files for libgpiod library
43 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libgpiod
44 Group:          Development/Libraries
45 Requires:       %{name} = %{version}-%{release}
46
47 %description devel
48 Header files for libgpiod library.
49
50 %description devel -l pl.UTF-8
51 Pliki nagłówkowe biblioteki libgpiod.
52
53 %package static
54 Summary:        Static libgpiod library
55 Summary(pl.UTF-8):      Statyczna biblioteka libgpiod
56 Group:          Development/Libraries
57 Requires:       %{name}-devel = %{version}-%{release}
58
59 %description static
60 Static libgpiod library.
61
62 %description static -l pl.UTF-8
63 Statyczna biblioteka libgpiod.
64
65 %package cxx
66 Summary:        C++ binding for libgpiod library
67 Summary(pl.UTF-8):      Interfejs C++ do biblioteki libgpiod
68 Group:          Libraries
69 Requires:       %{name} = %{version}-%{release}
70
71 %description cxx
72 High-level, object-oriented C++ binding for libgpiod library.
73
74 %description cxx -l pl.UTF-8
75 Wysokopoziomowy, zorientowany obiektowo interfejs C++ do biblioteki
76 libgpiod.
77
78 %package cxx-devel
79 Summary:        Header files for libgpiodcxx library
80 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libgpiodcxx
81 Group:          Development/Libraries
82 Requires:       %{name}-cxx = %{version}-%{release}
83 Requires:       %{name}-devel = %{version}-%{release}
84 Requires:       libstdc++-devel >= 6:7
85
86 %description cxx-devel
87 Header files for libgpiodcxx library.
88
89 %description cxx-devel -l pl.UTF-8
90 Pliki nagłówkowe biblioteki libgpiodcxx.
91
92 %package cxx-static
93 Summary:        Static libgpiodcxx library
94 Summary(pl.UTF-8):      Statyczna biblioteka libgpiodcxx
95 Group:          Development/Libraries
96 Requires:       %{name}-cxx-devel = %{version}-%{release}
97
98 %description cxx-static
99 Static libgpiodcxx library.
100
101 %description cxx-static -l pl.UTF-8
102 Statyczna biblioteka libgpiodcxx.
103
104 %package -n python3-gpiod
105 Summary:        Pythona binding for libgpiod library
106 Summary(pl.UTF-8):      Interfejs Pythona do biblioteki libgpiod
107 Group:          Libraries/Python
108 Requires:       %{name} = %{version}-%{release}
109
110 %description -n python3-gpiod
111 High-level, object-oriented Python binding for libgpiod library.
112
113 %description -n python3-gpiod -l pl.UTF-8
114 Wysokopoziomowy, zorientowany obiektowo interfejs Pythona do
115 biblioteki libgpiod.
116
117 %package apidocs
118 Summary:        API documentation for libgpiod library
119 Summary(pl.UTF-8):      Dokumentacja API biblioteki libgpiod
120 Group:          Documentation
121 BuildArch:      noarch
122
123 %description apidocs
124 API documentation for libgpiod library.
125
126 %description apidocs -l pl.UTF-8
127 Dokumentacja API biblioteki libgpiod.
128
129 %prep
130 %setup -q
131 %patch0 -p1
132
133 %build
134 %configure \
135         %{!?with_static_libs:--disable-static} \
136         --enable-bindings-cxx \
137         %{?with_python:--enable-bindings-python} \
138         --enable-gpioset-interactive \
139         --disable-silent-rules \
140         --enable-tools
141 %{__make}
142
143 %if %{with apidocs}
144 %{__make} doc
145 %endif
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149
150 %{__make} install \
151         DESTDIR=$RPM_BUILD_ROOT
152
153 # obsoleted by pkg-config
154 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpiod*.la
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %post   -p /sbin/ldconfig
160 %postun -p /sbin/ldconfig
161
162 %post   cxx -p /sbin/ldconfig
163 %postun cxx -p /sbin/ldconfig
164
165 %files
166 %defattr(644,root,root,755)
167 %doc NEWS README
168 %attr(755,root,root) %{_bindir}/gpiodetect
169 %attr(755,root,root) %{_bindir}/gpioget
170 %attr(755,root,root) %{_bindir}/gpioinfo
171 %attr(755,root,root) %{_bindir}/gpiomon
172 %attr(755,root,root) %{_bindir}/gpionotify
173 %attr(755,root,root) %{_bindir}/gpioset
174 %attr(755,root,root) %{_libdir}/libgpiod.so.*.*.*
175 %attr(755,root,root) %ghost %{_libdir}/libgpiod.so.3
176 %{_mandir}/man1/gpiodetect.1*
177 %{_mandir}/man1/gpioget.1*
178 %{_mandir}/man1/gpioinfo.1*
179 %{_mandir}/man1/gpiomon.1*
180 %{_mandir}/man1/gpionotify.1*
181 %{_mandir}/man1/gpioset.1*
182
183 %files devel
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_libdir}/libgpiod.so
186 %{_includedir}/gpiod.h
187 %{_pkgconfigdir}/libgpiod.pc
188
189 %if %{with static_libs}
190 %files static
191 %defattr(644,root,root,755)
192 %{_libdir}/libgpiod.a
193 %endif
194
195 %files cxx
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_libdir}/libgpiodcxx.so.*.*.*
198 %attr(755,root,root) %ghost %{_libdir}/libgpiodcxx.so.2
199
200 %files cxx-devel
201 %defattr(644,root,root,755)
202 %attr(755,root,root) %{_libdir}/libgpiodcxx.so
203 %{_includedir}/gpiod.hpp
204 %{_includedir}/gpiodcxx
205 %{_pkgconfigdir}/libgpiodcxx.pc
206
207 %if %{with static_libs}
208 %files cxx-static
209 %defattr(644,root,root,755)
210 %{_libdir}/libgpiodcxx.a
211 %endif
212
213 %if %{with python}
214 %files -n python3-gpiod
215 %defattr(644,root,root,755)
216 %dir %{py3_sitedir}/gpiod
217 %attr(755,root,root) %{py3_sitedir}/gpiod/_ext.cpython-*.so
218 %{py3_sitedir}/gpiod/*.py
219 %{py3_sitedir}/gpiod/__pycache__
220 %{py3_sitedir}/gpiod-2.0.0-py*.egg-info
221 %endif
222
223 %if %{with apidocs}
224 %files apidocs
225 %defattr(644,root,root,755)
226 %doc doc/html/*
227 %endif
This page took 0.093283 seconds and 3 git commands to generate.