- Rewrite the script to Python: * the current script is quite slow and delays libreoffice package build where we install all packages and then uninstall them * the script uses linkfile=${file/${datadir}/${libdir}} for replacement of $datadir prefix with $libdir (if the $file path starts with $datadir; if not, we end up with an empty string and we execute various shell scripts with it * the Python implementation should be more readable * the Python version runs about 200s faster when it comes to libreoffice package build (on a recent Ryzen 9 machine) OBS-URL: https://build.opensuse.org/request/show/1072269 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice-share-linker?expand=0&rev=12
56 lines
1.7 KiB
RPMSpec
56 lines
1.7 KiB
RPMSpec
#
|
|
# spec file for package libreoffice-share-linker
|
|
#
|
|
# Copyright (c) 2023 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: libreoffice-share-linker
|
|
Version: 1
|
|
Release: 0
|
|
Summary: Script to link/unlink files to libreoffice home
|
|
License: MIT
|
|
Group: Productivity/Office/Suite
|
|
URL: http://www.opensuse.org/
|
|
Source0: libreoffice-share-linker.py
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
Requires: python3
|
|
BuildArch: noarch
|
|
|
|
%description
|
|
Script that links and unlinks files from %{_datadir} to libreoffice
|
|
home as libreoffice layout is not set up for noarch packages otherwise.
|
|
|
|
%prep
|
|
:
|
|
|
|
%build
|
|
:
|
|
|
|
%install
|
|
install -Dm 755 %{SOURCE0} %{buildroot}%{_bindir}/%{name}
|
|
# compat for migration from older releases openSUSE-13.1 and older
|
|
mkdir -p %{buildroot}%{_datadir}/libreoffice
|
|
pushd %{buildroot}%{_datadir}/libreoffice > /dev/null
|
|
ln -s %{_bindir}/%{name} libreoffice-share-linker.py
|
|
popd > /dev/null
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%{_bindir}/%{name}
|
|
%dir %{_datadir}/libreoffice/
|
|
%{_datadir}/libreoffice/libreoffice-share-linker.py
|
|
|
|
%changelog
|