summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedroHLC2020-09-12 13:12:49 -0300
committerPedroHLC2020-09-12 13:12:49 -0300
commite07f2e91b9e7092ba5eb4fc7faa973a2f9836a51 (patch)
treee1219e2499654c67fdcf7516d5d32fa408b62c3c
downloadaur-e07f2e91b9e7092ba5eb4fc7faa973a2f9836a51.tar.gz
Initial release
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD22
-rw-r--r--chaotic-keyring.install58
3 files changed, 95 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3e4452d8fecb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = chaotic-keyring
+ pkgdesc = Chaotic-AUR PGP keyring
+ pkgver = 20200912
+ pkgrel = 2
+ url = https://lonewolf.pedrohlc.com/chaotic-aur
+ install = chaotic-keyring.install
+ arch = any
+ license = GPL
+ depends = archlinux-keyring
+ optdepends = pkgstats: install to submit package usage statistics
+ source = keyring.tar.gz::https://github.com/chaotic-aur/keyring/archive/20200912-2.tar.gz
+ sha512sums = 1ac37dff6605850cbacc40864c3d0a4052a4f1d1f873961e1be94dd3bd8c3cc477d20272eda88ef93e7c1e8bb8513aac4a5a30bcf99317e3c6f34df82799ad6e
+
+pkgname = chaotic-keyring
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5d42d1019a84
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,22 @@
+# Maintainer: Pedro H. Lara Campos <root@pedrohlc.com>
+# Thanks for archlinuxcn's package that I've used as template!
+
+pkgname='chaotic-keyring'
+pkgver='20200912'
+pkgrel=1
+pkgdesc='Chaotic-AUR PGP keyring'
+arch=('any')
+url='https://lonewolf.pedrohlc.com/chaotic-aur'
+license=('GPL')
+depends=('archlinux-keyring')
+optdepends=('pkgstats: install to submit package usage statistics')
+install="chaotic-keyring.install"
+source=("keyring.tar.gz::https://github.com/chaotic-aur/keyring/archive/$pkgver-$pkgrel.tar.gz")
+
+package() {
+ cd "$srcdir/keyring-$pkgver-$pkgrel"
+
+ make PREFIX=/usr "DESTDIR=$pkgdir" install
+}
+
+sha512sums=('828472fec1dd8a75703af864087180702cb91c4aee3124b844a5a6fbd690c9a9250143792ca5479b5cd6da87cdcf2b216de72431029a78be0ee1c21d7932d7de')
diff --git a/chaotic-keyring.install b/chaotic-keyring.install
new file mode 100644
index 000000000000..f7fc5b9d87f4
--- /dev/null
+++ b/chaotic-keyring.install
@@ -0,0 +1,58 @@
+
+## copy from pacman-key
+_msg() {
+ (( QUIET )) && return
+ local mesg=$1; shift
+ printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
+}
+
+
+_error() {
+ local mesg=$1; shift
+ printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
+}
+
+_get_from() {
+ while IFS='=' read -r key value; do
+ [[ -z $key || ${key:0:1} = '#' ]] && continue
+
+ if [[ ${key%% *} = "$2" && -n ${value##* } ]]; then
+ echo "${value##* }"
+ return 0
+ fi
+ done < "$1"
+ if [[ -n "$3" ]]; then
+ printf '%s\n' "$3"
+ return 0
+ fi
+ return 1
+}
+
+CONFIG=${CONFIG:-/etc/pacman.conf}
+PACMAN_KEYRING_DIR=${PACMAN_KEYRING_DIR:-$(_get_from "$CONFIG" "GPGDir" "/etc/pacman.d/gnupg")}
+GPG_PACMAN=(gpg --homedir "${PACMAN_KEYRING_DIR}" --no-permission-warning)
+
+
+post_upgrade() {
+ if usr/bin/pacman-key -l >/dev/null 2>&1; then
+ usr/bin/pacman-key --populate chaotic
+
+ ## needed for https://github.com/archlinuxcn/repo/issues/300
+ _msg "$(gettext "Updating trust database...")"
+ if ! "${GPG_PACMAN[@]}" --batch --check-trustdb --yes ; then
+ _error "$(gettext "Trust database could not be updated.")"
+ exit 1
+ fi
+ fi
+ if (usr/bin/grep -A3 "[^#]*\[chaotic-aur\]" /etc/pacman.conf | grep "TrustAll" >/dev/null 2>&1); then
+ _error 'Please remove the SigLevel= line of [chaotic-aur] from "/etc/pacman.conf" to use the default setting'
+ _error '请删除 /etc/pacman.conf 中 [chaotic-aur] 下的 SigLevel= 行,以使用默认设置'
+ fi
+}
+
+post_install() {
+ if [ -x usr/bin/pacman-key ]; then
+ post_upgrade
+ fi
+}
+