| |
@@ -1,13 +1,12 @@
|
| |
Name: libftdi
|
| |
Version: 1.3
|
| |
- Release: 9%{?dist}
|
| |
+ Release: 10%{?dist}
|
| |
Summary: Library to program and control the FTDI USB controller
|
| |
|
| |
Group: System Environment/Libraries
|
| |
License: LGPLv2
|
| |
URL: http://www.intra2net.com/de/produkte/opensource/ftdi/
|
| |
Source0: http://www.intra2net.com/en/developer/%{name}/download/%{name}1-%{version}.tar.bz2
|
| |
- Patch0: libftdi-python-version.patch
|
| |
|
| |
BuildRequires: boost-devel
|
| |
BuildRequires: cmake
|
| |
@@ -15,7 +14,9 @@
|
| |
BuildRequires: libconfuse-devel
|
| |
BuildRequires: libusbx-devel
|
| |
BuildRequires: python2-devel
|
| |
+ BuildRequires: python3-devel
|
| |
BuildRequires: swig
|
| |
+ BuildRequires: gcc-c++
|
| |
Requires: systemd
|
| |
|
| |
|
| |
@@ -27,6 +28,7 @@
|
| |
Summary: Header files and static libraries for libftdi
|
| |
Group: Development/Libraries
|
| |
Requires: %{name}%{?_isa} = %{version}-%{release}
|
| |
+ Requires: python3-%{name}%{?_isa} = %{version}-%{release}
|
| |
Requires: pkgconfig
|
| |
|
| |
%description devel
|
| |
@@ -45,6 +47,15 @@
|
| |
%description -n python2-libftdi
|
| |
Libftdi Python Language bindings.
|
| |
|
| |
+ %package -n python3-libftdi
|
| |
+ %{?python_provide:%python_provide python3-libftdi}
|
| |
+ Summary: Libftdi library Python 3 binding
|
| |
+ Group: Development/Libraries
|
| |
+ Requires: %{name}%{?_isa} = %{version}-%{release}
|
| |
+
|
| |
+ %description -n python3-libftdi
|
| |
+ Libftdi Python 3 Language bindings.
|
| |
+
|
| |
%package c++
|
| |
Summary: Libftdi library C++ binding
|
| |
Group: Development/Libraries
|
| |
@@ -67,21 +78,37 @@
|
| |
%prep
|
| |
%setup -q -n %{name}1-%{version}
|
| |
|
| |
- %patch0 -p0
|
| |
-
|
| |
#kernel does not provide usb_device anymore
|
| |
sed -i -e 's/usb_device/usb/g' packages/99-libftdi.rules
|
| |
sed -i -e 's/GROUP="plugdev"/TAG+="uaccess"/g' packages/99-libftdi.rules
|
| |
|
| |
%build
|
| |
export CMAKE_PREFIX_PATH=/usr
|
| |
- %{cmake} .
|
| |
|
| |
+ mkdir build-py2
|
| |
+ pushd build-py2
|
| |
+ %{cmake} -DPython_ADDITIONAL_VERSIONS=%{python2_version} ..
|
| |
make %{?_smp_mflags}
|
| |
+ popd
|
| |
|
| |
+ mkdir build-py3
|
| |
+ pushd build-py3
|
| |
+ %{cmake} -DPython_ADDITIONAL_VERSIONS=%{python3_version} ..
|
| |
+ make %{?_smp_mflags}
|
| |
+ popd
|
| |
+
|
| |
+ # Fix python sheband lines
|
| |
+ find python/examples -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +
|
| |
|
| |
%install
|
| |
+ # Install python2, since we'll prefer python3 with the second install.
|
| |
+ pushd build-py2
|
| |
+ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
| |
+ popd
|
| |
+
|
| |
+ pushd build-py3
|
| |
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
| |
+ popd
|
| |
|
| |
mkdir -p $RPM_BUILD_ROOT/lib/udev/rules.d/
|
| |
install -p -m 644 packages/99-libftdi.rules $RPM_BUILD_ROOT/lib/udev/rules.d/69-libftdi.rules
|
| |
@@ -91,7 +118,7 @@
|
| |
|
| |
#no man install
|
| |
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
|
| |
- install -p -m 644 doc/man/man3/*.3 $RPM_BUILD_ROOT%{_mandir}/man3
|
| |
+ install -p -m 644 build-py3/doc/man/man3/*.3 $RPM_BUILD_ROOT%{_mandir}/man3
|
| |
|
| |
# Cleanup examples
|
| |
rm -f $RPM_BUILD_ROOT/%{_bindir}/simple
|
| |
@@ -120,7 +147,7 @@
|
| |
/lib/udev/rules.d/69-libftdi.rules
|
| |
|
| |
%files devel
|
| |
- %doc doc/html
|
| |
+ %doc build-py3/doc/html
|
| |
%doc %{_datadir}/libftdi/examples
|
| |
%{_bindir}/ftdi_eeprom
|
| |
%{_bindir}/libftdi1-config
|
| |
@@ -128,10 +155,16 @@
|
| |
%{_includedir}/libftdi1
|
| |
%{_libdir}/pkgconfig/libftdi1.pc
|
| |
%{_mandir}/man3/*
|
| |
+ # Don't include byte-compiled files for python scripts.
|
| |
+ %exclude %{_datadir}/libftdi/examples/*.pyc
|
| |
+ %exclude %{_datadir}/libftdi/examples/*.pyo
|
| |
|
| |
%files -n python2-libftdi
|
| |
%{python2_sitearch}/*
|
| |
|
| |
+ %files -n python3-libftdi
|
| |
+ %{python3_sitearch}/*
|
| |
+
|
| |
%files c++
|
| |
%{_libdir}/libftdipp1.so.2*
|
| |
|
| |
@@ -147,6 +180,11 @@
|
| |
%postun c++ -p /sbin/ldconfig
|
| |
|
| |
%changelog
|
| |
+ * Mon Oct 09 2017 Troy Curtis, Jr <troycurtisjr@gmail.com> - 1.3-10
|
| |
+ - Add python3 subpackage.
|
| |
+ - Drop patch0 in favor of built-in cmake config methods.
|
| |
+ - Don't include bytecompiled files for the example python scripts.
|
| |
+
|
| |
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.3-9
|
| |
- Add Provides for the old name without %%_isa
|
| |
|
| |