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