rpm .spec file: Package the python wrapper
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Fri, 28 Dec 2012 10:49:30 +0000 (11:49 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Fri, 28 Dec 2012 10:49:30 +0000 (11:49 +0100)
libftdi1.spec.in

index 9ffd62d..881b0c4 100644 (file)
@@ -1,3 +1,5 @@
+%{!?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@
@@ -9,6 +11,7 @@ Source:    http://www.intra2net.com/en/developer/libftdi/download/%{name}-%{vers
 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
 
@@ -17,12 +20,21 @@ 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}-libs = %{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
 
@@ -71,3 +83,8 @@ rm -fr $RPM_BUILD_ROOT
 %{_libdir}/libftdi1*.*a
 %{_libdir}/libftdipp1*.*a
 %{_libdir}/pkgconfig/*.pc
+
+%files python
+%defattr(-,root,root,-)
+%attr(755,root,root) %{python_sitearch}/_ftdi1.so
+%{python_sitearch}/ftdi1.py*