СБИС 3 Плагин от ТЕНЗОР

Приложите Ваш вариант ebuild, интересно потестировать.

Да, конечно…

  1. Формирую ebuild следующим образом - для Своего локального оверлея подготовил такой сценарий (для работы сценария требуется app-misc/jq):
$ cat ./sbis_create.sh
#!/bin/bash
path_to_overlay=/var/calculate/custom-overlay
old_ver=`ls -1 -d $path_to_overlay/app-crypt/sbis3plugin/* | awk -F"-" '{ print substr($4, 1, length($4)-7)}' | grep "[0-9]$" | sort --version-sort --field-separator=. -r | sed -n '1,1p'`
new_ver=`curl -s https://update-msk1.sbis.ru/Sbis3Plugin/ > /tmp/sbisplugin && while read line; do echo $line | jq ".name" 2> /dev/null; done < /tmp/sbisplugin | sort --version-sort --field-separator=. -r | sed -n '6,6p' | tr -d \"`
if [[ "$old_ver" != "$new_ver" ]]; then
cp $path_to_overlay/app-crypt/sbis3plugin/sbis3plugin-$old_ver.ebuild $path_to_overlay/app-crypt/sbis3plugin/sbis3plugin-$new_ver.ebuild
cp $path_to_overlay/app-crypt/sbis3plugin-core/sbis3plugin-core-$old_ver.ebuild $path_to_overlay/app-crypt/sbis3plugin-core/sbis3plugin-core-$new_ver.ebuild
ebuild $path_to_overlay/app-crypt/sbis3plugin/sbis3plugin-$new_ver.ebuild manifest
ebuild $path_to_overlay/app-crypt/sbis3plugin-core/sbis3plugin-core-$new_ver.ebuild manifest
fi

Т.е. сверяемся с текущей, доступной, версией плагина и если она отличается от последней в Нашем локальном оверлее, то формируем ebuild;

  1. Ввиду того, что пакетов 2 шт., установку произвожу следующим образом:
# emerge sbis3plugin-core sbis3plugin
  1. Сами ebuild’ы:
Спойлер
cat ./sbis3plugin-22.7220.152.ebuild 
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=7
inherit font gnome2-utils eutils multilib unpacker

DESCRIPTION="СБИС Плагин. Desktop Plugin for convenient work in the browser SBIS3Plugin (SABY Plugin) — a desktop application for working with notifications, editing documents in a browser, entering your personal account by certificate, uploading files to the cloud, and so on"
HOMEPAGE="https://sbis.ru/"

KEYWORDS="amd64"

SRC_URI="amd64? ( https://update-msk2.sbis.ru/Sbis3Plugin/master/linux/sbis3plugin.deb -> sbis3plugin-${PV}.deb )"

SLOT="0"
RESTRICT="strip mirror"
LICENSE="GPL-3"
IUSE=""

NATIVE_DEPEND="app-crypt/sbis3plugin-core"
RDEPEND="${NATIVE_DEPEND}"
DEPEND="${RDEPEND}"

S="${WORKDIR}"

src_install() {
    cp -R "${WORKDIR}/opt" "${D}" || die "install failed!"
    cp -R "${FILESDIR}/sbis3plugin-postinst.sh" "${D}/opt/sbis3plugin/sbis3plugin-postinst.sh" || die "install failed!"
}

