alr-repo/onlyoffice-bin/alr.sh

64 lines
2.6 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name='onlyoffice-bin'
version='8.0.1'
release='1'
desc='An office suite that combines text, spreadsheet and presentation editors'
homepage='https://www.onlyoffice.com/'
maintainer="Евгений Храмов <xpamych@yandex.ru>"
architectures=('amd64')
license=('AGPL-3.0-only')
provides=('onlyoffice')
conflicts=('onlyoffice')
deps=('curl' 'gtk3' 'alsa-lib' 'libpulse' 'gstreamer' 'gst-plugins-base-libs'
'gst-plugins-ugly' 'libxss' 'nss' 'nspr' 'ttf-dejavu' 'ttf-liberation'
'ttf-carlito' 'desktop-file-utils' 'hicolor-icon-theme')
deps_redos=('pulseaudio-libs' 'gstreamer1-plugins-base' 'gstreamer1-plugins-ugly' 'libXScrnSaver' 'dejavu-sans-fonts' 'liberation-fonts' 'google-carlito-fonts')
opt_deps=('libreoffice: for OpenSymbol fonts')
options=('!strip' '!emptydirs')
sources=("https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb")
checksums=('SKIP')
prepare() {
mkdir -p "onlyoffice-${version}/pkg"
bsdtar -xf "${srcdir}/onlyoffice-desktopeditors_amd64.deb" -C "onlyoffice-${version}"
bsdtar -xf "onlyoffice-${version}/data.tar.xz" -C "onlyoffice-${version}/pkg"
patch -d "onlyoffice-${version}/pkg" -Np1 -i "${scriptdir}/010-onlyoffice-bin-fix-document-opening.patch"
}
package() {
cd $srcdir
cp -dr --no-preserve='ownership' "onlyoffice-${version}"/pkg/* "$pkgdir"
# icons
local icon_size icon_dir
for icon_size in 16 32 48 64 128 256 512; do
icon_dir="${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps"
install -d "${icon_dir}"
install -m644 "${srcdir}/onlyoffice-8.0.1/pkg/opt/onlyoffice/desktopeditors/asc-de-${icon_size}.png" "${icon_dir}/onlyoffice-desktopeditors.png"
done
rename_directories() {
for dir in "$1"/*; do
if [ -d "$dir" ]; then
dir_name=$(basename "$dir")
if [[ "$dir_name" == *\{*\}* ]]; then
new_dir_name=$(echo "$dir_name" | tr -d '{}')
mv "$dir" "$1/$new_dir_name"
echo "Переименован: $dir -> $1/$new_dir_name"
rename_directories "$1/$new_dir_name"
else
rename_directories "$dir"
fi
fi
done
}
# Запускаем функцию переименования с корневым каталогом
rename_directories "${pkgdir}/opt/onlyoffice/desktopeditors/editors/sdkjs-plugins"
# 3rd party licenses
install -d -m755 "${pkgdir}/usr/share/licenses/${name}"
ln -s $pkgdir/$name/opt/onlyoffice/desktopeditors/3DPARTYLICENSE "${pkgdir}/usr/share/licenses/${name}/3DPARTYLICENSE"
}