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