pkg_postinst() {
    cp -R /opt/sbis3plugin/temp/* /opt/sbis3plugin/
    /etc/init.d/SBIS3Plugin-daemon stop
    cp -R "${FILESDIR}/SBIS3Plugin-daemon" "/etc/init.d/SBIS3Plugin-daemon" || die "install failed!"
    mkdir -p /var/run/sbis
    elog "1. Внимание!!! Пока такой хак. Настройте версию sbis3plugin в файле /opt/sbis3plugin/sbis3plugin-postinst.sh в строке VERSBIS=<устанавливаемая версия>"
    elog "2. Исполните файл сценария /opt/sbis3plugin/sbis3plugin-postinst.sh"
    elog "3. Пропишите автозапуск rc-update add SBIS3Plugin-daemon default"
    elog "4. Запустите /etc/init.d/SBIS3Plugin-daemon start"
    elog "5. Повторите исполнение сценария /opt/sbis3plugin/sbis3plugin-postinst.sh"
    elog "6. Запустите приложение самостоятельно с помощью ярлыка на рабочем столе."
    /bin/bash /opt/sbis3plugin/sbis3plugin-postinst.sh
    rc-update add SBIS3Plugin-daemon default
    /etc/init.d/SBIS3Plugin-daemon start
    /bin/bash /opt/sbis3plugin/sbis3plugin-postinst.sh
    rm -R /opt/sbis3plugin/temp
    rm -R /opt/sbis3plugin/temp_minimal_core
}
Спойлер
cat ./sbis3plugin-core-22.7220.152.ebuild 
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=7
inherit font gnome2-utils eutils multilib unpacker

DESCRIPTION="СБИС Плагин. Desktop Plugin for convenient work in the browser SBIS3Plugin (SABY Plugin) — a desktop application for working with notifications, editing documents in a browser, entering your personal account by certificate, uploading files to the cloud, and so on"
HOMEPAGE="https://sbis.ru/"

KEYWORDS="amd64"

SRC_URI="amd64? ( https://update-msk2.sbis.ru/Sbis3Plugin/master/linux/saby-minimal-core.deb -> sbis3plugin-core-${PV}.deb )"

SLOT="0"
RESTRICT="strip mirror"
LICENSE="GPL-3"
IUSE=""

NATIVE_DEPEND="app-arch/deb2targz
    sys-libs/glibc
    sys-devel/gcc
    app-crypt/sbis-libstdc
    dev-libs/atk
    dev-libs/libatomic_ops
    virtual/libc
    virtual/libcrypt
    sys-apps/dbus
    x11-libs/libdrm
    media-libs/gegl
    dev-libs/expat
    media-libs/fontconfig
    app-eselect/eselect-fontconfig
    x11-libs/gdk-pixbuf
    dev-libs/glib
    media-libs/gstreamer
    x11-libs/gtk+:2
    x11-libs/gtk+:3
    media-libs/harfbuzz
    app-arch/lzma
    dev-libs/nspr
    dev-libs/nss
    x11-libs/pango
    sys-apps/pcsc-lite
    media-sound/pulseaudio
    sys-libs/libstdc++-v3
    sys-libs/libudev-compat
    app-misc/ca-certificates
    media-libs/libvorbis
    x11-libs/libX11
    x11-libs/libxcb
    x11-libs/libXcomposite
    x11-libs/libXcursor
    x11-libs/libXdamage
    x11-libs/libXext
    x11-libs/libXfixes
    x11-libs/libXi
    x11-libs/libXinerama
    x11-apps/xrandr
    x11-libs/libXrender
    x11-libs/libXtst
    sys-libs/zlib
 "

RDEPEND="${NATIVE_DEPEND}"

DEPEND="${RDEPEND}"

S="${WORKDIR}"

src_install() {
    cp -R "${WORKDIR}/opt" "${D}" || die "install failed!"
}

pkg_postinst() {
    cp -R /opt/sbis3plugin/temp_minimal_core/* /opt/sbis3plugin/
}

Могу добавить, что ничего вручную выполнять не требуется, всё “как бы” автоматизировано.

При этом ничего из
/opt/sbis3plugin
не удаляется (имеется ввиду предыдущие версии), но это, скорее всего можно тоже сделать.

Да, добавлю, чтобы избавиться от ручных манипуляций, код сценария, который помещается в
/opt/sbis3plugin/sbis3plugin-postinst.sh
был изменён как и предлагалось ранее:

$ head -4  /opt/sbis3plugin/sbis3plugin-postinst.sh
#!/bin/bash

#ztime start
VERSBIS=`ls -1 -d /opt/sbis3plugin/*/ | awk -F"/" '{ print $4 }' | grep "[0-9]$" | sort --version-sort --field-separator=. -r | sed -n '1,1p'`

Ну вроде бы всё, ничего не забыл.

1 Like

Все доработки рабочие. Прошу Profile - ztime - Calculate Forum обратить внимание на предоставленные Profile - NickM - Calculate Forum улучшения в ebuild для применения/обновления Sbis3Plugin до актуальной версии.

1 Like