]>
Commit | Line | Data |
---|---|---|
dcb5560c | 1 | # |
7d03b0f2 | 2 | # Conditional build: |
8f9bdbd7 JB |
3 | %bcond_without python2 # Python 2 module |
4 | %bcond_without python3 # Python 3 module | |
7d03b0f2 L |
5 | |
6 | Summary: Library to talk to FTDI's chips including the popular bitbang mode | |
7 | Summary(pl.UTF-8): Biblioteka do komunikacji z układami FTDI włącznie z trybem bitbang | |
8 | Name: libftdi1 | |
9 | Version: 1.2 | |
8f9bdbd7 | 10 | Release: 2 |
7d03b0f2 L |
11 | License: LGPL v2 |
12 | Group: Libraries | |
24ca1718 | 13 | #Source0Download: http://www.intra2net.com/en/developer/libftdi/download.php |
dcb5560c | 14 | Source0: http://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2 |
7d03b0f2 | 15 | # Source0-md5: 89dff802d89c4c0d55d8b4665fd52d0b |
8f9bdbd7 | 16 | Patch0: %{name}-python.patch |
dcb5560c | 17 | URL: http://www.intra2net.com/en/developer/libftdi/ |
7d03b0f2 L |
18 | BuildRequires: boost-devel >= 1.33 |
19 | BuildRequires: doxygen | |
20 | BuildRequires: libconfuse-devel | |
21 | BuildRequires: libusb-devel >= 1.0.0 | |
22 | BuildRequires: pkgconfig | |
8f9bdbd7 JB |
23 | %{?with_python2:BuildRequires: python-devel >= 1:2.6} |
24 | %{?with_python3:BuildRequires: python3-devel >= 1:3.3} | |
7d03b0f2 L |
25 | BuildRequires: rpmbuild(macros) >= 1.600 |
26 | BuildRequires: swig-python | |
7d03b0f2 L |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | libftdi1 is a library (using libusb) to talk to FTDI's UART/FIFO chips | |
31 | including the popular bitbang mode. The following chips are supported: | |
32 | - FT4232H / FT2232H | |
33 | - FT232R / FT245R | |
34 | - FT2232L / FT2232D / FT2232C | |
35 | - FT232BM / FT245BM (and the BL/BQ variants) | |
36 | - FT8U232AM / FT8U245AM | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | libftdi1 to korzystająca z libusb biblioteka, służąca do komunikacji z | |
40 | układami FTDI typu UART/FIFO, włącznie z popularnym trybem bitbang. | |
41 | Obsługiwane są układy: | |
42 | - FT4232H / FT2232H | |
43 | - FT232R / FT245R | |
44 | - FT2232L / FT2232D / FT2232C | |
45 | - FT232BM / FT245BM (wraz z wariantami BL/BQ) | |
46 | - FT8U232AM / FT8U245AM | |
47 | ||
48 | %package devel | |
49 | Summary: Header files for libftdi1 library | |
50 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libftdi1 | |
51 | License: LGPL v2 | |
52 | Group: Development/Libraries | |
53 | Requires: %{name} = %{version}-%{release} | |
54 | Requires: libusb-compat-devel >= 0.1.0 | |
55 | ||
56 | %description devel | |
57 | Header files for libftdi1 library. | |
58 | ||
59 | %description devel -l pl.UTF-8 | |
60 | Pliki nagłówkowe biblioteki libftdi1. | |
61 | ||
62 | %package static | |
63 | Summary: Static libftdi1 library | |
64 | Summary(pl.UTF-8): Statyczna biblioteka libftdi1 | |
65 | License: LGPL v2 | |
66 | Group: Development/Libraries | |
67 | Requires: %{name}-devel = %{version}-%{release} | |
68 | ||
69 | %description static | |
70 | Static libftdi1 library. | |
71 | ||
72 | %description static -l pl.UTF-8 | |
73 | Statyczna biblioteka libftdi1. | |
74 | ||
75 | %package c++ | |
76 | Summary: C++ wrapper for libftdi1 | |
77 | Summary(pl.UTF-8): Interfejs C++ do libftdi1 | |
78 | License: GPL v2 with linking exception | |
79 | Group: Libraries | |
80 | Requires: %{name} = %{version}-%{release} | |
81 | ||
82 | %description c++ | |
83 | libftdipp1 - C++ wrapper for libftdi1. | |
84 | ||
85 | %description c++ -l pl.UTF-8 | |
86 | libftdipp1 - intefejs C++ do libftdi1. | |
87 | ||
88 | %package c++-devel | |
89 | Summary: Header file for libftdipp1 library | |
90 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki libftdipp1 | |
91 | License: GPL v2 with linking exception | |
92 | Group: Development/Libraries | |
93 | Requires: %{name}-c++ = %{version}-%{release} | |
94 | Requires: %{name}-devel = %{version}-%{release} | |
95 | Requires: boost-devel >= 1.33 | |
96 | Requires: libstdc++-devel | |
97 | ||
98 | %description c++-devel | |
99 | Header file for libftdipp1 library. | |
100 | ||
101 | %description c++-devel -l pl.UTF-8 | |
102 | Plik nagłówkowy biblioteki libftdipp1. | |
103 | ||
104 | %package c++-static | |
105 | Summary: Static libftdipp1 library | |
106 | Summary(pl.UTF-8): Statyczna biblioteka libftdipp1 | |
8f9bdbd7 | 107 | License: GPL v2 with linking exception |
7d03b0f2 L |
108 | Group: Development/Libraries |
109 | Requires: %{name}-c++-devel = %{version}-%{release} | |
110 | ||
111 | %description c++-static | |
112 | Static libftdipp1 library. | |
113 | ||
114 | %description c++-static -l pl.UTF-8 | |
115 | Statyczna biblioteka libftdipp1. | |
116 | ||
117 | %package -n python-libftdi1 | |
8f9bdbd7 JB |
118 | Summary: Python 2 binding for libftdi1 |
119 | Summary(pl.UTF-8): Wiązanie Pythona 2 do libftdi1 | |
7d03b0f2 L |
120 | Group: Libraries/Python |
121 | Requires: %{name} = %{version}-%{release} | |
122 | ||
123 | %description -n python-libftdi1 | |
8f9bdbd7 | 124 | Python 2 binding for libftdi1. |
7d03b0f2 L |
125 | |
126 | %description -n python-libftdi1 -l pl.UTF-8 | |
8f9bdbd7 JB |
127 | Wiązanie Pythona 2 do libftdi1. |
128 | ||
129 | %package -n python3-libftdi1 | |
130 | Summary: Python 3 binding for libftdi1 | |
131 | Summary(pl.UTF-8): Wiązanie Pythona 3 do libftdi1 | |
132 | Group: Libraries/Python | |
133 | Requires: %{name} = %{version}-%{release} | |
134 | ||
135 | %description -n python3-libftdi1 | |
136 | Python 3 binding for libftdi1. | |
137 | ||
138 | %description -n python3-libftdi1 -l pl.UTF-8 | |
139 | Wiązanie Pythona 3 do libftdi1. | |
7d03b0f2 L |
140 | |
141 | %prep | |
142 | %setup -q | |
8f9bdbd7 | 143 | %patch0 -p1 |
7d03b0f2 L |
144 | |
145 | %build | |
8f9bdbd7 JB |
146 | %if %{with python2} |
147 | install -d build-py2 | |
148 | cd build-py2 | |
149 | %cmake .. \ | |
150 | -DEXAMPLES=OFF \ | |
151 | -DPYTHON_EXECUTABLE=%{__python} | |
152 | %{__make} | |
153 | cd .. | |
7d03b0f2 | 154 | %endif |
8f9bdbd7 JB |
155 | |
156 | %if %{with python3} | |
157 | install -d build-py3 | |
158 | cd build-py3 | |
159 | %cmake .. \ | |
7d03b0f2 | 160 | -DEXAMPLES=OFF \ |
8f9bdbd7 | 161 | -DPYTHON_EXECUTABLE=%{__python3} |
7d03b0f2 | 162 | %{__make} |
8f9bdbd7 JB |
163 | cd .. |
164 | %endif | |
7d03b0f2 L |
165 | |
166 | %install | |
167 | rm -rf $RPM_BUILD_ROOT | |
8f9bdbd7 JB |
168 | |
169 | %if %{with python3} | |
170 | %{__make} -C build-py3 install \ | |
171 | DESTDIR="$RPM_BUILD_ROOT" | |
172 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
173 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
174 | %endif | |
175 | ||
176 | %if %{with python2} | |
177 | %{__make} -C build-py2 install \ | |
7d03b0f2 | 178 | DESTDIR="$RPM_BUILD_ROOT" |
8f9bdbd7 JB |
179 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} |
180 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
181 | %py_postclean | |
182 | %endif | |
7d03b0f2 L |
183 | |
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
187 | %post -p /sbin/ldconfig | |
188 | %postun -p /sbin/ldconfig | |
189 | ||
190 | %post c++ -p /sbin/ldconfig | |
191 | %postun c++ -p /sbin/ldconfig | |
192 | ||
193 | %files | |
194 | %defattr(644,root,root,755) | |
8f9bdbd7 | 195 | %doc AUTHORS ChangeLog LICENSE README %{?with_python2:build-py2}%{!?with_python2:build-py3}/doc/html |
7d03b0f2 L |
196 | %attr(755,root,root) %{_libdir}/libftdi1.so.*.*.* |
197 | %attr(755,root,root) %ghost %{_libdir}/libftdi1.so.2 | |
198 | ||
199 | %files devel | |
200 | %defattr(644,root,root,755) | |
201 | %attr(755,root,root) %{_bindir}/ftdi_eeprom | |
202 | %attr(755,root,root) %{_bindir}/libftdi1-config | |
203 | %attr(755,root,root) %{_libdir}/libftdi1.so | |
204 | %dir %{_includedir}/libftdi1 | |
205 | %{_includedir}/libftdi1/ftdi.h | |
206 | %{_pkgconfigdir}/libftdi1.pc | |
8f9bdbd7 | 207 | %dir %{_libdir}/cmake/libftdi1 |
7d03b0f2 L |
208 | %{_libdir}/cmake/libftdi1/*.cmake |
209 | %dir %{_datadir}/libftdi | |
210 | %dir %{_datadir}/libftdi/examples | |
211 | %{_datadir}/libftdi/examples/*.py | |
212 | ||
213 | %files static | |
214 | %defattr(644,root,root,755) | |
215 | %{_libdir}/libftdi1.a | |
216 | ||
217 | %files c++ | |
218 | %defattr(644,root,root,755) | |
219 | %attr(755,root,root) %{_libdir}/libftdipp1.so.*.*.* | |
220 | %attr(755,root,root) %ghost %{_libdir}/libftdipp1.so.2 | |
221 | ||
222 | %files c++-devel | |
223 | %defattr(644,root,root,755) | |
224 | %attr(755,root,root) %{_libdir}/libftdipp1.so | |
225 | %{_includedir}/libftdi1/ftdi.hpp | |
226 | %{_pkgconfigdir}/libftdipp1.pc | |
227 | ||
228 | %files c++-static | |
229 | %defattr(644,root,root,755) | |
230 | %{_libdir}/libftdipp1.a | |
231 | ||
8f9bdbd7 | 232 | %if %{with python2} |
7d03b0f2 L |
233 | %files -n python-libftdi1 |
234 | %defattr(644,root,root,755) | |
235 | %attr(755,root,root) %{py_sitedir}/_ftdi1.so | |
8f9bdbd7 JB |
236 | %{py_sitedir}/ftdi1.py[co] |
237 | %endif | |
238 | ||
239 | %if %{with python3} | |
240 | %files -n python3-libftdi1 | |
241 | %defattr(644,root,root,755) | |
242 | %attr(755,root,root) %{py3_sitedir}/_ftdi1.so | |
243 | %{py3_sitedir}/ftdi1.py | |
244 | %{py3_sitedir}/__pycache__/ftdi1.cpython-*.py[co] | |
245 | %endif |