From d900f9b648af445284f34feff85eb15e736a0732 Mon Sep 17 00:00:00 2001 From: maks1ms Date: Sat, 4 Jan 2025 09:01:46 +0000 Subject: [PATCH] init (#1) Reviewed-on: https://code.alt-gnome.ru/aides/yandex-disk/pulls/1 Co-authored-by: maks1ms Co-committed-by: maks1ms --- alr.sh | 42 +++++++++++++++++++++++++++++++++++++++++- postinstall.sh | 4 ++++ yandex-disk.service | 13 +++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 postinstall.sh create mode 100644 yandex-disk.service diff --git a/alr.sh b/alr.sh index 09cfdff..15cfc39 100644 --- a/alr.sh +++ b/alr.sh @@ -1 +1,41 @@ -# Describe your package here \ No newline at end of file +name='yandex-disk' +version=0.1.6.1080 +release=1 +desc='Yandex.Disk keeps your files with you at all times.' +architectures=('amd64') +homepage='http://disk.yandex.ru/' +license=('proprietary') +maintainer="Maxim Slipenko " + +build_deps=( + bsdtar +) + +auto_req=1 +auto_prov=1 + +scripts=( + ['postinstall']='postinstall.sh' +) + +_deb_package="yandex-disk_${version}_amd64.deb" + +sources=( + "https://repo.yandex.ru/yandex-disk/deb/pool/main/y/yandex-disk/$_deb_package?~name=$_deb_package" +) + +checksums=( + 'md5:19446922ba1713183476953663a2b1cb' +) + +prepare() { + cp "${scriptdir}/yandex-disk.service" "${srcdir}" +} + +package() { + cd "$srcdir" + ar x "$_deb_package" + bsdtar xf data.tar.gz -C "$pkgdir" + install -Dm644 "$pkgdir/usr/share/doc/yandex-disk/copyright" "$pkgdir/usr/share/licenses/$name/LICENSE" + install -Dm644 "${srcdir}/yandex-disk.service" "${pkgdir}/usr/lib/systemd/user/yandex-disk.service" +} \ No newline at end of file diff --git a/postinstall.sh b/postinstall.sh new file mode 100644 index 0000000..4966524 --- /dev/null +++ b/postinstall.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +echo ">>> Use 'yandex-disk setup' for initial configure" +echo ">>> Use 'systemctl --user enable yandex-disk.service' for load with system start" \ No newline at end of file diff --git a/yandex-disk.service b/yandex-disk.service new file mode 100644 index 0000000..80972bf --- /dev/null +++ b/yandex-disk.service @@ -0,0 +1,13 @@ +[Unit] +Description=Yandex-Disk service +After=local-fs.target network.target + +[Service] +Type=forking +ExecStart=/usr/bin/yandex-disk start -c %h/.config/yandex-disk/config.cfg +ExecReload=/usr/bin/killall -qw yandex-disk +RestartSec=30 +Restart=always + +[Install] +WantedBy=default.target