diff options
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | .gitlab-ci.yml | 55 | ||||
-rw-r--r-- | PKGBUILD | 31 | ||||
-rw-r--r-- | autosuspend.install | 5 | ||||
-rwxr-xr-x | post-update.sh | 24 | ||||
-rw-r--r-- | renovate.json | 27 |
6 files changed, 142 insertions, 15 deletions
@@ -1,17 +1,22 @@ pkgbase = autosuspend pkgdesc = A daemon to suspend and wake up a system based on configurable checks - pkgver = 2.0.3 + pkgver = 6.1.1 pkgrel = 1 url = https://github.com/languitar/autosuspend + install = autosuspend.install arch = any license = GPL2 makedepends = python-setuptools makedepends = python-pytest-runner + makedepends = python-recommonmark makedepends = python-sphinx - makedepends = python-sphinx_rtd_theme + makedepends = python-sphinx-furo makedepends = python-sphinx-issues + makedepends = python-sphinxcontrib-plantuml + makedepends = python-sphinx-autodoc-typehints depends = python depends = python-psutil + depends = python-portalocker optdepends = python-dbus: logind session discovery optdepends = python-mpd2: MPD playing status check optdepends = python-requests: network-based checks @@ -21,12 +26,12 @@ pkgbase = autosuspend optdepends = python-dateutil: iCalendar checks optdepends = python-tzlocal: iCalendar checks optdepends = python-requests-file: file:// URL support + optdepends = python-jsonpath-ng: JSONPath checks optdepends = iputils: ping check optdepends = xprintidle: X server idle time check backup = etc/autosuspend.conf backup = etc/autosuspend-logging.conf - source = https://github.com/languitar/autosuspend/archive/v2.0.3.tar.gz - sha256sums = 80537bf841c9ac80078b2f817039dda9f485c8ae8563f4bb187b7b8ad34d7ae1 + source = autosuspend-6.1.1.tar.gz::https://github.com/languitar/autosuspend/archive/v6.1.1.tar.gz + sha256sums = fde028f7974e67fd6b1ba7e77b75cacbb5f774eccdd1065956ec25b71b70f053 pkgname = autosuspend - diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000000..3dca97e095a9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,55 @@ +build: + stage: build + image: + name: countstarlight/makepkg:latest + entrypoint: [""] + before_script: + - sudo pacman -Sy --noconfirm archlinux-keyring + - yay -Syu --noconfirm + script: + - | + depends=() + makedepends=() + checkdepends=() + . ./PKGBUILD + deps=( "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}" ) + (pacman --deptest "${deps[@]}" || true) | xargs yay -Sy --noconfirm + - makepkg -f + artifacts: + untracked: false + expire_in: 5 days + paths: + - '*.pkg.tar.zst' + +test: + stage: test + image: + name: countstarlight/makepkg:latest + entrypoint: [""] + script: + - yay -Sy --noconfirm + - yay -S --noconfirm archlinux-keyring + - yay -S --noconfirm python-portalocker + - yay --noconfirm -U *.pkg.tar.zst + - autosuspend -h + +deploy: + stage: deploy + image: bitnami/git:latest + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + variables: + GIT_DEPTH: "0" + before_script: + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + + - ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + + script: + - git remote add aur ssh://aur@aur.archlinux.org/autosuspend.git + - git push aur origin/master:master @@ -1,13 +1,13 @@ # Maintainer: Johannes Wienke <languitar@semipol.de> pkgname=autosuspend -pkgver=2.0.3 +pkgver=6.1.1 pkgrel=1 pkgdesc="A daemon to suspend and wake up a system based on configurable checks" arch=(any) url="https://github.com/languitar/autosuspend" license=('GPL2') -depends=('python' 'python-psutil') +depends=('python' 'python-psutil' 'python-portalocker') optdepends=('python-dbus: logind session discovery' 'python-mpd2: MPD playing status check' 'python-requests: network-based checks' @@ -17,34 +17,45 @@ optdepends=('python-dbus: logind session discovery' 'python-dateutil: iCalendar checks' 'python-tzlocal: iCalendar checks' 'python-requests-file: file:// URL support' + 'python-jsonpath-ng: JSONPath checks' 'iputils: ping check' 'xprintidle: X server idle time check') -makedepends=('python-setuptools' 'python-pytest-runner' 'python-sphinx' 'python-sphinx_rtd_theme' 'python-sphinx-issues') -source=("https://github.com/languitar/autosuspend/archive/v${pkgver}.tar.gz") -sha256sums=('80537bf841c9ac80078b2f817039dda9f485c8ae8563f4bb187b7b8ad34d7ae1') +makedepends=('python-setuptools' + 'python-pytest-runner' + 'python-recommonmark' + 'python-sphinx' + 'python-sphinx-furo' + 'python-sphinx-issues' + 'python-sphinxcontrib-plantuml' + 'python-sphinx-autodoc-typehints') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/languitar/autosuspend/archive/v${pkgver}.tar.gz") +sha256sums=('fde028f7974e67fd6b1ba7e77b75cacbb5f774eccdd1065956ec25b71b70f053') +install="${pkgname}.install" backup=('etc/autosuspend.conf' 'etc/autosuspend-logging.conf') build() { cd "$pkgname-${pkgver}" - python3 setup.py build_sphinx -a -b html - python3 setup.py build_sphinx -a -b man + python -m build --wheel --no-isolation + export PYTHONPATH=$(pwd)/src + sphinx-build -a -b html doc/source/ doc/build/html + sphinx-build -a -b man doc/source/ doc/build/man } package() { cd "$pkgname-${pkgver}" - python3 setup.py install --root="$pkgdir/" --install-data=/usr + python -m installer --destdir="$pkgdir" dist/*.whl # setuptools install_data is a nightmare, and cannot be made to respect the # filesystem hierarchy. Do things manually instead. mv "$pkgdir/usr/etc" "$pkgdir" - # man pages + # # man pages mkdir -p "${pkgdir}/usr/share/man/man1" cp doc/build/man/autosuspend.1 "${pkgdir}/usr/share/man/man1" mkdir -p "${pkgdir}/usr/share/man/man5" cp doc/build/man/autosuspend.conf.5 "${pkgdir}/usr/share/man/man5" - # HTML help + # # HTML help mkdir -p "${pkgdir}/usr/share/doc" cp -R doc/build/html "${pkgdir}/usr/share/doc/${pkgname}" } diff --git a/autosuspend.install b/autosuspend.install new file mode 100644 index 000000000000..6d6240330050 --- /dev/null +++ b/autosuspend.install @@ -0,0 +1,5 @@ +post_upgrade() { + echo ">> Systemd units have change with the 3.0 release." + echo ">> Please enable autosuspend.service and autosuspend-detect-suspend.service." + echo ">> Only autosuspend.service needs to be started." +} diff --git a/post-update.sh b/post-update.sh new file mode 100755 index 000000000000..c2516ee42c40 --- /dev/null +++ b/post-update.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -exuo pipefail + +uid="$(id -u)" + +# Move pkgrel back to 1 after a version bump +sed -i 's/pkgrel=.*/pkgrel=1/' ./PKGBUILD + +# Update checksums and the .SRCINFO file to match the new version. +# The easiest and most consistent way to do this is by using the +# archlinux-provided tools for this. Because renovate doesn't run in an arch +# container, use docker to spin up a temporary container for this purpose. +# makepkg in this container cannot be run as root. Therefore, create a +# temporary user for this. This used need to use the UID of the host's user to +# avoid file access problems when using bind mounts in docker. +docker run --rm -v "$(pwd):/pkg" archlinux:latest bash -c " +set -exuo pipefail +pacman -Syu --noconfirm pacman-contrib binutils +useradd -u ${uid} builder +cd /pkg +su builder -c updpkgsums +su builder -c 'makepkg --printsrcinfo > .SRCINFO' +" diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000000..193b610e703c --- /dev/null +++ b/renovate.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + + "extends": ["config:base"], + + "assignees": ["languitar"], + "reviewers": ["languitar"], + + "postUpgradeTasks": { + "commands": ["./post-update.sh"], + "fileFilters": ["PKGBUILD", ".SRCINFO"], + "executionMode": "branch" + }, + + "regexManagers": [ + { + "fileMatch": ["^PKGBUILD$"], + "matchStrings": [ + "pkgver=(?<currentValue>.*?)\n" + ], + "depNameTemplate": "languitar/autosuspend", + "datasourceTemplate": "github-releases", + "extractVersionTemplate": "^v(?<version>.*)$" + } + ] +} + |