From 8d2d19143c441ba33d8745fd2db4f90cbd4b05bbeda87ae5bc18f26d997df8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 20 May 2015 08:48:27 +0000 Subject: [PATCH 1/3] - Split out the share -> lib linker to hopefully allow sle11 build OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=279 --- libreoffice.changes | 5 +++ libreoffice.spec | 39 +++++++++---------- link-to-ooo-home | 93 --------------------------------------------- 3 files changed, 22 insertions(+), 115 deletions(-) delete mode 100644 link-to-ooo-home diff --git a/libreoffice.changes b/libreoffice.changes index 470096b..793915a 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 20 08:45:37 UTC 2015 - tchvatal@suse.com + +- Split out the share -> lib linker to hopefully allow sle11 build + ------------------------------------------------------------------- Wed May 13 11:31:52 UTC 2015 - tchvatal@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index 6e440f7..84390b4 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -77,9 +77,6 @@ Source20: libreoffice-desktop-icons-256x256.tar.bz2 Source99: %{name}-rpmlintrc # Prebuilt sofficerc for the noarch upstream branding package Source201: sofficerc-upstream -# helper scripts -# create compat symlinks from %{_datadir} to %{_prefix}/lib(64); used by noarch packages -Source300: link-to-ooo-home # prebuilt extensions Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{numbertext_version}.oxt # used extensions sources @@ -385,8 +382,8 @@ This package includes the original branding for the LibreOffice office suite. Summary: Crystal LibreOffice Icon Theme (KDE3 default) License: LGPL-2.1 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} %if %{with noarch_subpkgs} @@ -400,8 +397,8 @@ This package provides Crystal LibreOffice icon theme. It is used in KDE3 by defa Summary: Galaxy LibreOffice Icon Theme (OOo-3.x default) License: LGPL-3.0 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Supplements: libreoffice Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} @@ -416,8 +413,8 @@ This package provides Galaxy LibreOffice icon theme. It is used in the original Summary: Hicontrast LibreOffice Icon Theme License: LGPL-3.0 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Supplements: libreoffice Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} @@ -432,8 +429,8 @@ This package provides Hicontrast LibreOffice icon theme. Summary: Oxygen LibreOffice Icon Theme (KDE4 default) License: LGPL-3.0 or CC-BY-SA-3.0 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Supplements: packageand(libreoffice:kdebase4-workspace) Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} @@ -448,8 +445,8 @@ This package provides Oxygen LibreOffice icon theme. It is used in KDE4 by defau Summary: Sifr LibreOffice Icon Theme License: LGPL-3.0 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Supplements: libreoffice Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} @@ -464,8 +461,8 @@ This package provides Sifr LibreOffice icon theme. Summary: Tango LibreOffice Icon Theme (GNOME default) License: LGPL-3.0 Group: Productivity/Office/Suite -Requires(post): %{name} = %{version} -Requires(postun): %{name} = %{version} +Requires(post): %{name}-share-linker +Requires(postun): %{name}-share-linker Supplements: packageand(libreoffice:gnome-session) Provides: libreoffice-icon-themes = %{version} Obsoletes: libreoffice-icon-themes < %{version} @@ -754,12 +751,12 @@ done \ %posttrans %{1} \ rpm -ql %{name}-%{1} > %{_datadir}/libreoffice/%{1}_list.txt || true \ if [ -f %{_datadir}/libreoffice/%{1}_list.txt ] ; then \ - %{_datadir}/libreoffice/link-to-ooo-home %{_datadir}/libreoffice/%{1}_list.txt || true \ + %{_bindir}/libreoffice-share-linker %{_datadir}/libreoffice/%{1}_list.txt || true \ fi \ \ %postun %{1} \ -if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{1}_list.txt -a -f %{_datadir}/libreoffice/link-to-ooo-home ]; then \ - %{_datadir}/libreoffice/link-to-ooo-home --unlink %{_datadir}/libreoffice/%{1}_list.txt || true \ +if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{1}_list.txt -a -f %{_bindir}/libreoffice-share-linker ]; then \ + %{_bindir}/libreoffice-share-linker --unlink %{_datadir}/libreoffice/%{1}_list.txt || true \ rm -f %{_datadir}/libreoffice/%{1}_list.txt 2> /dev/null || true \ fi \ %{nil} @@ -841,8 +838,8 @@ Summary: %{langname} Localization Files for LibreOffice \ Group: Productivity/Office/Suite \ Requires: %{name} = %{version} \ Provides: locale(libreoffice:%{lang}) \ -Requires(post,): %{name} = %{version} \ -Requires(postun,): %{name} = %{version} \ +BuildRequires: %{name}-share-linker \ +Requires: %{name}-share-linker \ %if %{with noarch_subpkgs} \ BuildArch: noarch \ %endif \ @@ -1189,11 +1186,9 @@ cd - ################ # compat stuff for noarch packages mkdir -p %{buildroot}/%{_datadir}/%{name}/program -install -m 755 $RPM_SOURCE_DIR/link-to-ooo-home %{buildroot}%{_datadir}/%{name}/ echo "%dir %{_libdir}/%{name}" >>file-lists/common_list.txt echo "%dir %{_datadir}/%{name}" >>file-lists/common_list.txt echo "%dir %{_datadir}/%{name}/program" >>file-lists/common_list.txt -echo "%{_datadir}/%{name}/link-to-ooo-home" >>file-lists/common_list.txt ################ # helper script for noarch packages # add missing directories to the file list diff --git a/link-to-ooo-home b/link-to-ooo-home deleted file mode 100644 index ff763b7..0000000 --- a/link-to-ooo-home +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash - -usage() { - echo "This script (un)links or unlinks the given to/from libreoffice home" - echo - echo "Usage: ${0##*/} [--unlink] filelist" -} - -change_linking() { - local libdir="$1" - local filelist="$2" - local linkfile="" - local linkdir="" - - # Decide if we are linking or wiping first - if ${link_mode}; then - # Grab all files from the proper folder - for file in `cat ${filelist} | grep "/usr/share/libreoffice" | sort`; do - # if we get ourselves folder then just create it - # it might not be around so lets be safe - if [[ -d "${file}" ]] ; then - dirname="${file/${datadir}/${libdir}}" - # if the location is already there skip it - if [[ ! -e "${dirname}" ]]; then - mkdir -p "${dirname}" - fi - continue - fi - linkfile="${file/${datadir}/${libdir}}" - # if the file is already there, skip it - # this is true when the parent folder is link - if [[ ! -e "${linkfile}" ]]; then - ln -sf "${file}" "${linkfile}" || exit 1 - fi - done - else - # first just remove the symlinks - for file in `cat ${filelist} | grep "/usr/share/libreoffice" | sort`; do - linkfile=${file/${datadir}/${libdir}} - if [[ -L "${linkfile}" && ! -r "${linkfile}" && ! -d "${linkfile}" ]]; then - rm -f "${linkfile}" || exit 1 - fi - done - # continue by wiping out all EMPTY dirs - # we have to be sure it is not owned by anything else - # doing in 2nd run to ensure avoiding collisions - for file in `cat ${filelist} | grep "/usr/share/libreoffice" | sort`; do - linkdir="${file/${datadir}/${libdir}}" - if [[ -d "${linkdir}" && -z `ls "${linkdir}"/*` ]]; then - # check if nothing else owns the dir - if [[ $(rpm -qf "${file}" 2>/dev/null |wc -l) == 0 ]]; then - rmdir "${linkdir}" || exit 1 - fi - fi - done - fi -} - -# Global VARS -link_mode=true -datadir=/usr/share -libdirs=( - "/usr/lib/" - "/usr/lib64/" - "/usr/lib32/" -) - -if [[ "$1" == "--unlink" ]]; then - link_mode=false - shift -fi - -if [[ "$1" == "--help" ]]; then - usage - exit 0 -fi - -# Verify we have just one left argument which is the filelist -if [[ $# > 1 || ! -f "$1" ]]; then - usage - exit 1 -fi - -for libdir in ${libdirs[@]}; do - # for each dir verify there is libreoffice folder, otherwise skip - if [[ ! -d "${libdir}/libreoffice/" ]]; then - continue - fi - change_linking ${libdir} $1 - # remove dangling links as they might happen when migratin from older - # libreoffice versions - find ${libdir}/libreoffice -type l -xtype l -delete -done From 85570d3ec04f1a2e5a916f1a0a66ee9879b78e7b946a504dba5d8499aedbca6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 20 May 2015 08:51:35 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=280 --- libreoffice.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libreoffice.spec b/libreoffice.spec index 84390b4..7dec911 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -172,6 +172,7 @@ Patch6: 0001-Make-cpp-poppler-version.h-header-optional.patch Patch7: 0001-Make-HAVE_JAVA6-be-always-false.patch # try to save space by using hardlinks Patch990: install-with-hardlinks.diff +BuildRequires: %{name}-share-linker BuildRequires: %{python_type}-devel BuildRequires: %{python_type}-xml BuildRequires: ImageMagick @@ -837,9 +838,8 @@ fi \ Summary: %{langname} Localization Files for LibreOffice \ Group: Productivity/Office/Suite \ Requires: %{name} = %{version} \ -Provides: locale(libreoffice:%{lang}) \ -BuildRequires: %{name}-share-linker \ Requires: %{name}-share-linker \ +Provides: locale(libreoffice:%{lang}) \ %if %{with noarch_subpkgs} \ BuildArch: noarch \ %endif \ From 7c63d3d6faf7ee46227337efa9c480b510d6886891cecad58359fea7097a6cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 21 May 2015 11:59:22 +0000 Subject: [PATCH 3/3] - Update %post scriptlets to work on sle11 again OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=281 --- libreoffice.changes | 5 +++ libreoffice.spec | 75 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/libreoffice.changes b/libreoffice.changes index 793915a..650afcf 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 21 11:59:03 UTC 2015 - tchvatal@suse.com + +- Update %post scriptlets to work on sle11 again + ------------------------------------------------------------------- Wed May 20 08:45:37 UTC 2015 - tchvatal@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index 7dec911..801002a 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -1235,7 +1235,6 @@ mkdir -p %{buildroot}/%{_datadir}/%{name}/share/autotext/ grep -v '%{_libdir}/%{name}/share/autotext' file-lists/common_list.txt > tmplist mv tmplist file-lists/common_list.txt mv %{buildroot}/%{_libdir}/%{name}/share/autotext/ %{buildroot}/%{_datadir}/%{name}/share/ -echo "%ghost %{_libdir}/%{name}/share/autotext" >> file-lists/common_list.txt ################ # branding split @@ -1319,9 +1318,16 @@ chrpath --delete %{buildroot}%{_libdir}/%{name}/program/librasqal-lo.so.3 %post /sbin/ldconfig +%if %suse_version > 1130 %mime_database_post %desktop_database_post %icon_theme_cache_post +%else +test -f /usr/bin/update-mime-database && /usr/bin/update-mime-database %{_datadir}/mime > /dev/null || : +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.gtk2 && SuSEconfig --module gtk2 > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %preun uno_cache="%{_libdir}/%{name}/share/uno_packages/cache/uno_packages/" @@ -1332,45 +1338,112 @@ exit 0 %postun /sbin/ldconfig +%if %suse_version > 1130 %icon_theme_cache_postun %desktop_database_postun %mime_database_postun +%else +test -f /usr/bin/update-mime-database && /usr/bin/update-mime-database %{_datadir}/mime > /dev/null || : +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.gtk2 && SuSEconfig --module gtk2 > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post base +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun base +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post calc +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun calc +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post draw +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun draw +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post math +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun math +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post impress +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun impress +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %post writer +%if %suse_version > 1130 %desktop_database_post +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %postun writer +%if %suse_version > 1130 %desktop_database_postun +%else +test -f /usr/bin/update-desktop-database && /usr/bin/update-desktop-database > /dev/null || : +test -f /sbin/conf.d/SuSEconfig.glib2 && SuSEconfig --module glib2 > /dev/null || : +%endif %_link_noarch_files icon-theme-crystal %_link_noarch_files icon-theme-galaxy