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