From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- solenv/bin/add-modelines | 169 ++ solenv/bin/assemble-flatpak-appdata.sh | 96 + solenv/bin/assemble-flatpak-desktop.sh | 42 + solenv/bin/assemble-flatpak.sh | 71 + solenv/bin/bin_library_info.sh | 188 ++ solenv/bin/call_installer.sh | 47 + solenv/bin/clipatchconfig.pl | 122 + solenv/bin/concat-deps.c | 1231 +++++++++ solenv/bin/constructors.py | 27 + solenv/bin/create-ids | 18 + solenv/bin/create-tags | 47 + solenv/bin/createcomponent.xslt | 87 + solenv/bin/dbgsv.ini | 20 + solenv/bin/desktop-translate.py | 172 ++ solenv/bin/exectest.pl | 103 + solenv/bin/finish-gbuild-trace.py | 137 + solenv/bin/fix-includes.pl | 95 + solenv/bin/gdb-core-bt.sh | 71 + solenv/bin/gdb_cxa-atexit_trace-stdout | 8 + solenv/bin/gdbtrycatchtrace | 21 + solenv/bin/gdbtrycatchtrace-stdout | 14 + solenv/bin/generate-flatpak-manifest.sh | 23 + solenv/bin/generate-tokens.py | 80 + solenv/bin/gentoken.py | 54 + solenv/bin/getcompver.awk | 84 + solenv/bin/hrcex | 39 + solenv/bin/id-lang.map | 114 + solenv/bin/image-sort.py | 155 ++ solenv/bin/install-gdb-printers | 143 ++ solenv/bin/install-sh | 3 + solenv/bin/job-limiter.cpp | 116 + solenv/bin/localestr | 20 + solenv/bin/macosx-change-install-names.pl | 95 + solenv/bin/macosx-codesign-app-bundle | 152 ++ solenv/bin/macosx_menubar_modification.xsl | 43 + solenv/bin/make-raspbian-root-tarball | 81 + solenv/bin/make_installer.pl | 26 + solenv/bin/mkdocs.Makefile | 46 + solenv/bin/mkdocs.sh | 281 +++ solenv/bin/mkdocs_portal.sh | 157 ++ solenv/bin/mkonedoc.sh | 45 + solenv/bin/modules/RepositoryHelper.pm | 161 ++ solenv/bin/modules/installer.pm | 1700 +++++++++++++ solenv/bin/modules/installer/control.pm | 478 ++++ solenv/bin/modules/installer/converter.pm | 187 ++ solenv/bin/modules/installer/copyproject.pm | 105 + solenv/bin/modules/installer/download.pm | 666 +++++ solenv/bin/modules/installer/environment.pm | 134 + solenv/bin/modules/installer/epmfile.pm | 2665 ++++++++++++++++++++ solenv/bin/modules/installer/exiter.pm | 33 + solenv/bin/modules/installer/filelists.pm | 157 ++ solenv/bin/modules/installer/files.pm | 120 + solenv/bin/modules/installer/globals.pm | 294 +++ solenv/bin/modules/installer/helppack.pm | 530 ++++ solenv/bin/modules/installer/languagepack.pm | 512 ++++ solenv/bin/modules/installer/languages.pm | 145 ++ solenv/bin/modules/installer/logger.pm | 256 ++ solenv/bin/modules/installer/packagelist.pm | 843 +++++++ solenv/bin/modules/installer/parameter.pm | 545 ++++ solenv/bin/modules/installer/pathanalyzer.pm | 69 + solenv/bin/modules/installer/profiles.pm | 226 ++ solenv/bin/modules/installer/remover.pm | 53 + solenv/bin/modules/installer/scpzipfiles.pm | 146 ++ solenv/bin/modules/installer/scriptitems.pm | 2373 +++++++++++++++++ solenv/bin/modules/installer/setupscript.pm | 489 ++++ solenv/bin/modules/installer/simplepackage.pm | 764 ++++++ solenv/bin/modules/installer/strip.pm | 136 + solenv/bin/modules/installer/systemactions.pm | 1332 ++++++++++ solenv/bin/modules/installer/windows/admin.pm | 518 ++++ solenv/bin/modules/installer/windows/assembly.pm | 282 +++ solenv/bin/modules/installer/windows/binary.pm | 70 + solenv/bin/modules/installer/windows/component.pm | 508 ++++ .../bin/modules/installer/windows/createfolder.pm | 157 ++ solenv/bin/modules/installer/windows/directory.pm | 637 +++++ solenv/bin/modules/installer/windows/feature.pm | 406 +++ .../modules/installer/windows/featurecomponent.pm | 168 ++ solenv/bin/modules/installer/windows/file.pm | 1023 ++++++++ solenv/bin/modules/installer/windows/font.pm | 72 + solenv/bin/modules/installer/windows/icon.pm | 71 + solenv/bin/modules/installer/windows/idtglobal.pm | 1865 ++++++++++++++ solenv/bin/modules/installer/windows/inifile.pm | 124 + solenv/bin/modules/installer/windows/language.pm | 44 + solenv/bin/modules/installer/windows/media.pm | 205 ++ .../bin/modules/installer/windows/mergemodule.pm | 1707 +++++++++++++ solenv/bin/modules/installer/windows/msiglobal.pm | 1687 +++++++++++++ .../installer/windows/msishortcutproperty.pm | 146 ++ solenv/bin/modules/installer/windows/property.pm | 570 +++++ solenv/bin/modules/installer/windows/registry.pm | 410 +++ solenv/bin/modules/installer/windows/removefile.pm | 144 ++ solenv/bin/modules/installer/windows/shortcut.pm | 665 +++++ solenv/bin/modules/installer/windows/strip.pm | 152 ++ solenv/bin/modules/installer/windows/update.pm | 623 +++++ solenv/bin/modules/installer/windows/upgrade.pm | 83 + solenv/bin/modules/installer/worker.pm | 924 +++++++ solenv/bin/modules/installer/ziplist.pm | 829 ++++++ solenv/bin/modules/par2script/check.pm | 337 +++ solenv/bin/modules/par2script/converter.pm | 52 + solenv/bin/modules/par2script/exiter.pm | 112 + solenv/bin/modules/par2script/files.pm | 64 + solenv/bin/modules/par2script/globals.pm | 67 + solenv/bin/modules/par2script/module.pm | 255 ++ solenv/bin/modules/par2script/parameter.pm | 145 ++ solenv/bin/modules/par2script/remover.pm | 42 + solenv/bin/modules/par2script/undefine.pm | 135 + solenv/bin/modules/par2script/work.pm | 414 +++ solenv/bin/modules/pre2par/directory.pm | 45 + solenv/bin/modules/pre2par/exiter.pm | 61 + solenv/bin/modules/pre2par/files.pm | 55 + solenv/bin/modules/pre2par/globals.pm | 51 + solenv/bin/modules/pre2par/language.pm | 135 + solenv/bin/modules/pre2par/parameter.pm | 144 ++ solenv/bin/modules/pre2par/pathanalyzer.pm | 67 + solenv/bin/modules/pre2par/remover.pm | 34 + solenv/bin/modules/pre2par/systemactions.pm | 81 + solenv/bin/modules/pre2par/work.pm | 297 +++ solenv/bin/modules/t/installer-packagelist.t | 40 + solenv/bin/modules/t/installer-profiles.t | 43 + solenv/bin/modules/t/installer-scpzipfiles.t | 54 + solenv/bin/modules/t/installer-setupscript.t | 58 + solenv/bin/native-code.py | 969 +++++++ solenv/bin/ooinstall | 118 + solenv/bin/optionalimplementations.xslt | 21 + solenv/bin/pack_images.py | 612 +++++ solenv/bin/packcomponents.xslt | 45 + solenv/bin/packregistry.xslt | 80 + solenv/bin/par2script.pl | 106 + solenv/bin/polib.py | 1868 ++++++++++++++ solenv/bin/pre2par.pl | 62 + solenv/bin/run-configure | 9 + solenv/bin/uiex | 38 + solenv/bin/uiimagelist.xsl | 36 + solenv/bin/version.py | 49 + solenv/bin/write_classpath.sh | 16 + 133 files changed, 40569 insertions(+) create mode 100755 solenv/bin/add-modelines create mode 100755 solenv/bin/assemble-flatpak-appdata.sh create mode 100755 solenv/bin/assemble-flatpak-desktop.sh create mode 100755 solenv/bin/assemble-flatpak.sh create mode 100755 solenv/bin/bin_library_info.sh create mode 100755 solenv/bin/call_installer.sh create mode 100644 solenv/bin/clipatchconfig.pl create mode 100644 solenv/bin/concat-deps.c create mode 100755 solenv/bin/constructors.py create mode 100755 solenv/bin/create-ids create mode 100755 solenv/bin/create-tags create mode 100644 solenv/bin/createcomponent.xslt create mode 100644 solenv/bin/dbgsv.ini create mode 100644 solenv/bin/desktop-translate.py create mode 100644 solenv/bin/exectest.pl create mode 100755 solenv/bin/finish-gbuild-trace.py create mode 100755 solenv/bin/fix-includes.pl create mode 100755 solenv/bin/gdb-core-bt.sh create mode 100644 solenv/bin/gdb_cxa-atexit_trace-stdout create mode 100644 solenv/bin/gdbtrycatchtrace create mode 100644 solenv/bin/gdbtrycatchtrace-stdout create mode 100755 solenv/bin/generate-flatpak-manifest.sh create mode 100644 solenv/bin/generate-tokens.py create mode 100644 solenv/bin/gentoken.py create mode 100644 solenv/bin/getcompver.awk create mode 100755 solenv/bin/hrcex create mode 100644 solenv/bin/id-lang.map create mode 100644 solenv/bin/image-sort.py create mode 100755 solenv/bin/install-gdb-printers create mode 100755 solenv/bin/install-sh create mode 100644 solenv/bin/job-limiter.cpp create mode 100755 solenv/bin/localestr create mode 100644 solenv/bin/macosx-change-install-names.pl create mode 100755 solenv/bin/macosx-codesign-app-bundle create mode 100644 solenv/bin/macosx_menubar_modification.xsl create mode 100755 solenv/bin/make-raspbian-root-tarball create mode 100644 solenv/bin/make_installer.pl create mode 100644 solenv/bin/mkdocs.Makefile create mode 100755 solenv/bin/mkdocs.sh create mode 100755 solenv/bin/mkdocs_portal.sh create mode 100755 solenv/bin/mkonedoc.sh create mode 100644 solenv/bin/modules/RepositoryHelper.pm create mode 100644 solenv/bin/modules/installer.pm create mode 100644 solenv/bin/modules/installer/control.pm create mode 100644 solenv/bin/modules/installer/converter.pm create mode 100644 solenv/bin/modules/installer/copyproject.pm create mode 100644 solenv/bin/modules/installer/download.pm create mode 100644 solenv/bin/modules/installer/environment.pm create mode 100644 solenv/bin/modules/installer/epmfile.pm create mode 100644 solenv/bin/modules/installer/exiter.pm create mode 100644 solenv/bin/modules/installer/filelists.pm create mode 100644 solenv/bin/modules/installer/files.pm create mode 100644 solenv/bin/modules/installer/globals.pm create mode 100644 solenv/bin/modules/installer/helppack.pm create mode 100644 solenv/bin/modules/installer/languagepack.pm create mode 100644 solenv/bin/modules/installer/languages.pm create mode 100644 solenv/bin/modules/installer/logger.pm create mode 100644 solenv/bin/modules/installer/packagelist.pm create mode 100644 solenv/bin/modules/installer/parameter.pm create mode 100644 solenv/bin/modules/installer/pathanalyzer.pm create mode 100644 solenv/bin/modules/installer/profiles.pm create mode 100644 solenv/bin/modules/installer/remover.pm create mode 100644 solenv/bin/modules/installer/scpzipfiles.pm create mode 100644 solenv/bin/modules/installer/scriptitems.pm create mode 100644 solenv/bin/modules/installer/setupscript.pm create mode 100644 solenv/bin/modules/installer/simplepackage.pm create mode 100644 solenv/bin/modules/installer/strip.pm create mode 100644 solenv/bin/modules/installer/systemactions.pm create mode 100644 solenv/bin/modules/installer/windows/admin.pm create mode 100644 solenv/bin/modules/installer/windows/assembly.pm create mode 100644 solenv/bin/modules/installer/windows/binary.pm create mode 100644 solenv/bin/modules/installer/windows/component.pm create mode 100644 solenv/bin/modules/installer/windows/createfolder.pm create mode 100644 solenv/bin/modules/installer/windows/directory.pm create mode 100644 solenv/bin/modules/installer/windows/feature.pm create mode 100644 solenv/bin/modules/installer/windows/featurecomponent.pm create mode 100644 solenv/bin/modules/installer/windows/file.pm create mode 100644 solenv/bin/modules/installer/windows/font.pm create mode 100644 solenv/bin/modules/installer/windows/icon.pm create mode 100644 solenv/bin/modules/installer/windows/idtglobal.pm create mode 100644 solenv/bin/modules/installer/windows/inifile.pm create mode 100644 solenv/bin/modules/installer/windows/language.pm create mode 100644 solenv/bin/modules/installer/windows/media.pm create mode 100644 solenv/bin/modules/installer/windows/mergemodule.pm create mode 100644 solenv/bin/modules/installer/windows/msiglobal.pm create mode 100644 solenv/bin/modules/installer/windows/msishortcutproperty.pm create mode 100644 solenv/bin/modules/installer/windows/property.pm create mode 100644 solenv/bin/modules/installer/windows/registry.pm create mode 100644 solenv/bin/modules/installer/windows/removefile.pm create mode 100644 solenv/bin/modules/installer/windows/shortcut.pm create mode 100644 solenv/bin/modules/installer/windows/strip.pm create mode 100644 solenv/bin/modules/installer/windows/update.pm create mode 100644 solenv/bin/modules/installer/windows/upgrade.pm create mode 100644 solenv/bin/modules/installer/worker.pm create mode 100644 solenv/bin/modules/installer/ziplist.pm create mode 100644 solenv/bin/modules/par2script/check.pm create mode 100644 solenv/bin/modules/par2script/converter.pm create mode 100644 solenv/bin/modules/par2script/exiter.pm create mode 100644 solenv/bin/modules/par2script/files.pm create mode 100644 solenv/bin/modules/par2script/globals.pm create mode 100644 solenv/bin/modules/par2script/module.pm create mode 100644 solenv/bin/modules/par2script/parameter.pm create mode 100644 solenv/bin/modules/par2script/remover.pm create mode 100644 solenv/bin/modules/par2script/undefine.pm create mode 100644 solenv/bin/modules/par2script/work.pm create mode 100644 solenv/bin/modules/pre2par/directory.pm create mode 100644 solenv/bin/modules/pre2par/exiter.pm create mode 100644 solenv/bin/modules/pre2par/files.pm create mode 100644 solenv/bin/modules/pre2par/globals.pm create mode 100644 solenv/bin/modules/pre2par/language.pm create mode 100644 solenv/bin/modules/pre2par/parameter.pm create mode 100644 solenv/bin/modules/pre2par/pathanalyzer.pm create mode 100644 solenv/bin/modules/pre2par/remover.pm create mode 100644 solenv/bin/modules/pre2par/systemactions.pm create mode 100644 solenv/bin/modules/pre2par/work.pm create mode 100644 solenv/bin/modules/t/installer-packagelist.t create mode 100644 solenv/bin/modules/t/installer-profiles.t create mode 100644 solenv/bin/modules/t/installer-scpzipfiles.t create mode 100644 solenv/bin/modules/t/installer-setupscript.t create mode 100755 solenv/bin/native-code.py create mode 100755 solenv/bin/ooinstall create mode 100644 solenv/bin/optionalimplementations.xslt create mode 100644 solenv/bin/pack_images.py create mode 100644 solenv/bin/packcomponents.xslt create mode 100644 solenv/bin/packregistry.xslt create mode 100644 solenv/bin/par2script.pl create mode 100644 solenv/bin/polib.py create mode 100644 solenv/bin/pre2par.pl create mode 100755 solenv/bin/run-configure create mode 100755 solenv/bin/uiex create mode 100644 solenv/bin/uiimagelist.xsl create mode 100755 solenv/bin/version.py create mode 100755 solenv/bin/write_classpath.sh (limited to 'solenv/bin') diff --git a/solenv/bin/add-modelines b/solenv/bin/add-modelines new file mode 100755 index 0000000000..a3f59fe8ea --- /dev/null +++ b/solenv/bin/add-modelines @@ -0,0 +1,169 @@ +#!/usr/bin/env bash +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# add-modelines, a simple script to add comments to +# the beginning and end of source files for LibreOffice devs + +# Blame goes to Jesse Adelman (at least at first) +# someone AT boldandbusted dotty-dot com +# http://www.boldandbusted.com/ +# (c) 2010 Bold and Busted LLC + +# NOTE: At present, this script only works for files with C-like comments. +# NOTE: If you don't specify -p, the script will act on the current working directory. +# NOTE: If no arguments are specified, the definitions below are in effect. + +# TO DO +# - Deuglify? +# - Make source file type agnostic modelines? +# - Too many/too few comments? +# - Handle top level source directories with whitespace names? (Do they exist?) + +# Turn off globbing, helps with SourceFiles +set -f + +# POSIX +set -o posix + +# Change these to taste +FirstLine='/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */' +LastLine='/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */' +SourceFiles='*.cxx *.cpp *.hxx *.hpp *.c *.h *.m *.mm *.idl *.src *.hrc' + +# Set defaults (don't change these) +ModelineReplace="false" + +# Functions + +function SetEnvironment() +{ + if [ -n "$(which tail)" ] && [ -n "$(which head)" ]; then + { + headCMD=$(which head) + tailCMD=$(which tail) + } + else + { + echo "Missing head or tail, exiting..." + exit 1 + } + fi + if [ -n "$(which find)" ]; then + findCMD=$(which find) + else + { + echo "Missing find, exiting..." + exit 1 + } + fi +} + +function EditFile() +{ + local FileToEdit + local currentFirstLine + local currentLastLine + + FileToEdit="$1" + + currentFirstLine=$($headCMD -1 "$FileToEdit") + currentLastLine=$($tailCMD -1 "$FileToEdit") + + case "$ModelineReplace" in + "true" ) + if [ "${currentFirstLine:0:6}" = "${FirstLine:0:6}" ]; then + { + echo "$FirstLine" > "$FileToEdit".new + $tailCMD -n +2 "$FileToEdit" >> "$FileToEdit".new + } + fi + if [ -e "$FileToEdit.new" ]; then + { + echo "$LastLine" >> "$FileToEdit".new + } + fi + if [ "${currentLastLine:0:6}" = "${LastLine:0:6}" ]; then + { + $headCMD -n -1 "$FileToEdit" > "$FileToEdit".new + echo "$LastLine" >> "$FileToEdit".new + } + fi + mv "$FileToEdit".new "$FileToEdit" + echo "$FileToEdit updated" ;; + "false" ) + if [ "${currentFirstLine:0:6}" != "${FirstLine:0:6}" ]; then + if [ "${currentLastLine:0:6}" != "${LastLine:0:6}" ]; then + { + echo "$FirstLine" > "$FileToEdit".new + cat "$FileToEdit" >> "$FileToEdit".new + if [ "x${currentLastLine}" != "x" ] ; then + echo "" >> "$FileToEdit".new + fi + echo "$LastLine" >> "$FileToEdit".new + mv "$FileToEdit".new "$FileToEdit" + echo "$FileToEdit updated" + } + fi + fi ;; + esac +} + +function PrintUsage() +{ + echo "Usage: $0 [-z] [-s \"\"] [-p ]" +} + +# Main + +SetEnvironment + +# Get command line options + +while getopts "zs:p:" opt; do + case $opt in + z) ModelineReplace="true" ;; + s) SourceFiles="$OPTARG" ;; + p) findPath="$OPTARG" ;; + *) PrintUsage + exit 1 ;; + esac +done + +if [ $OPTIND -gt 1 ]; then + shift $((OPTIND - 1)) +fi + +if [ $# -gt 1 ]; then +{ + PrintUsage + echo "Remember to quote the source file globs after -s" + exit 1 +} +fi + +# Create GNU find expressions that traverse the filesystem once and only once +if [ -z "$findPath" ]; then + findArgs='.' + else + findArgs="$findPath" +fi + +for FileType in ${SourceFiles}; do + findArgs="$findArgs"' ( -iname '"$FileType"' -print -o -true ) -a ' +done + +# This gets rid of the final " -a " in the find argument list +findArgs=(${findArgs:0:(${#findArgs}-3)}) + +for file in $($findCMD "${findArgs[@]}"); do + EditFile "$file" + echo "Completed: " "$file" +done + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/bin/assemble-flatpak-appdata.sh b/solenv/bin/assemble-flatpak-appdata.sh new file mode 100755 index 0000000000..4896cf3f20 --- /dev/null +++ b/solenv/bin/assemble-flatpak-appdata.sh @@ -0,0 +1,96 @@ +#! /bin/bash +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# Part of solenv/bin/assemble-flatpak.sh that is shared with a downstream mechanism of building a +# Flatpak from a Fedora libreoffice.spec file. +# +# Arguments: +# $1 pathname, ending in a slash, of the directory into which to put the target +# org.libreoffice.LibreOffice.appdata.xml file +# $2 "1" if a section shall be included in the target +# org.libreoffice.LibreOffice.appdata.xml file, "0" if not + +set -e + +## org.libreoffice.LibreOffice.appdata.xml is manually derived from the various +## inst/share/metainfo/libreoffice-*.appdata.xml (at least recent GNOME Software +## doesn't show more than five screenshots anyway, so restrict to one each from +## the five libreoffice-*.appdata.xml: Writer, Calc, Impress, Draw, Base): +cat <<\EOF >"${1?}"org.libreoffice.LibreOffice.appdata.xml + + + org.libreoffice.LibreOffice.desktop + CC0-1.0 + MPL-2.0 + LibreOffice + The LibreOffice productivity suite + +

