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