From 9ba0ea2742585e0cb9a6a771b86a6457e1ce61b6 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 18 Jul 2011 17:22:47 +0200 Subject: [PATCH] - fix python bindings on fedora --- package/libsolv.spec.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/libsolv.spec.in b/package/libsolv.spec.in index 5063db58..c7676458 100644 --- a/package/libsolv.spec.in +++ b/package/libsolv.spec.in @@ -52,6 +52,7 @@ BuildRequires: ruby ruby-devel BuildRequires: swig %endif %if %{with python_binding} +%global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);") BuildRequires: python-devel BuildRequires: swig %endif @@ -185,11 +186,13 @@ make %{?jobs:-j %jobs} %install make DESTDIR=$RPM_BUILD_ROOT install %if %{with python_binding} -pushd $RPM_BUILD_ROOT/%{py_sitedir} +%if 0%{?suse_version} +pushd $RPM_BUILD_ROOT/%{python_sitearch} python %py_libdir/py_compile.py *.py python -O %py_libdir/py_compile.py *.py popd %endif +%endif # we want to leave the .a file untouched export NO_BRP_STRIP_DEBUG=true @@ -240,7 +243,7 @@ rm -rf "$RPM_BUILD_ROOT" %if %{with python_binding} %files -n python-solv %defattr(-,root,root) -%{py_sitedir}/* +%{python_sitearch}/* %endif %changelog -- 2.47.2