LibreOffice is a powerful office suite. Its clean interface and + feature-rich tools help you unleash your creativity and enhance your + productivity. LibreOffice includes several applications that make it the most + powerful Free and Open Source office suite on the market: Writer (word + processing), Calc (spreadsheets), Impress (presentations), Draw (vector + graphics and flowcharts), Base (databases), and Math (formula editing).

+

LibreOffice supports opening and saving into a wide variety of formats, so + you can easily share documents with users of other popular office suites + without worrying about compatibility.

+
+ http://www.libreoffice.org/discover/libreoffice/ + https://bugs.documentfoundation.org/ + https://donate.libreoffice.org/ + https://wiki.documentfoundation.org/Faq + http://www.libreoffice.org/get-help/documentation/ + https://wiki.documentfoundation.org/Translating_LibreOffice + + + https://hub.libreoffice.org/screenshots/writer-01.png + + + + https://hub.libreoffice.org/screenshots/calc-02.png + + + + https://hub.libreoffice.org/screenshots/impress-01.png + + + + https://hub.libreoffice.org/screenshots/draw-02.png + + + + https://hub.libreoffice.org/screenshots/base-02.png + + + + The Document Foundation + libreoffice_at_lists.freedesktop.org + + HiDpiIcon + HighContrast + ModernToolkit + UserDocs + + +EOF + +if [ "${2?}" = 1 ] +then + cat <>"${1?}"org.libreoffice.LibreOffice.appdata.xml + + + +EOF +fi + +cat <<\EOF >>"${1?}"org.libreoffice.LibreOffice.appdata.xml +
+EOF diff --git a/solenv/bin/assemble-flatpak-desktop.sh b/solenv/bin/assemble-flatpak-desktop.sh new file mode 100755 index 0000000000..6d06de4fbb --- /dev/null +++ b/solenv/bin/assemble-flatpak-desktop.sh @@ -0,0 +1,42 @@ +#! /bin/bash +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# Part of solenv/bin/assemble-flatpak.sh that is shared with a downstream mechanism of building a +# Flatpak from a Fedora libreoffice.spec file. +# +# Arguments: +# $1 pathname, ending in a slash, of the directory containing the source libreoffice-*.desktop +# files +# $2 pathname, ending in a slash, of the directory into which to put the target +# org.libreoffice.LibreOffice.*.desktop files + +set -e + +## libreoffice-*.desktop -> org.libreoffice.LibreOffice.*.desktop: +for i in "${1?}"libreoffice-*.desktop +do + sed -e 's/^Icon=libreoffice-/Icon=org.libreoffice.LibreOffice./' "$i" \ + >"${2?}"org.libreoffice.LibreOffice."${i#"${1?}"libreoffice-}" +done +mv "${2?}"org.libreoffice.LibreOffice.startcenter.desktop "${2?}"org.libreoffice.LibreOffice.desktop + +# Flatpak .desktop exports take precedence over system ones due to +# the order of XDG_DATA_DIRS - re-associating text/plain seems a bit much +sed -i "s/text\/plain;//" "${2?}"org.libreoffice.LibreOffice.writer.desktop + +desktop-file-edit --set-key=X-Endless-Alias --set-value=libreoffice-startcenter \ + --set-key=X-Flatpak-RenamedFrom --set-value='libreoffice-startcenter.desktop;' \ + "${2?}"org.libreoffice.LibreOffice.desktop +for i in base calc draw impress math writer xsltfilter +do + desktop-file-edit --set-key=X-Endless-Alias --set-value=libreoffice-"$i" \ + --set-key=X-Flatpak-RenamedFrom \ + --set-value="libreoffice-$i.desktop;org.libreoffice.LibreOffice-$i.desktop;" \ + "${2?}"org.libreoffice.LibreOffice."$i".desktop +done diff --git a/solenv/bin/assemble-flatpak.sh b/solenv/bin/assemble-flatpak.sh new file mode 100755 index 0000000000..8d45da6cc1 --- /dev/null +++ b/solenv/bin/assemble-flatpak.sh @@ -0,0 +1,71 @@ +#! /bin/bash +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# Assemble Flatpak app files and metadata under /app/, copying from the +# installation tree generated by 'make distro-pack-install' (at +# $PREFIXDIR): + +set -e + +cp -r "${PREFIXDIR?}"/lib/libreoffice /app/ +ln -s /app/libreoffice/program/soffice /app/bin/libreoffice + +mkdir -p /app/share/applications +"${SRCDIR?}"/solenv/bin/assemble-flatpak-desktop.sh "${PREFIXDIR?}"/share/applications/ \ + /app/share/applications/ + +## icons/hicolor/*/apps/libreoffice-* -> +## icons/hicolor/*/apps/org.libreoffice.LibreOffice-*: +mkdir -p /app/share/icons +for i in "${PREFIXDIR?}"/share/icons/hicolor/*/apps/libreoffice-* +do + mkdir -p \ + "$(dirname /app/share/icons/hicolor/"${i#"${PREFIXDIR?}"/share/icons/hicolor/}")" + cp -a "$i" \ + "$(dirname /app/share/icons/hicolor/"${i#"${PREFIXDIR?}"/share/icons/hicolor/}")"/"$(basename "$i")" + cp -a "$i" \ + "$(dirname /app/share/icons/hicolor/"${i#"${PREFIXDIR?}"/share/icons/hicolor/}")"/org.libreoffice.LibreOffice."${i##*/apps/libreoffice-}" +done + +mkdir -p /app/share/runtime/locale +for i in $(ls /app/libreoffice/program/resource) +do + lang="${i%[_@]*}" + mkdir -p /app/share/runtime/locale/"${lang}"/resource + mv /app/libreoffice/program/resource/"${i}" /app/share/runtime/locale/"${lang}"/resource + ln -s ../../../share/runtime/locale/"${lang}"/resource/"${i}" /app/libreoffice/program/resource +done + +for i in /app/libreoffice/share/registry/Langpack-*.xcd /app/libreoffice/share/registry/res/{fcfg_langpack,registry}_*.xcd +do + basename="$(basename "${i}" .xcd)" + lang="${basename#Langpack-}" + lang="${lang#fcfg_langpack_}" + lang="${lang#registry_}" + + # ship the base app with at least one Langpack/fcfg_langpack + if [ "${lang}" = "en-US" ] + then + continue + fi + + lang="${lang%-*}" + mkdir -p /app/share/runtime/locale/"${lang}"/registry + mv "${i}" /app/share/runtime/locale/"${lang}"/registry + ln -rs /app/share/runtime/locale/"${lang}"/registry/"${basename}".xcd "${i}" +done + +mkdir -p /app/share/appdata +"${SRCDIR?}"/solenv/bin/assemble-flatpak-appdata.sh /app/share/appdata/ 1 + +## see for further places where build-finish would +## look for data: +## cp ... /app/share/dbus-1/services/ +## cp ... /app/share/gnome-shell/search-providers/ diff --git a/solenv/bin/bin_library_info.sh b/solenv/bin/bin_library_info.sh new file mode 100755 index 0000000000..fcd68c0e86 --- /dev/null +++ b/solenv/bin/bin_library_info.sh @@ -0,0 +1,188 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2013 Norbert Thiebaud +# License: GPLv3 +# + +do_help() +{ +cat < -l|--location -s|--srcdir -b -r|--tarfile [ -m|--mode verify|name ] + +the default mode is 'name' which just print the associated binary tarfile name. +in 'verify' mode the program print the name if the associated binary tarfile exist +and print nothing and return an error code if the file does not exist + +Note: --location --builddir and --srcdir are optional if they are already in the env in the form of TARFILE_LOCATION and BUILDDIR SRCDIR respectively +EOF + +exit 0; +} + +die() +{ + [ "$V" ] && echo "Error:" "$@" + exit -1; +} + + +get_config_sha() +{ + pushd "${SRCDIR?}" > /dev/null + git hash-object "${BUILDDIR?}"/config_host.mk + popd > /dev/null +} + +get_library_gbuild_sha() +{ + local module="$1" + + pushd "${SRCDIR?}" > /dev/null + if [ -d "${SRCDIR}/external/${module?}" ] ; then + git ls-tree -d HEAD "external/${module?}" | cut -f 1 | cut -d " " -f 3 + else + git ls-tree -d HEAD | "{module?}" | cut -f 1 | cut -d " " -f 3 + fi + popd > /dev/null +} + + +determine_binary_package_name() +{ + local module="$1" + local tarball="$2" + local csha="" + local gsha="" + local binfile="" + + csha=$(get_config_sha) + gsha=$(get_library_gbuild_sha "${module?}") + if [ -n "${csha?}" -a -n "${gsha}" ] ; then + binfile="${csha?}_${gsha?}_${tarball?}.${PLATFORM?}.tar.gz" + fi + echo "${binfile}" + +} + +MODULE="" +SOURCE_TARFILE="" +MODE="name" +V=1 + +while [ "${1}" != "" ]; do + parm=${1%%=*} + arg=${1#*=} + has_arg= + if [ "${1}" != "${parm?}" ] ; then + has_arg=1 + else + arg="" + fi + + case "${parm}" in + -h|--help) # display help + do_help + exit + ;; + -b|--builddir) + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + BUILDDIR="${arg}" + ;; + -o|--module) + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + MODULE="${arg}" + ;; + + -l|--location) + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + TARFILE_LOCATION="${arg}" + ;; + -m|--mode) + # test if the binary package exist + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + MODE="$arg" + ;; + -p|--platform) + # test if the binary package exist + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + PLATFORM="$arg" + ;; + -q) + V=0 + ;; + -s|--srcdir) # do not override the local autogen.lastrun if present + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + SRCDIR="${arg}" + ;; + + -t|--tarfile) + if [ -z "${has_arg}" ] ; then + shift; + arg="$1" + fi + SOURCE_TARFILE="${arg}" + ;; + -*) + die "Invalid option $1" + ;; + *) + die "Invalid argument $1" + ;; + esac + shift +done + +if [ -z "${MODULE?}" ] ; then + die "Missing --module" +fi +if [ -z "${TARFILE_LOCATION}" ] ; then + die "Missing --location" +fi +if [ -z "${SOURCE_TARFILE}" ] ; then + die "Missing --tarfile" +fi +if [ -z "${SRCDIR}" ] ; then + die "Missing --srcdir" +fi + + +BINARY_TARFILE="$(determine_binary_package_name ${MODULE?} ${SOURCE_TARFILE?})" + +if [ -z "${BINARY_TARFILE}" ] ; then + exit 2 +fi + +if [ "${MODE?}" = "verify" ] ; then + if [ -f "${TARFILE_LOCATION?}/${BINARY_TARFILE?}" ] ; then + echo "${BINARY_TARFILE?}" + else + exit 1 + fi +else + echo "${BINARY_TARFILE?}" +fi + +exit 0 diff --git a/solenv/bin/call_installer.sh b/solenv/bin/call_installer.sh new file mode 100755 index 0000000000..8b8032f7f3 --- /dev/null +++ b/solenv/bin/call_installer.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# unpack parameters +VERBOSITY=$1; shift +MSITEMPL=$(echo "$@" | cut -d ':' -f 1) +LANG=$(echo "$@" | cut -d ':' -f 2) +PRODNAME=$(echo "$@" | cut -d ':' -f 3) +EXTENSION=$(echo "$@" | cut -d ':' -f 4) +PKGFORMAT=$(echo "$@" | cut -d ':' -f 5) +STRIP=$(echo "$@" | cut -d ':' -f 6) + +# need to hack buildid? +if [ "${PKGFORMAT}${LIBO_VERSION_PATCH}" = "deb0" ] || \ + [ "${PKGFORMAT}${LIBO_VERSION_PATCH}" = "rpm0" ] ; then + LIBO_VERSION_PATCH=1 +fi + +# switch to verbose? +if [ "${VERBOSITY}" = "-verbose" ] ; then + set -x +fi + +# add extra params for Windows +EXTRA_PARAMS= +if [ "${OS}" = "WNT" ] && [ -n "${MSITEMPL}" ]; then + EXTRA_PARAMS="${EXTRA_PARAMS} -msitemplate ${WORKDIR}/CustomTarget/instsetoo_native/install/msi_templates/${MSITEMPL}" + EXTRA_PARAMS="${EXTRA_PARAMS} -msilanguage ${WORKDIR}/CustomTarget/instsetoo_native/install/win_ulffiles" +fi + +# need to strip? +if [ "${STRIP}" = "strip" ] ; then + export ENABLE_STRIP=1 +fi + +# shellcheck disable=SC2086 +# shellcheck disable=SC2154 +${PERL} -w "${SRCDIR}"/solenv/bin/make_installer.pl \ + -f "${BUILDDIR}"/instsetoo_native/util/openoffice.lst \ + -l "${LANG}" \ + -p "${PRODUCTNAME_WITHOUT_SPACES}${PRODNAME}" \ + -u "${instsetoo_OUT}" \ + -packer "${COMPRESSIONTOOL}" \ + -buildid "${LIBO_VERSION_PATCH}" \ + ${EXTRA_PARAMS:+$EXTRA_PARAMS} \ + ${EXTENSION:+"$EXTENSION"} \ + -format "${PKGFORMAT}" \ + "${VERBOSITY}" diff --git a/solenv/bin/clipatchconfig.pl b/solenv/bin/clipatchconfig.pl new file mode 100644 index 0000000000..389fffc5cf --- /dev/null +++ b/solenv/bin/clipatchconfig.pl @@ -0,0 +1,122 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +use warnings; +use strict; + +sub trim; +sub readRedirectionValues($); + +my $usage = + "Usage is: \n clipatchconfig.pl configTemplate redirections policyConfig + + configTemplate: The config file which is used for the policy assembly. It + contains place holders for the binding redirection. + + redirections: file containing the values for oldVersion and newVersion tags + which are used in the BindingRedirect element of the config files. + + policyConfig: Name of the file in which we want to write the config file. +"; + + +if (scalar @ARGV < 3) { + print $usage; + exit -1; +} + + +my %redirectionValue = readRedirectionValues($ARGV[1]); + + +#Read config file in which we will replace the versions +$/ = undef; +open TEMPLATE, $ARGV[0] or die $!; +my $templ =