Commit d4c4dbf0 authored by Roman Alifanov's avatar Roman Alifanov

Initial commit

parents
tar: .
\ No newline at end of file
This diff is collapsed. Click to expand it.
all:
echo "We don't need any build"
cmd_list = epmgpi
# get version from the spec by default
PKGVER = $(shell grep "^Version: " epmgpi.spec | cut -d" " -f2)
PKGREL = $(shell grep "^Release: " epmgpi.spec | cut -d" " -f2)
version := $(PKGVER)-$(PKGREL)
PREFIX=/usr
DATADIR=$(PREFIX)/share
install: install_common
install_common:
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -p -Dm 0755 bin/* $(DESTDIR)$(PREFIX)/bin/
install -p -Dm 0644 epmgpi.desktop $(DESTDIR)$(DATADIR)/applications/epmgpi.desktop
install -p -Dm 0644 epmgpi.svg $(DESTDIR)$(DATADIR)/pixmaps/epmgpi.svg
#!/bin/bash
# Временные файлы
clean_up_tmp() {
rm -fr "$EPMGPI_TMP"
}
EPMGPI_TMP=$(mktemp -d -t epmgpi.XXXXXXX)
# shellcheck disable=SC2064
trap "clean_up_tmp $EPMGPI_TMP" EXIT
# Дефолтные параметры yad
YAD_DEFAULT="/usr/bin/yad --window-icon=epmgpi --title=epmgpi --class=epmgpi"
# Уведомления
ntf() {
notify-send --icon=epmgpi "$1"
}
# Уведомление об ошибке
ntf_error() {
notify-send --icon=error "$1"
}
# Функция для вопроса пользователю, перепаковать ли пакет
repackq() {
# Не rpm файлы перепаковываются и без ключа --repack
if [[ $PKG_SYMB_LINK_PATH == *.rpm ]]; then
$YAD_DEFAULT --image="dialog-question" --text "Перепаковать ли rpm файл для переопределения зависимостей?" \
--button="yad-yes:0" \
--button="yad-no:1"
ret=$?
if [[ $ret -eq 0 ]]; then
EEPM_ARGS="--auto --repack -i"
else
EEPM_ARGS="--auto -i"
fi
else
EEPM_ARGS="--auto -i"
fi
echo "epm args: $EEPM_ARGS"
}
# GUI селектор пакетов
pkgselection() {
PKG_PATH=$($YAD_DEFAULT --file --file-filter="*.rpm *.deb *.appimage *.AppImage")
echo "$PKG_PATH"
}
# Проверка, пакет ли файл
preparepkg() {
if [[ $PKG_PATH == *.rpm || $PKG_PATH == *.AppImage || $PKG_PATH == *.appimage || $PKG_PATH == *.deb ]] && [ -e "$PKG_PATH" ]; then
PKG_NAME=$(basename -- "$PKG_PATH" | tr -d ' ')
PKG_SYMB_LINK_PATH="$EPMGPI_TMP/$PKG_NAME"
ln -s "$PKG_PATH" "$PKG_SYMB_LINK_PATH"
else
ntf_error "Файл не существует или не является .rpm, .AppImage или .deb"
fi
}
# Установка пакета
installpkg() {
# Pkexec для выполнения от рута
# Тут есть костыль, который каждую строку с помощью sed делает с решеткой. YAD воспринимает только так.
(
# shellcheck disable=SC2086
/usr/bin/pkexec /usr/bin/epm $EEPM_ARGS "$PKG_SYMB_LINK_PATH" 2>&1
exit_code=$?
case $exit_code in
0)
echo "Команда завершилась успешно"
ntf "Пакет установлен!"
exit 0
;;
100)
ntf_error "Пакет не установлен. Команда завершилась с ошибкой."
exit 1
;;
126)
ntf_error "Пакет не установлен. Действие прервано пользователем."
exit 1
;;
*)
ntf_error "Пакет не установлен."
exit 1
;;
esac
) | sed -u 's/^/# /' | $YAD_DEFAULT \
--title="Установка пакета" \
--progress --width=800 --height=500 \
--enable-log="Лог" --log-expanded --log-on-top \
--auto-kill --auto-close \
}
main() {
if [[ $# -eq 0 ]]; then
pkgselection
else
echo "Arguments provided: $1"
PKG_PATH="$1"
fi
preparepkg
repackq
installpkg
}
main "$@"
\ No newline at end of file
[Desktop Entry]
Name=Package Installer
Name[ru]=Установка пакетов
GenericName=epmgpi
Comment=Install packages from files
Comment[ru]=Установка пакетов из файлов
Exec=/usr/bin/epmgpi %F
Terminal=false
Type=Application
Icon=epmgpi
MimeType=application/x-rpm;application/x-redhat-package-manager;application/x-deb;application/x-debian-package;application/x-app-package;application/vnd.flatpak;application/vnd.flatpak.repo;application/vnd.flatpak.ref;
Categories=System;PackageManager;
Name: epmgpi
Version: 1.0
Release: alt1
Summary: Etersoft EPM GUI Package Installer
License: AGPL-3.0+
Group: System/Configuration/Packaging
Url: http://wiki.etersoft.ru/EPM
BuildArch: noarch
# Source-url: https://gitlab.eterfund.ru/ximper/epmgpi/archive/refs/tags/%version.tar.gz
Source: %name-%version.tar
Requires: yad notify-send eepm eepm-repack bash
%description
EPM GUI Package Installer was created to install packages
(.rpm .deb .AppImage) by means of epm repack in GUI execution.
%prep
%setup
%install
%makeinstall_std
%files
%doc LICENSE
%_bindir/epmgpi
%_desktopdir/epmgpi.desktop
%_pixmapsdir/%name.svg
%changelog
* Mon Nov 20 2023 Roman Alifanov <ximper@altlinux.org> 1.0-alt1
- initial build for sisyphus
<svg id="Слой_1" data-name="Слой 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 381.88 364.29"><defs><style>.cls-1{fill:url(#Безымянный_градиент_9);}.cls-2{fill:#ffd602;}.cls-3{fill:#4e596b;}.cls-4{fill:url(#Безымянный_градиент_16);}.cls-5{fill:#727a89;opacity:0.61;}.cls-6{fill:#ffde17;}.cls-10,.cls-6,.cls-7,.cls-8,.cls-9{opacity:0.97;}.cls-7{fill:#4b526b;}.cls-8{fill:#4c536b;}.cls-9{fill:#fbffff;}.cls-10{fill:#4c5b6f;}</style><linearGradient id="Безымянный_градиент_9" x1="59.97" y1="25.4" x2="317.47" y2="333.57" gradientUnits="userSpaceOnUse"><stop offset="0.35" stop-color="#585969"/><stop offset="0.39" stop-color="#525464"/><stop offset="0.8" stop-color="#242c3d"/><stop offset="1" stop-color="#121d2e"/></linearGradient><linearGradient id="Безымянный_градиент_16" x1="125.6" y1="107.11" x2="254.32" y2="245.88" gradientUnits="userSpaceOnUse"><stop offset="0.99" stop-color="#f8f8f8"/><stop offset="0.99" stop-color="#f8f7f4"/><stop offset="0.99" stop-color="#f9f1c6"/><stop offset="1" stop-color="#faeb9d"/><stop offset="1" stop-color="#fbe577"/><stop offset="1" stop-color="#fbe157"/><stop offset="1" stop-color="#fcdd3b"/><stop offset="1" stop-color="#fcd925"/><stop offset="1" stop-color="#fdd714"/><stop offset="1" stop-color="#fdd509"/><stop offset="1" stop-color="#fdd402"/><stop offset="1" stop-color="#fdd400"/></linearGradient></defs><title>EPM3</title><rect class="cls-1" width="381.88" height="364.29" rx="32.77"/><rect class="cls-2" x="22.15" y="19.03" width="23.47" height="23.73"/><rect class="cls-2" x="337.06" y="19.03" width="23.47" height="23.73"/><rect class="cls-2" x="337.06" y="321.81" width="23.47" height="23.73"/><rect class="cls-2" x="22.15" y="321.81" width="23.47" height="23.73"/><path class="cls-2" d="M580.24,651.67H322.59l-24-24V410.12H604.24V627.67Z" transform="translate(-259.67 -329.85)"/><path class="cls-3" d="M367.35,420H535.47l31,31V616.82a10,10,0,0,1-10,10H346.35a10,10,0,0,1-10-10V451Z" transform="translate(-259.67 -329.85)"/><rect class="cls-4" x="94.68" y="76.03" width="193.41" height="204"/><path class="cls-5" d="M104.68,36.5H278.09a10,10,0,0,1,10,10V76a0,0,0,0,1,0,0H94.68a0,0,0,0,1,0,0V46.5A10,10,0,0,1,104.68,36.5Z"/><path class="cls-6" d="M104.68,36.5h43.88a0,0,0,0,1,0,0V61a0,0,0,0,1,0,0H94.68a0,0,0,0,1,0,0V46.5A10,10,0,0,1,104.68,36.5Z"/><circle class="cls-7" cx="113.01" cy="49.09" r="5.76"/><circle class="cls-8" cx="132.09" cy="49.09" r="5.76"/><rect class="cls-9" x="154.92" y="54.15" width="110.82" height="6.82"/><rect class="cls-3" x="113.01" y="101.97" width="49.44" height="8.12"/><path class="cls-10" d="M368.05,544.18V477.67h35.73v11.79h-23.4v15.66h22.41v11.79H380.38v15.48h23.4v11.79Z" transform="translate(-259.67 -329.85)"/><path class="cls-10" d="M414.85,544.18V477.67h16.47q11.25,0,16.2,2.61a3.52,3.52,0,0,1,.81.45q8.1,4.95,8.91,15.39.09,1,.09,2.07,0,9.72-5.94,15.57a18.36,18.36,0,0,1-2.79,2.16q-4.41,2.7-13.77,3h-7.65v25.29Zm12.33-37.08h3.6q7.2,0,10.08-1.53a7.63,7.63,0,0,0,4.05-7.2q0-5.76-4.5-7.83a10.57,10.57,0,0,0-1.26-.45,37.53,37.53,0,0,0-7.83-.63h-4.14Z" transform="translate(-259.67 -329.85)"/><path class="cls-10" d="M465.25,544.18V477.67h16.92l17.91,50.4,17.73-50.4h16.92v66.51H522.4V494.32L505,544.18H495l-17.37-49.86v49.86Z" transform="translate(-259.67 -329.85)"/></svg>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment