From 863db42ef3a4fe90804abc8c63b2edaffd6fe066 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Thu, 28 May 2015 17:19:52 +0300 Subject: [PATCH] Move python bindings to python folder to simplify import --- libreoffice.spec | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libreoffice.spec b/libreoffice.spec index ada0e56..7c432a5 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -46,7 +46,7 @@ Version: 4.4.3 %if "%{beta}" != "" Release: 0.%{beta}.1 %else -Release: 2 +Release: 3 %endif License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic Group: Office @@ -3458,6 +3458,23 @@ sed -i '/^ProgressPosition/d;/^ProgressSize/d' \ echo 'ProgressPosition=10,307' >> %{buildroot}%{ooodir}/program/sofficerc echo 'ProgressSize=377,9' >> %{buildroot}%{ooodir}/program/sofficerc + +# move python bits into site-packages +mkdir -p %{buildroot}/%{py3_platsitedir} +pushd %{buildroot}/%{py3_platsitedir} +echo "import sys, os" > uno.py +echo "sys.path.append('%{ooodir}/program')" >> uno.py +echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{baseinstdir}/program/fundamentalrc')" >> uno.py +cat %{buildroot}%{ooodir}/program/uno.py >> uno.py +rm -f %{buildroot}%{ooodir}/program/uno.py* +mv -f %{buildroot}%{ooodir}/program/unohelper.py* . +mv -f %{buildroot}%{ooodir}/program/officehelper.py* . +popd + +sed -i 's|%{ooodir}/program/uno.py|%{py3_platsitedir}/uno.py|' file-lists/pyuno_list.txt +sed -i 's|%{ooodir}/program/unohelper.py|%{py3_platsitedir}/unohelper.py|' file-lists/pyuno_list.txt +sed -i 's|%{ooodir}/program/officehelper.py|%{py3_platsitedir}/officehelper.py|' file-lists/pyuno_list.txt + # common shouldn't depend on writer... # but common does depend on libswdlo.so grep libswdlo.so file-lists/writer_list.txt >>file-lists/common_list.txt