summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Ian Hawdon2018-01-16 19:31:46 +0000
committerRobert Ian Hawdon2018-01-16 19:31:46 +0000
commit22118e448111e08e2983c35108c92d5725e3d592 (patch)
treea7b9ec6fdd7fd3744d2569d353b9a110bf6e8b73
downloadaur-22118e448111e08e2983c35108c92d5725e3d592.tar.gz
Initial Commit
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD82
-rw-r--r--gschemas.install20
3 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ca479cc94dc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = gnome-shell-extension-keepawake-git
+ pkgdesc = Prevent your computer from activating the screensaver, turning off your screen or suspending when it is idle for a while.
+ pkgver = r26.c2483f9
+ pkgrel = 1
+ url = https://github.com/jenspfahl/KeepAwake
+ install = gschemas.install
+ arch = any
+ license = GPLv3
+ makedepends = git
+ depends = gnome-shell-extensions
+ depends = gnome-shell
+ provides = gnome-shell-extension-keepawake=r26.c2483f9
+ conflicts = gnome-shell-extension-keepawake
+ source = gnome-shell-extension-keepawake::git+https://github.com/jenspfahl/KeepAwake
+ md5sums = SKIP
+
+pkgname = gnome-shell-extension-keepawake-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..e4e7ba4208e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,82 @@
+# Maintainer: Robert Hawdon <aur at robertianhawdon dot me dot uk>
+
+pkgname=gnome-shell-extension-keepawake-git
+pkgver=r26.c2483f9
+pkgrel=1
+pkgdesc="Prevent your computer from activating the screensaver, turning off your screen or suspending when it is idle for a while."
+arch=(any)
+url="https://github.com/jenspfahl/KeepAwake"
+license=(GPLv3)
+
+makedepends+=('git')
+source+=("${_gitname:=${pkgname%-git}}::${_giturl:-git+$url}")
+for integ in $(get_integlist)
+do
+ typeset -n array="${integ}sums"
+ array+=('SKIP')
+done
+provides+=("$_gitname=$pkgver")
+conflicts+=("$_gitname")
+pkgver() {
+ cd ${_gitname:-$pkgname}
+ git describe --long --tags 2>/dev/null | sed 's/[^[:digit:]]*\(.\+\)-\([[:digit:]]\+\)-g\([[:xdigit:]]\{7\}\)/\1.r\2.g\3/;t;q1'
+ [ ${PIPESTATUS[0]} -ne 0 ] && \
+printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+package() {
+ for function in $(declare -F | grep -Po 'package_[[:digit:]]+[[:alpha:]_]*$')
+ do
+ $function
+ done
+}
+package_01_locate() {
+ msg2 'Locating extension...'
+ cd "$(find -name 'metadata.json' -execdir test -e extension.js \; \
+ -printf '%C@ %h\n' | sort -nr | sed 's/^.* //;q' )"
+ extname=$(grep -Po '(?<="uuid": ")[^"]*' metadata.json)
+ destdir="$pkgdir/usr/share/gnome-shell/extensions/$extname"
+}
+
+package_02_install() {
+ msg2 'Installing extension code...'
+ find -maxdepth 1 \( -iname '*.js*' -or -iname '*.css' -or -iname '*.ui' \) \
+ -exec install -Dm644 -t "$destdir" '{}' +
+}
+depends+=(gnome-shell-extensions)
+
+package_03_unify_conveniencejs() {
+ ln -fs \
+ ../user-theme@gnome-shell-extensions.gcampax.github.com/convenience.js \
+ "$destdir/convenience.js"
+}
+
+package_09_icons() {
+ cp -r --no-preserve=ownership,mode icons "$destdir"
+}
+
+if [ -z "$install" ]
+then
+ install=gschemas.install
+fi
+
+package_10_schemas() {
+ msg2 'Installing schemas...'
+ find -name '*.xml' -exec install -Dm644 -t "$pkgdir/usr/share/glib-2.0/schemas" '{}' +
+}
+depends[125]=gnome-shell
+
+package_20_version() {
+ local compatibles=($(\
+ find -path ./pkg -type d -prune -o \
+ -name metadata.json -exec cat '{}' \; | \
+ tr -d '\n' | grep -Po '(?<="shell-version": \[)[^\[\]]*(?=\])' | \
+ tr '\n," ' '\n' | sed 's/3\.//g;/^$/d' | sort -n -t. -k 1,1))
+ depends+=("gnome-shell>=3.${compatibles[0]}")
+ local max="${compatibles[-1]}"
+ if [ "$max" != $(
+ gnome-shell --version | grep -Po '(?<=GNOME Shell 3\.)[[:digit:]]+'
+ ) ]; then
+ depends+=("gnome-shell<3.$((${max%%.*} + 1))")
+ fi
+ unset depends[125]
+}
diff --git a/gschemas.install b/gschemas.install
new file mode 100644
index 00000000000..863897ad543
--- /dev/null
+++ b/gschemas.install
@@ -0,0 +1,20 @@
+post_install() {
+ instruct
+ echo "and enable the extension with gnome-tweak-tool."
+}
+
+post_upgrade() {
+ instruct
+ echo "for the changes to have an effect."
+}
+
+post_remove() {
+ glib-compile-schemas usr/share/glib-2.0/schemas/
+}
+
+instruct() {
+ post_remove
+ echo "Don't forget to restart GNOME Shell ([Alt]+[F2], r)"
+}
+
+# vim: ts=2 sw=2 et: