From: Michael Schroeder Date: Mon, 18 Jul 2011 15:22:47 +0000 (+0200) Subject: - fix python bindings on fedora X-Git-Tag: BASE-SuSE-Code-12_1-Branch~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba0ea2742585e0cb9a6a771b86a6457e1ce61b6;p=thirdparty%2Flibsolv.git - fix python bindings on fedora --- 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