From dd35a886f8ead10a8419f3c74928b62a9b7d3608fdc8710e7d82ac2dc2bd6965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 4 Jun 2015 10:51:03 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=284 --- libreoffice.spec | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libreoffice.spec b/libreoffice.spec index 69dd8ed..a9e883f 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -1316,6 +1316,28 @@ chrpath --delete %{buildroot}%{_libdir}/%{name}/program/librasqal-lo.so.3 # Generate python cache files %{python_type} -m compileall %{buildroot}/%{_libdir}/libreoffice/program/ %{python_type} -m compileall %{buildroot}/%{_libdir}/libreoffice/share/extensions/ +# pyuno links to pysitedir +%{python_type} -m compileall %{buildroot}/%{python3_sitelib} + +# Move python cache to respective filelist +for i in file-lists/*.txt; do + if [ `cat "${i}" | grep py |wc -l` -gt 0 ]; then + cat "${i}" | grep py > pyfiles.txt + for j in `cat pyfiles.txt`; do + # python3 has __pycache__ dir while py2 does not + %if %{with newmedia} + pydir="${j%/*}" + pyname="${j##*/}" + echo "%dir ${pydir}/__pycache__/" >> "${i}" + echo "${pydir}/__pycache__/${pyname%.*}*.pyc" >> "${i}" + %else + # just add c to state pyc + echo "${j}c" >> "${i}" + %endif + done + fi +done +rm pyfiles.txt # We have ton of duped files so run over it %fdupes %{buildroot}%{_prefix}