- 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
This commit is contained in:
parent
ac3b5e7352
commit
8d2d19143c
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user