diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:55:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:55:35 +0000 |
commit | 0e05dd0e4d67d88ca51780dafe4029744269e6fa (patch) | |
tree | b49073fa569d8d4fbcc7002cf4df72fa840780c1 /debian/scripts | |
parent | Adding upstream version 4:24.2.0. (diff) | |
download | libreoffice-0e05dd0e4d67d88ca51780dafe4029744269e6fa.tar.xz libreoffice-0e05dd0e4d67d88ca51780dafe4029744269e6fa.zip |
Adding debian version 4:24.2.0-1.debian/4%24.2.0-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/scripts')
-rwxr-xr-x | debian/scripts/fix_component_tarballs.sh | 36 | ||||
-rwxr-xr-x | debian/scripts/get_libebook_dep.sh | 33 | ||||
-rwxr-xr-x | debian/scripts/gid2pkgdirs.sh | 177 | ||||
-rwxr-xr-x | debian/scripts/joinctrl.py | 66 | ||||
-rwxr-xr-x | debian/scripts/locale-gen | 32 | ||||
-rwxr-xr-x | debian/scripts/move-if-change | 32 | ||||
-rwxr-xr-x | debian/scripts/stat_pos.sh | 32 |
7 files changed, 408 insertions, 0 deletions
diff --git a/debian/scripts/fix_component_tarballs.sh b/debian/scripts/fix_component_tarballs.sh new file mode 100755 index 0000000000..be149f297b --- /dev/null +++ b/debian/scripts/fix_component_tarballs.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +set -x +set -e + +pwd=`pwd` +tmp=`mktemp -q -d` + +debianver=`uscan --report --verbose | grep newversion | cut -d= -f2 | awk '{ print $1 }' | head -n 1` + +# the main tarball +t=`uscan --report --verbose | grep newfile | cut -d= -f2 | head -n 1` +sourcever=`echo $t | cut -d- -f2 | sed -e "s/\.tar\.xz$//"` + +files=`uscan --report --verbose | grep newfile | cut -d= -f2 | tail -n +2` + +for f in $files; do + if echo $f | grep -q help; then + c=helpcontent2; + else + c=`echo $f | cut -d- -f2`; + fi + + cd ${tmp} + echo "Extracting original $f..." + tar --strip-components 1 --extract --verbose --xz --file ${pwd}/../$f + echo "Deleting obsolete libreoffice_${debianver}.orig-${c}.tar.xz and it's signatiure...." + rm -f ${pwd}/../libreoffice_${debianver}.orig-${c}.tar.xz + rm -f ${pwd}/../libreoffice_${debianver}.orig-${c}.tar.xz.asc + echo "Creating new libreoffice_${debianver}.orig-${c}.tar.xz..." + tar --create --verbose --xz --file ${pwd}/../libreoffice_${debianver}.orig-${c}.tar.xz ${c} + rm -rf ${c} + cd ${pwd} +done + +rm -rf ${tmp} diff --git a/debian/scripts/get_libebook_dep.sh b/debian/scripts/get_libebook_dep.sh new file mode 100755 index 0000000000..8eb2ef20ee --- /dev/null +++ b/debian/scripts/get_libebook_dep.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +libs=`grep libebook.*\.so connectivity/source/drivers/evoab2/EApi.cxx | perl -pe 's/\s+\"(.*)\".*/$1/'` + +for l in $libs; do + if [ -e "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/$l" ]; then + p=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH` + else + if [ -e /usr/lib/$l ]; then + p=/usr/lib + else + continue + fi + fi + # sanity check: do the libs match with what we would get + # for our libebook version if we followed the .so symlink? + l1=`readlink $p/$l` + l2_tmp=`echo $l | perl -pe 's/(.*)\.\d+$/$1/'` + l2=`readlink $p/$l2_tmp` + l3=`readlink $p/$l2` + if [ "$l1" = "$l2" -o "$l1" = "$l3" ]; then + dep=`dpkg -S $p/$l | cut -d: -f1` + fi +done + +if [ -n "$dep" ]; then + echo $dep +else + echo "Cannot find libebook dependency. None of the following libs found:" + echo $libs + exit 1 +fi + diff --git a/debian/scripts/gid2pkgdirs.sh b/debian/scripts/gid2pkgdirs.sh new file mode 100755 index 0000000000..6b630d2e63 --- /dev/null +++ b/debian/scripts/gid2pkgdirs.sh @@ -0,0 +1,177 @@ +#!/bin/sh + +## create split package dirs out of LibreOffices gid_* files +## copied from former ooo-build/libreoffice-build package-ooo +## (c) 2005 Chris Halls <halls@debian.org> +## (c) 2005-2011 Rene Engelhard <rene@debian.org> + +export OODESTDIR=$DESTDIR + +cd $DESTDIR + +echo "Copying gid files...." +rm gid_* +cp $DESTDIR/../../file-lists/orig/gid_* . + +echo "Creating package directories..." + +test -d pkg && rm -r pkg || : + +# Create package tree (needed by Debian's dpkg) +# create_package_directory <list_file> <directory_name> +create_package_directory() +{ +listfile=$1 +directory="$2" +perl -nl \ + -e " if(/^%dir (.*)/) + {system('mkdir', '-p', '-m', '755', \"$directory\".\$1);} + else + {rename('./'.\$_, \"$directory\".\$_);} + " \ + $listfile +} + +# move_wrappers <directory_name> <name> [...] +move_wrappers() +{ +directory=$1 +shift +mkdir -m755 -p "$directory"/usr/bin +while test -n "$1"; do + mv usr/*bin/"$1$BINSUFFIX" "$directory"/usr/bin + shift +done +} + +create_package_directory gid_Module_Root_Ure_Hidden pkg/ure +create_package_directory gid_Module_Root pkg/libreoffice-common +create_package_directory gid_Module_Root_Brand pkg/libreoffice-common +# done by dh_installman +#mkdir -p pkg/libreoffice-common/usr/share/man/man1 +#mv usr/share/man/man1/libreoffice$BINSUFFIX.1.gz \ +# pkg/libreoffice-common/usr/share/man/man1 +#for i in ./usr/share/man/man1/*; do \ +# if [ "$i" = "unopkg.1.gz" -o "$i" = "lofromtemplate.1.gz" \ +# -o "$i" = "loffice.1.gz" ]; then p=common; \ +# else p=`basename $i .1.gz | sed -e s/^lo//`; \ +# fi +# mkdir -p pkg/libreoffice-$p/usr/share/man/man1 +# mv $i \ +# pkg/libreoffice-$p/usr/share/man/man1 +#done +for i in ./usr/share/applications/*.desktop; do \ + if [ "`basename $i`" = "libreoffice-startcenter.desktop" ]; then p=libreoffice-common; \ + elif [ "`basename $i`" = "libreoffice-xsltfilter.desktop" ]; then p=libreoffice-common; \ + else p=`basename $i .desktop`; fi + mkdir -p pkg/$p/usr/share/applications + mv $i \ + pkg/$p/usr/share/applications +done +mkdir -p pkg/libreoffice-common/usr/share +mv ./usr/share/icons \ + pkg/libreoffice-common/usr/share +mv ./usr/share/application-registry \ + pkg/libreoffice-common/usr/share +mv ./usr/share/mime* \ + pkg/libreoffice-common/usr/share + +create_package_directory gid_Module_Root_Files_Images pkg/libreoffice-common +create_package_directory gid_Module_Oo_Linguistic pkg/libreoffice-common +create_package_directory gid_Module_Optional_Xsltfiltersamples pkg/libreoffice-common +create_package_directory gid_Module_Filter pkg/libreoffice-common +create_package_directory gid_Module_Optional_Grfflt pkg/libreoffice-draw +create_package_directory gid_Module_Prg_Calc_Bin pkg/libreoffice-calc +create_package_directory gid_Module_Prg_Math_Bin pkg/libreoffice-math +create_package_directory gid_Module_Prg_Draw_Bin pkg/libreoffice-draw +create_package_directory gid_Module_Prg_Wrt_Bin pkg/libreoffice-writer +create_package_directory gid_Module_Prg_Impress_Bin pkg/libreoffice-impress +create_package_directory gid_Module_Prg_Base_Bin pkg/libreoffice-base +create_package_directory gid_Module_Brand_Prg_Calc pkg/libreoffice-calc +create_package_directory gid_Module_Brand_Prg_Math pkg/libreoffice-math +create_package_directory gid_Module_Brand_Prg_Draw pkg/libreoffice-draw +create_package_directory gid_Module_Brand_Prg_Wrt pkg/libreoffice-writer +create_package_directory gid_Module_Brand_Prg_Impress pkg/libreoffice-impress +create_package_directory gid_Module_Brand_Prg_Base pkg/libreoffice-base +create_package_directory gid_Module_Pyuno pkg/python3-uno +create_package_directory gid_Module_Optional_Pyuno_LibreLogo pkg/libreoffice-librelogo +create_package_directory gid_Module_Script_Provider_For_Python pkg/libreoffice-script-provider-python +create_package_directory gid_Module_Optional_Gnome pkg/libreoffice-gnome +create_package_directory gid_Module_Optional_Kde pkg/libreoffice-kde +create_package_directory gid_Module_Optional_OGLTrans pkg/libreoffice-impress +create_package_directory gid_Module_Root_SDK pkg/libreoffice-dev +# WTF? Why is this suddently not installed itself? +mv usr/lib/libreoffice/sdk/lib \ + pkg/libreoffice-dev/usr/lib/libreoffice/sdk +create_package_directory gid_Module_Optional_Extensions_Script_Provider_For_BS pkg/libreoffice-script-provider-bsh +create_package_directory gid_Module_Optional_Extensions_Script_Provider_For_JS pkg/libreoffice-script-provider-js +create_package_directory gid_Module_Optional_Extensions_MEDIAWIKI pkg/libreoffice-wiki-publisher +create_package_directory gid_Module_Optional_Extensions_NLPSolver pkg/libreoffice-nlpsolver +create_package_directory gid_Module_Pdfimport pkg/libreoffice-common +create_package_directory gid_Module_Reportbuilder pkg/libreoffice-report-builder +create_package_directory gid_Module_Optional_PostgresqlSdbc pkg/libreoffice-sdbc-postgresql +create_package_directory gid_Module_Libreofficekit pkg/libreofficekit-data +move_wrappers pkg/libreoffice-common soffice unopkg +move_wrappers pkg/libreoffice-common libreoffice loffice lofromtemplate +move_wrappers pkg/libreoffice-base lobase +move_wrappers pkg/libreoffice-writer lowriter loweb +move_wrappers pkg/libreoffice-calc localc +move_wrappers pkg/libreoffice-impress loimpress +move_wrappers pkg/libreoffice-math lomath +move_wrappers pkg/libreoffice-draw lodraw + +for l in `echo $OOO_LANGS_LIST`; do + for p in Impress Draw Math Calc Base Writer; do + create_package_directory gid_Module_Langpack_${p}_`echo $l | sed -e s/-/_/g` pkg/libreoffice-l10n-$l + done + create_package_directory gid_Module_Langpack_Basis_`echo $l | sed -e s/-/_/g` pkg/libreoffice-l10n-$l + create_package_directory gid_Module_Langpack_Brand_`echo $l | sed -e s/-/_/g` pkg/libreoffice-l10n-$l + create_package_directory gid_Module_Langpack_Resource_`echo $l | sed -e s/-/_/g` pkg/libreoffice-l10n-$l + if [ -f gid_Module_Helppack_Help_`echo $l | sed -e s/-/_/g` ]; then + create_package_directory gid_Module_Helppack_Help_`echo $l | sed -e s/-/_/g` pkg/libreoffice-help-$l + fi + # some help files are in _Langpack_{Writer,Impress,...}_<lang> + # move them from -l10n to -help + if [ "$l" = "en-US" ]; then d=en; else d=$l; fi + mv pkg/libreoffice-l10n-$l/$OOINSTBASE/help/$d/* \ + pkg/libreoffice-help-$l/$OOINSTBASE/help/$d && \ + rmdir pkg/libreoffice-l10n-$l/$OOINSTBASE/help/$d +done + +# Move all libraries and binaries from -common to -core +if [ ! -d $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program ]; then \ +mkdir -p $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program; \ +fi && +( cd pkg/libreoffice-common/$OOINSTBASE/program + find -maxdepth 1 \ + -regex '\./\(.*\.so.*\|.*\.bin\|pagein.*\|kdefilepicker\|msfontextract\|.*\.rdb\|javaldx\|oosplash\|uri-encode\|xpdfimport\|ui-previewer\|opencltest\)' \ + -exec mv {} $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program \; +); +for i in types services; do \ + if [ ! -d $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program/$i ]; then \ + mkdir -p $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program/$i; \ + fi && + ( cd pkg/libreoffice-common/$OOINSTBASE/program/$i + find -maxdepth 1 \ + -regex '\./\(.*\.rdb\)' \ + -exec mv {} $OODESTDIR/pkg/libreoffice-core/$OOINSTBASE/program/$i \; + ); \ +done + +mkdir -p pkg/libreoffice-common/usr/share/bash-completion/completions +mv usr/share/bash-completion/completions/libreoffice$BINSUFFIX.sh \ + pkg/libreoffice-common/usr/share/bash-completion/completions/libreoffice$BINSUFFIX + +mv .$OOINSTBASE/program/java-set-classpath \ + pkg/libreoffice-common/$OOINSTBASE/program +if echo $OOO_LANGS_LIST | grep -q en-US; then + for i in forms/resume.ott officorr/project-proposal.ott; do \ + mkdir -p pkg/libreoffice-common/$OOINSTBASE/share/template/en-US/`dirname $i`; \ + mv .$OOINSTBASE/share/template/en-US/$i \ + pkg/libreoffice-common/$OOINSTBASE/share/template/en-US/$i; \ + done; \ +fi + +# Warn for any remaining files +find . -path './pkg' -prune -o -not -name 'gid_Module_*' -not -type d -exec echo "File not packaged: {}" \; + diff --git a/debian/scripts/joinctrl.py b/debian/scripts/joinctrl.py new file mode 100755 index 0000000000..ce12f09b96 --- /dev/null +++ b/debian/scripts/joinctrl.py @@ -0,0 +1,66 @@ +#! /usr/bin/python3 + +import re, sys, fileinput + +def splitlines(): + fields = ('Build-Depends', 'Build-Conflicts', 'Build-Depends-Indep', 'Build-Depends-Arch', + 'Depends', 'Replaces', 'Provides', 'Conflicts', 'Recommends', 'Suggests', 'Breaks') + for line in fileinput.input(): + line = line[:-1] + field = None + for f in fields: + if line.startswith(f+':'): + field = f + break + if not field: + print(line) + continue + values = [f.strip() for f in line.split(':',1)[1].strip().split(',')] + if len(values) > 2: + print('%s: %s' % (field, ',\n '.join(values))) + else: + print('%s: %s' % (field, ', '.join(values))) + +def sort_list(unsorted_list): + packages = [x for x in unsorted_list if re.match("[a-z0-9]", x)] + special = [x for x in unsorted_list if not re.match("[a-z0-9]", x)] + return sorted(packages) + sorted(special) + +def joinlines(): + fields = ('Build-Depends', 'Build-Conflicts', 'Build-Depends-Indep', 'Build-Depends-Arch', + 'Depends', 'Replaces', 'Provides', 'Conflicts', 'Recommends', 'Suggests', 'Breaks') + buffer = None + for line in fileinput.input(): + line = line[:-1] + if buffer: + if line.startswith(' '): + buffer = buffer + ' ' + line.strip() + continue + else: + packages = sort_list(set([x.strip() for x in buffer[len(field)+1:].split(",")])) + if "" in packages: + packages.remove("") + length = len(field) + sum([2 + len(package) for package in packages]) + if length > 80: + indentation = " " * (len(field) + 2) + packages_with_indention = [indentation + x for x in packages] + packages_with_indention = ",\n".join(packages_with_indention) + print(field + ": " + packages_with_indention.strip()) + else: + print(field + ": " + ", ".join(packages).strip()) + buffer = None + field = None + for f in fields: + if line.startswith(f+':'): + field = f + break + if field: + buffer = line.strip() + continue + print(line) + +def main(): + #splitlines() + joinlines() + +main() diff --git a/debian/scripts/locale-gen b/debian/scripts/locale-gen new file mode 100755 index 0000000000..c7334fdb7d --- /dev/null +++ b/debian/scripts/locale-gen @@ -0,0 +1,32 @@ +#!/bin/sh + +# generate locales that uicheck depend on +# "stolen" from gcc + +LOCPATH=`pwd`/debian/locales +export LOCPATH + +[ -d $LOCPATH ] || mkdir -p $LOCPATH + +[ -n "$USE_CPUS" ] || USE_CPUS=1 + +umask 022 + +echo "Generating locales..." +xargs -L 1 -P $USE_CPUS -I{} \ + sh -c ' + set {}; locale=$1; charset=$2 + case $locale in \#*) exit;; esac + [ -n "$locale" -a -n "$charset" ] || exit + echo " `echo $locale | sed \"s/\([^.\@]*\).*/\1/\"`.$charset`echo $locale | sed \"s/\([^\@]*\)\(\@.*\)*/\2/\"`..." + if [ -f $LOCPATH/$locale ]; then + input=$locale + else + input=`echo $locale | sed "s/\([^.]*\)[^@]*\(.*\)/\1\2/"` + fi + localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias + ' <<EOF +en_US.UTF-8 UTF-8 +EOF + +echo "Generation complete." diff --git a/debian/scripts/move-if-change b/debian/scripts/move-if-change new file mode 100755 index 0000000000..d267e7212a --- /dev/null +++ b/debian/scripts/move-if-change @@ -0,0 +1,32 @@ +#!/bin/sh + +# Copyright (C) 1996 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +if +test -r $2 +then +if +cmp $1 $2 > /dev/null +then +echo $2 is unchanged +rm -f $1 +else +mv -f $1 $2 +fi +else +mv -f $1 $2 +fi diff --git a/debian/scripts/stat_pos.sh b/debian/scripts/stat_pos.sh new file mode 100755 index 0000000000..c0469ad9a2 --- /dev/null +++ b/debian/scripts/stat_pos.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +# Quick and dirty script to stat the LO translations/ pos wrt % translated +# FIXME: maybe use pocount from translate-toolkit + +# Author: Rene Engelhard <rene@debian.org> +# (C) 2017 Software in the Public Interest, Inc. + +cd translations/source + +for l in `ls -1`; do + # 23:36 <@cloph> no - but you can do a brute-force method of just counting msgid and comparing that with »msgstr ""« matches. + # 23:37 <@cloph> While that ignores multiline strings, there aren't too many and should work as a rough estimate + msgid_count=$(grep msgid `find $l -name "*.po"` | wc -l) + msgstr_count=$(grep msgstr `find $l -name "*.po"` | wc -l) + empty_msgstr_count=$(grep msgstr\ \"\" `find $l -name "*.po"` | wc -l) + p=$((100*$empty_msgstr_count/$msgid_count)) + echo "$l: $msgid_count strings, $(($msgid_count-$empty_msgstr_count))/$msgid_count translated; $empty_msgstr_count/$msgid_count untranslated" + if test $msgid_count -lt 50000; then + echo "$l: no help translations" + fi + echo "$l: $((100-$p))% translated, $p% untranslated" + + if test $p -lt 20; then + langs="$langs $l" + fi +done + +echo "languages over 80% translated:" +echo $langs |