Accepting request 309068 from LibreOffice:Factory

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/309068
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libreoffice?expand=0&rev=93
This commit is contained in:
Dominique Leuenberger 2015-05-30 10:33:17 +00:00 committed by Git OBS Bridge
commit 20b7d6424e
3 changed files with 101 additions and 116 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
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
- Split out the share -> lib linker to hopefully allow sle11 build
------------------------------------------------------------------- -------------------------------------------------------------------
Wed May 13 11:31:52 UTC 2015 - tchvatal@suse.com Wed May 13 11:31:52 UTC 2015 - tchvatal@suse.com

View File

@ -77,9 +77,6 @@ Source20: libreoffice-desktop-icons-256x256.tar.bz2
Source99: %{name}-rpmlintrc Source99: %{name}-rpmlintrc
# Prebuilt sofficerc for the noarch upstream branding package # Prebuilt sofficerc for the noarch upstream branding package
Source201: sofficerc-upstream 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 # prebuilt extensions
Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{numbertext_version}.oxt Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{numbertext_version}.oxt
# used extensions sources # used extensions sources
@ -175,6 +172,7 @@ Patch6: 0001-Make-cpp-poppler-version.h-header-optional.patch
Patch7: 0001-Make-HAVE_JAVA6-be-always-false.patch Patch7: 0001-Make-HAVE_JAVA6-be-always-false.patch
# try to save space by using hardlinks # try to save space by using hardlinks
Patch990: install-with-hardlinks.diff Patch990: install-with-hardlinks.diff
BuildRequires: %{name}-share-linker
BuildRequires: %{python_type}-devel BuildRequires: %{python_type}-devel
BuildRequires: %{python_type}-xml BuildRequires: %{python_type}-xml
BuildRequires: ImageMagick BuildRequires: ImageMagick
@ -385,8 +383,8 @@ This package includes the original branding for the LibreOffice office suite.
Summary: Crystal LibreOffice Icon Theme (KDE3 default) Summary: Crystal LibreOffice Icon Theme (KDE3 default)
License: LGPL-2.1 License: LGPL-2.1
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
%if %{with noarch_subpkgs} %if %{with noarch_subpkgs}
@ -400,8 +398,8 @@ This package provides Crystal LibreOffice icon theme. It is used in KDE3 by defa
Summary: Galaxy LibreOffice Icon Theme (OOo-3.x default) Summary: Galaxy LibreOffice Icon Theme (OOo-3.x default)
License: LGPL-3.0 License: LGPL-3.0
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Supplements: libreoffice Supplements: libreoffice
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
@ -416,8 +414,8 @@ This package provides Galaxy LibreOffice icon theme. It is used in the original
Summary: Hicontrast LibreOffice Icon Theme Summary: Hicontrast LibreOffice Icon Theme
License: LGPL-3.0 License: LGPL-3.0
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Supplements: libreoffice Supplements: libreoffice
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
@ -432,8 +430,8 @@ This package provides Hicontrast LibreOffice icon theme.
Summary: Oxygen LibreOffice Icon Theme (KDE4 default) Summary: Oxygen LibreOffice Icon Theme (KDE4 default)
License: LGPL-3.0 or CC-BY-SA-3.0 License: LGPL-3.0 or CC-BY-SA-3.0
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Supplements: packageand(libreoffice:kdebase4-workspace) Supplements: packageand(libreoffice:kdebase4-workspace)
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
@ -448,8 +446,8 @@ This package provides Oxygen LibreOffice icon theme. It is used in KDE4 by defau
Summary: Sifr LibreOffice Icon Theme Summary: Sifr LibreOffice Icon Theme
License: LGPL-3.0 License: LGPL-3.0
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Supplements: libreoffice Supplements: libreoffice
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
@ -464,8 +462,8 @@ This package provides Sifr LibreOffice icon theme.
Summary: Tango LibreOffice Icon Theme (GNOME default) Summary: Tango LibreOffice Icon Theme (GNOME default)
License: LGPL-3.0 License: LGPL-3.0
Group: Productivity/Office/Suite Group: Productivity/Office/Suite
Requires(post): %{name} = %{version} Requires(post): %{name}-share-linker
Requires(postun): %{name} = %{version} Requires(postun): %{name}-share-linker
Supplements: packageand(libreoffice:gnome-session) Supplements: packageand(libreoffice:gnome-session)
Provides: libreoffice-icon-themes = %{version} Provides: libreoffice-icon-themes = %{version}
Obsoletes: libreoffice-icon-themes < %{version} Obsoletes: libreoffice-icon-themes < %{version}
@ -754,12 +752,12 @@ done \
%posttrans %{1} \ %posttrans %{1} \
rpm -ql %{name}-%{1} > %{_datadir}/libreoffice/%{1}_list.txt || true \ rpm -ql %{name}-%{1} > %{_datadir}/libreoffice/%{1}_list.txt || true \
if [ -f %{_datadir}/libreoffice/%{1}_list.txt ] ; then \ 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 \ fi \
\ \
%postun %{1} \ %postun %{1} \
if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{1}_list.txt -a -f %{_datadir}/libreoffice/link-to-ooo-home ]; then \ if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{1}_list.txt -a -f %{_bindir}/libreoffice-share-linker ]; then \
%{_datadir}/libreoffice/link-to-ooo-home --unlink %{_datadir}/libreoffice/%{1}_list.txt || true \ %{_bindir}/libreoffice-share-linker --unlink %{_datadir}/libreoffice/%{1}_list.txt || true \
rm -f %{_datadir}/libreoffice/%{1}_list.txt 2> /dev/null || true \ rm -f %{_datadir}/libreoffice/%{1}_list.txt 2> /dev/null || true \
fi \ fi \
%{nil} %{nil}
@ -840,9 +838,8 @@ fi \
Summary: %{langname} Localization Files for LibreOffice \ Summary: %{langname} Localization Files for LibreOffice \
Group: Productivity/Office/Suite \ Group: Productivity/Office/Suite \
Requires: %{name} = %{version} \ Requires: %{name} = %{version} \
Requires: %{name}-share-linker \
Provides: locale(libreoffice:%{lang}) \ Provides: locale(libreoffice:%{lang}) \
Requires(post,): %{name} = %{version} \
Requires(postun,): %{name} = %{version} \
%if %{with noarch_subpkgs} \ %if %{with noarch_subpkgs} \
BuildArch: noarch \ BuildArch: noarch \
%endif \ %endif \
@ -1189,11 +1186,9 @@ cd -
################ ################
# compat stuff for noarch packages # compat stuff for noarch packages
mkdir -p %{buildroot}/%{_datadir}/%{name}/program 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 %{_libdir}/%{name}" >>file-lists/common_list.txt
echo "%dir %{_datadir}/%{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 "%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 # helper script for noarch packages
# add missing directories to the file list # add missing directories to the file list
@ -1240,7 +1235,6 @@ mkdir -p %{buildroot}/%{_datadir}/%{name}/share/autotext/
grep -v '%{_libdir}/%{name}/share/autotext' file-lists/common_list.txt > tmplist grep -v '%{_libdir}/%{name}/share/autotext' file-lists/common_list.txt > tmplist
mv tmplist file-lists/common_list.txt mv tmplist file-lists/common_list.txt
mv %{buildroot}/%{_libdir}/%{name}/share/autotext/ %{buildroot}/%{_datadir}/%{name}/share/ mv %{buildroot}/%{_libdir}/%{name}/share/autotext/ %{buildroot}/%{_datadir}/%{name}/share/
echo "%ghost %{_libdir}/%{name}/share/autotext" >> file-lists/common_list.txt
################ ################
# branding split # branding split
@ -1324,9 +1318,16 @@ chrpath --delete %{buildroot}%{_libdir}/%{name}/program/librasqal-lo.so.3
%post %post
/sbin/ldconfig /sbin/ldconfig
%if %suse_version > 1130
%mime_database_post %mime_database_post
%desktop_database_post %desktop_database_post
%icon_theme_cache_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 %preun
uno_cache="%{_libdir}/%{name}/share/uno_packages/cache/uno_packages/" uno_cache="%{_libdir}/%{name}/share/uno_packages/cache/uno_packages/"
@ -1337,45 +1338,112 @@ exit 0
%postun %postun
/sbin/ldconfig /sbin/ldconfig
%if %suse_version > 1130
%icon_theme_cache_postun %icon_theme_cache_postun
%desktop_database_postun %desktop_database_postun
%mime_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 %post base
%if %suse_version > 1130
%desktop_database_post %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 %postun base
%if %suse_version > 1130
%desktop_database_postun %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 %post calc
%if %suse_version > 1130
%desktop_database_post %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 %postun calc
%if %suse_version > 1130
%desktop_database_postun %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 %post draw
%if %suse_version > 1130
%desktop_database_post %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 %postun draw
%if %suse_version > 1130
%desktop_database_postun %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 %post math
%if %suse_version > 1130
%desktop_database_post %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 %postun math
%if %suse_version > 1130
%desktop_database_postun %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 %post impress
%if %suse_version > 1130
%desktop_database_post %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 %postun impress
%if %suse_version > 1130
%desktop_database_postun %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 %post writer
%if %suse_version > 1130
%desktop_database_post %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 %postun writer
%if %suse_version > 1130
%desktop_database_postun %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-crystal
%_link_noarch_files icon-theme-galaxy %_link_noarch_files icon-theme-galaxy

View File

@ -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