- fix python bindings on fedora
authorMichael Schroeder <mls@suse.de>
Mon, 18 Jul 2011 15:22:47 +0000 (17:22 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 18 Jul 2011 15:22:47 +0000 (17:22 +0200)
package/libsolv.spec.in

index 5063db5..c767645 100644 (file)
@@ -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