cachy-auto-update: add package (1.0.0-1)
This commit is contained in:
1 parent
a6c7b5d8aa
commit
0e674fada3
5 files changed
+127
No files matched your search
@@ -0,0 +1,29 @@
|
||||
pkgbase = cachy-auto-update
|
||||
pkgdesc = Unattended background updates for CachyOS, aware of battery, gaming and manual package management
|
||||
pkgver = 1.0.0
|
||||
pkgrel = 1
|
||||
url = https://github.com/Felitendo/cachy-auto-update
|
||||
install = cachy-auto-update.install
|
||||
arch = any
|
||||
license = GPL-3.0-or-later
|
||||
makedepends = gettext
|
||||
makedepends = scdoc
|
||||
depends = bash
|
||||
depends = systemd
|
||||
depends = pacman
|
||||
depends = pacman-contrib
|
||||
depends = util-linux
|
||||
depends = sudo
|
||||
depends = gettext
|
||||
optdepends = paru: AUR package updates
|
||||
optdepends = yay: AUR package updates
|
||||
optdepends = base-devel: required to build AUR packages
|
||||
optdepends = flatpak: Flatpak updates
|
||||
optdepends = libnotify: desktop notifications
|
||||
optdepends = gearlever: AppImage updates
|
||||
backup = etc/cachy-auto-update/cachy-auto-update.conf
|
||||
backup = etc/logrotate.d/cachy-auto-update
|
||||
source = cachy-auto-update-1.0.0.tar.gz::https://github.com/Felitendo/cachy-auto-update/archive/refs/tags/v1.0.0.tar.gz
|
||||
sha256sums = e0ed0e3d76174de6d49625236487af90da0071a3ff54588a327020fd90a6db32
|
||||
|
||||
pkgname = cachy-auto-update
|
||||
@@ -0,0 +1,33 @@
|
||||
# Maintainer: Felitendo
|
||||
# This PKGBUILD is updated automatically:
|
||||
# https://github.com/Felitendo/PKGBUILDS
|
||||
|
||||
pkgname=cachy-auto-update
|
||||
pkgver=1.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="Unattended background updates for CachyOS, aware of battery, gaming and manual package management"
|
||||
arch=('any')
|
||||
url="https://github.com/Felitendo/cachy-auto-update"
|
||||
license=('GPL-3.0-or-later')
|
||||
depends=('bash' 'systemd' 'pacman' 'pacman-contrib' 'util-linux' 'sudo'
|
||||
'gettext')
|
||||
makedepends=('gettext' 'scdoc')
|
||||
optdepends=('paru: AUR package updates'
|
||||
'yay: AUR package updates'
|
||||
'base-devel: required to build AUR packages'
|
||||
'flatpak: Flatpak updates'
|
||||
'libnotify: desktop notifications'
|
||||
'gearlever: AppImage updates')
|
||||
backup=('etc/cachy-auto-update/cachy-auto-update.conf'
|
||||
'etc/logrotate.d/cachy-auto-update')
|
||||
install="${pkgname}.install"
|
||||
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
|
||||
sha256sums=('e0ed0e3d76174de6d49625236487af90da0071a3ff54588a327020fd90a6db32')
|
||||
|
||||
build() {
|
||||
make -C "${pkgname}-${pkgver}"
|
||||
}
|
||||
|
||||
package() {
|
||||
make -C "${pkgname}-${pkgver}" DESTDIR="$pkgdir" install
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
_check_sudoers() {
|
||||
# A malformed drop-in in /etc/sudoers.d takes sudo down for the whole
|
||||
# machine, so say so loudly rather than leaving it to be discovered later.
|
||||
if command -v visudo > /dev/null 2>&1; then
|
||||
if ! visudo -cf /etc/sudoers.d/cachy-auto-update > /dev/null 2>&1; then
|
||||
printf '\n WARNING: /etc/sudoers.d/cachy-auto-update did not validate.\n' >&2
|
||||
printf ' AUR updates will not work until this is resolved.\n\n' >&2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
_check_sudoers
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
cachy-auto-update is installed but not active yet.
|
||||
|
||||
sudo cachy-auto-update interactive setup
|
||||
sudo cachy-auto-update enable turn automatic updates on
|
||||
sudo cachy-auto-update status see what it would do right now
|
||||
|
||||
AUR packages are built by a locked system account that is allowed to call
|
||||
pacman without a password (/etc/sudoers.d/cachy-auto-update). No user
|
||||
password is stored anywhere. Set UpdateAUR=no in
|
||||
/etc/cachy-auto-update/cachy-auto-update.conf to opt out of that entirely.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
_check_sudoers
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
systemctl disable --now cachy-auto-update.timer > /dev/null 2>&1 || true
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# cachy-auto-update - unattended background updates for CachyOS
|
||||
# (https://github.com/Felitendo/cachy-auto-update).
|
||||
#
|
||||
# Pure shell plus a gettext catalog and a scdoc man page, so the PKGBUILD just
|
||||
# runs the upstream Makefile against the release tarball. Nothing is prebuilt
|
||||
# and nothing is republished - the AUR package builds exactly what the tag
|
||||
# contains.
|
||||
|
||||
UPSTREAM_REPO="Felitendo/cachy-auto-update"
|
||||
|
||||
# Installed in CI (pacman) before the makepkg test build.
|
||||
BUILD_DEPS=(gettext scdoc)
|
||||
|
||||
latest_version() {
|
||||
gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//'
|
||||
}
|
||||
|
||||
# refresh_checksums <version> <pkgbuild-path>
|
||||
refresh_checksums() {
|
||||
local ver="$1" pkgbuild="$2"
|
||||
local sha
|
||||
|
||||
sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" \
|
||||
| sha256sum | cut -d' ' -f1)"
|
||||
|
||||
sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild"
|
||||
}
|
||||
Reference in new issue
Block a user