Commit | Line | Data |
---|---|---|
1f4fecf4 TJ |
1 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
2 | ||
a3da1d95 | 3 | Summary: Library to program and control the FTDI USB controller |
9ff7af62 | 4 | Name: libftdi1 |
22592e17 | 5 | Version: @VERSION@ |
a837e33a | 6 | Release: 1 |
3ab8f642 | 7 | License: LGPL for libftdi and GPLv2+linking exception for the C++ wrapper |
a3da1d95 GE |
8 | Group: System Environment/Libraries |
9 | Vendor: Intra2net AG | |
024705ce | 10 | Source: http://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2 |
a3da1d95 | 11 | Buildroot: /tmp/%{name}-%{version}-root |
9ff7af62 TJ |
12 | Requires: libusb1 |
13 | BuildRequires: libusb1, libusb1-devel, pkgconfig, doxygen | |
1f4fecf4 | 14 | BuildRequires: swig python-devel |
a3da1d95 | 15 | Prefix: /usr |
1bfc403c | 16 | URL: http://www.intra2net.com/en/developer/libftdi |
a3da1d95 GE |
17 | |
18 | %package devel | |
42ece760 | 19 | Summary: Header files and static libraries for libftdi1 |
a3da1d95 | 20 | Group: Development/Libraries |
42ece760 | 21 | Requires: libftdi1 = %{version}, libusb1-devel |
a3da1d95 | 22 | |
1f4fecf4 TJ |
23 | %package python |
24 | Summary: Python bindings for libftdi | |
25 | License: LGPL | |
26 | Group: Development/Libraries | |
b953c0e3 | 27 | Requires: %{name} = %{version}-%{release} |
1f4fecf4 | 28 | |
a3da1d95 GE |
29 | %description |
30 | Library to program and control the FTDI USB controller | |
31 | ||
32 | %description devel | |
42ece760 | 33 | Header files and static libraries for libftdi1 |
a3da1d95 | 34 | |
1f4fecf4 TJ |
35 | %description python |
36 | Python bindings for libftdi1 generated by SWIG | |
37 | ||
a3da1d95 GE |
38 | %prep |
39 | %setup -q | |
40 | ||
41 | %build | |
22592e17 | 42 | |
024705ce TJ |
43 | mkdir build |
44 | cd build | |
22592e17 | 45 | |
024705ce TJ |
46 | export CFLAGS="$RPM_OPT_FLAGS" |
47 | export CXXFLAGS="$RPM_OPT_FLAGS" | |
48 | cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" ../ | |
49 | ||
50 | make %{?_smp_mflags} | |
a3da1d95 GE |
51 | |
52 | %install | |
024705ce | 53 | cd build |
a3da1d95 GE |
54 | make DESTDIR=$RPM_BUILD_ROOT install |
55 | ||
6167b919 | 56 | # Remove example programs |
82a75c76 TJ |
57 | rm -f $RPM_BUILD_ROOT/usr/bin/simple |
58 | rm -f $RPM_BUILD_ROOT/usr/bin/bitbang | |
59 | rm -f $RPM_BUILD_ROOT/usr/bin/bitbang2 | |
60 | rm -f $RPM_BUILD_ROOT/usr/bin/bitbang_ft2232 | |
cc6a88a5 | 61 | rm -f $RPM_BUILD_ROOT/usr/bin/bitbang_cbus |
177df8fc | 62 | rm -f $RPM_BUILD_ROOT/usr/bin/find_all |
b0c551aa | 63 | rm -f $RPM_BUILD_ROOT/usr/bin/find_all_pp |
dc422d1b | 64 | rm -f $RPM_BUILD_ROOT/usr/bin/serial_test |
0c93de81 | 65 | rm -f $RPM_BUILD_ROOT/usr/bin/baud_test |
177df8fc | 66 | |
412db1a7 TJ |
67 | # Clean python compiled files in examples dir |
68 | find $RPM_BUILD_ROOT%{prefix}/share/libftdi/examples -name "*.pyc" -or -name "*.pyo" -exec rm -f \{\} \; | |
69 | ||
49a41e91 TJ |
70 | # move documentation to version specific directory |
71 | # Is there an easy way in cmake to set the DOCDIR? | |
72 | mkdir -p $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{version} | |
73 | mv $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}/* $RPM_BUILD_ROOT%{prefix}/share/doc/%{name}-%{version} | |
74 | ||
a3da1d95 GE |
75 | %clean |
76 | rm -fr $RPM_BUILD_ROOT | |
77 | ||
78 | %files | |
79 | %defattr(-,root,root) | |
3ab8f642 | 80 | %doc COPYING.LIB COPYING.GPL LICENSE |
42ece760 | 81 | %{_libdir}/libftdi1*.so* |
024705ce | 82 | %{_libdir}/libftdipp1*.so* |
a3da1d95 GE |
83 | |
84 | %files devel | |
85 | %defattr(-,root,root) | |
9de7efa2 | 86 | %doc build/doc/html build/doc/man |
af7a35fe | 87 | %{_bindir}/ftdi_eeprom |
7a07197c | 88 | %{_bindir}/libftdi1-config |
0444972e TJ |
89 | %{prefix}/include/libftdi1/*.h |
90 | %{prefix}/include/libftdi1/*.hpp | |
412db1a7 | 91 | %{prefix}/share/libftdi/examples/* |
42ece760 | 92 | %{_libdir}/libftdi1*.*a |
024705ce | 93 | %{_libdir}/libftdipp1*.*a |
218d3256 | 94 | %{_libdir}/pkgconfig/*.pc |
62cfa2ef | 95 | %{_libdir}/cmake/libftdi1/* |
1f4fecf4 TJ |
96 | |
97 | %files python | |
98 | %defattr(-,root,root,-) | |
99 | %attr(755,root,root) %{python_sitearch}/_ftdi1.so | |
100 | %{python_sitearch}/ftdi1.py* |