From e8713e2e4a8c787ae2f59a0c98ae2c9973606152 Mon Sep 17 00:00:00 2001
From: Tomas Mlcoch <tmlcoch@redhat.com>
Date: Oct 03 2013 12:09:54 +0000
Subject: Add python3-librepo subpackage


---

diff --git a/.gitignore b/.gitignore
index 058dad8..db56b38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
 /librepo-b28e796.tar.xz
 /librepo-29872d4.tar.xz
 /librepo-c4ee6d2.tar.xz
+/librepo-4a8f93b.tar.xz
diff --git a/librepo.spec b/librepo.spec
index 2422994..8635ed6 100644
--- a/librepo.spec
+++ b/librepo.spec
@@ -1,9 +1,9 @@
-%global gitrev c4ee6d2
+%global gitrev 4a8f93b
 # gitrev is output of: git rev-parse --short HEAD
 
 Name:		librepo
 Version:	1.2.0
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Repodata downloading library
 
 Group:		System Environment/Libraries
@@ -24,11 +24,11 @@ BuildRequires:	gpgme-devel
 BuildRequires:	libattr-devel
 BuildRequires:	libcurl-devel
 BuildRequires:	openssl-devel
-BuildRequires:	pygpgme
-BuildRequires:	python2-devel
-BuildRequires:	python-flask
-BuildRequires:	python-nose
-BuildRequires:	python-sphinx
+
+# prevent provides from nonstandard paths:
+%filter_provides_in %{python_sitearch}/.*\.so$
+%filter_provides_in %{python3_sitearch}/.*\.so$
+%filter_setup
 
 %description
 A library providing C and Python (libcURL like) API to downloading repository
@@ -45,23 +45,58 @@ Development files for librepo.
 %package -n python-librepo
 Summary:	Python bindings for the librepo library
 Group:		Development/Languages
+BuildRequires:	pygpgme
+BuildRequires:	python2-devel
+BuildRequires:	python-flask
+BuildRequires:	python-nose
+BuildRequires:	python-sphinx
 Requires:	%{name}%{?_isa} = %{version}-%{release}
 
 %description -n python-librepo
 Python bindings for the librepo library.
 
+%package -n python3-librepo
+Summary:        Python 3 bindings for the librepo library
+Group:          Development/Languages
+BuildRequires:	python3-pygpgme
+BuildRequires:  python3-devel
+BuildRequires:  python3-flask
+BuildRequires:  python3-nose
+BuildRequires:  python3-sphinx
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description -n python3-librepo
+Python 3 bindings for the librepo library.
+
 %prep
 %setup -q -n librepo
 
+rm -rf py3
+mkdir ../py3
+cp -a . ../py3/
+mv ../py3 ./
+
 %build
 %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
 make %{?_smp_mflags}
 
+pushd py3
+%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON_DESIRED:str=3 .
+make %{?_smp_mflags}
+popd
+
 %check
 make ARGS="-V" test
 
+pushd py3
+make ARGS="-V" test
+popd
+
 %install
 make install DESTDIR=$RPM_BUILD_ROOT
+pushd py3
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
 
 %post -p /sbin/ldconfig
 
@@ -79,7 +114,14 @@ make install DESTDIR=$RPM_BUILD_ROOT
 %files -n python-librepo
 %{python_sitearch}/librepo/
 
+%files -n python3-librepo
+%{python3_sitearch}/
+
 %changelog
+* Thu Oct  03 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-2
+- Add target for Python 3 to the spec file
+- Fix few python3 related issues
+
 * Tue Oct  01 2013 Tomas Mlcoch <tmlcoch at redhat.com> - 1.2.0-1
 - Better detection of bad content of repomd.xml
 - Close files properly (RhBug: 1012290)
diff --git a/sources b/sources
index eab036f..3b34ecc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1d706d125f019203b4394ea8c302964c  librepo-c4ee6d2.tar.xz
+4092edd99e7153c9d3604ff8da6e092a  librepo-4a8f93b.tar.xz