| 1 | %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
| 2 | |
| 3 | Summary: Library to program and control the FTDI USB controller |
| 4 | Name: libftdi1 |
| 5 | Version: @VERSION@ |
| 6 | Release: 1 |
| 7 | License: LGPL for libftdi and GPLv2+linking exception for the C++ wrapper |
| 8 | Group: System Environment/Libraries |
| 9 | Vendor: Intra2net AG |
| 10 | Source: http://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2 |
| 11 | Buildroot: /tmp/%{name}-%{version}-root |
| 12 | Requires: libusb1 |
| 13 | BuildRequires: libusb1, libusb1-devel, pkgconfig, doxygen |
| 14 | BuildRequires: swig python-devel |
| 15 | Prefix: /usr |
| 16 | URL: http://www.intra2net.com/en/developer/libftdi |
| 17 | |
| 18 | %package devel |
| 19 | Summary: Header files and static libraries for libftdi1 |
| 20 | Group: Development/Libraries |
| 21 | Requires: libftdi1 = %{version}, libusb1-devel |
| 22 | |
| 23 | %package python |
| 24 | Summary: Python bindings for libftdi |
| 25 | License: LGPL |
| 26 | Group: Development/Libraries |
| 27 | Requires: %{name} = %{version}-%{release} |
| 28 | |
| 29 | %description |
| 30 | Library to program and control the FTDI USB controller |
| 31 | |
| 32 | %description devel |
| 33 | Header files and static libraries for libftdi1 |
| 34 | |
| 35 | %description python |
| 36 | Python bindings for libftdi1 generated by SWIG |
| 37 | |
| 38 | %prep |
| 39 | %setup -q |
| 40 | |
| 41 | %build |
| 42 | |
| 43 | mkdir build |
| 44 | cd build |
| 45 | |
| 46 | export CFLAGS="$RPM_OPT_FLAGS" |
| 47 | export CXXFLAGS="$RPM_OPT_FLAGS" |
| 48 | cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" ../ |
| 49 | |
| 50 | make %{?_smp_mflags} |
| 51 | |
| 52 | %install |
| 53 | cd build |
| 54 | make DESTDIR=$RPM_BUILD_ROOT install |
| 55 | |
| 56 | # Remove example programs |
| 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 |
| 61 | rm -f $RPM_BUILD_ROOT/usr/bin/bitbang_cbus |
| 62 | rm -f $RPM_BUILD_ROOT/usr/bin/find_all |
| 63 | rm -f $RPM_BUILD_ROOT/usr/bin/find_all_pp |
| 64 | rm -f $RPM_BUILD_ROOT/usr/bin/serial_test |
| 65 | rm -f $RPM_BUILD_ROOT/usr/bin/baud_test |
| 66 | |
| 67 | %clean |
| 68 | rm -fr $RPM_BUILD_ROOT |
| 69 | |
| 70 | %files |
| 71 | %defattr(-,root,root) |
| 72 | %doc COPYING.LIB COPYING.GPL LICENSE |
| 73 | %{_libdir}/libftdi1*.so* |
| 74 | %{_libdir}/libftdipp1*.so* |
| 75 | |
| 76 | %files devel |
| 77 | %defattr(-,root,root) |
| 78 | %doc build/doc/html build/doc/man |
| 79 | %{_bindir}/ftdi_eeprom |
| 80 | %{_bindir}/libftdi1-config |
| 81 | %{prefix}/include/libftdi1/*.h |
| 82 | %{prefix}/include/libftdi1/*.hpp |
| 83 | %{_libdir}/libftdi1*.*a |
| 84 | %{_libdir}/libftdipp1*.*a |
| 85 | %{_libdir}/pkgconfig/*.pc |
| 86 | %{_libdir}/cmake/libftdi1/* |
| 87 | |
| 88 | %files python |
| 89 | %defattr(-,root,root,-) |
| 90 | %attr(755,root,root) %{python_sitearch}/_ftdi1.so |
| 91 | %{python_sitearch}/ftdi1.py* |