summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlashbunny2020-03-30 10:24:07 -0400
committerSlashbunny2020-03-30 10:24:15 -0400
commit0e63d482c930a84400f2eeb9c48878782c6f2cf3 (patch)
tree60b2482d9a354e344dced472b9cc3846fbe8b596
parent5e98d6b4ff829c18bea4729b3e4432c16ef80889 (diff)
downloadaur-0e63d482c930a84400f2eeb9c48878782c6f2cf3.tar.gz
Initial commit of new poljar plugin
-rw-r--r--.SRCINFO33
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD56
-rw-r--r--weechat-matrix-git.install22
4 files changed, 88 insertions, 27 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 68137284125d..a25a959a4130 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,31 @@
pkgbase = weechat-matrix-git
- pkgdesc = weechat script for matrix
- pkgver = r348.ace3fef
+ pkgdesc = Weechat Matrix protocol script written in Python
+ pkgver = r717.2a24096
pkgrel = 1
- url = https://github.com/torhve/weechat-matrix-protocol-script
+ url = https://github.com/poljar/weechat-matrix
+ install = weechat-matrix-git.install
arch = any
- license = MIT
+ license = ISC
+ checkdepends = python-hypothesis
+ checkdepends = python-pytest
makedepends = git
- depends = weechat
- depends = lua
- depends = lua-cjson
- source = weechat-matrix-git::git+https://github.com/torhve/weechat-matrix-protocol-script
- md5sums = SKIP
+ depends = python-atomicwrites
+ depends = python-attrs
+ depends = python-future
+ depends = python-logbook
+ depends = python-matrix-nio
+ depends = python-pygments
+ depends = python-pyopenssl
+ depends = python-webcolors
+ optdepends = python-aiohttp: matrix_sso_helper support
+ optdepends = python-magic: matrix_upload support
+ optdepends = python-requests: matrix_decrypt and matrix_upload support
+ optdepends = ranger: default plumber for matrix_decrypt
+ provides = weechat-matrix
+ conflicts = weechat-matrix
+ replaces = weechat-poljar-matrix-git
+ source = git+https://github.com/poljar/weechat-matrix.git
+ sha512sums = SKIP
pkgname = weechat-matrix-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..e984beab6197
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+weechat-matrix/
+*.pkg.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
index bc5686590eb3..13f1c7e04485 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,54 @@
-# Maintainer: pyz3n
+# Maintainer: Slash <youremail@domain.com>
pkgname=weechat-matrix-git
-pkgver=r348.ace3fef
-pkgrel=2
-pkgdesc="weechat script for matrix"
+_pkgname=${pkgname%-git}
+pkgver=r717.2a24096
+pkgrel=1
+pkgdesc='Weechat Matrix protocol script written in Python'
arch=('any')
-url='https://github.com/torhve/weechat-matrix-protocol-script'
-license=('MIT')
-depends=('weechat' 'lua' 'lua-cjson')
+url="https://github.com/poljar/weechat-matrix"
+license=('ISC')
+depends=('python-atomicwrites' 'python-attrs' 'python-future' 'python-logbook'
+ 'python-matrix-nio' 'python-pygments' 'python-pyopenssl' 'python-webcolors')
makedepends=('git')
-source=("${pkgname}::git+https://github.com/torhve/weechat-matrix-protocol-script")
-md5sums=('SKIP')
-install=weechat-matrix-git.install
+checkdepends=('python-hypothesis' 'python-pytest')
+optdepends=('python-aiohttp: matrix_sso_helper support'
+ 'python-magic: matrix_upload support'
+ 'python-requests: matrix_decrypt and matrix_upload support'
+ 'ranger: default plumber for matrix_decrypt')
+replaces=('weechat-poljar-matrix-git')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+install="${pkgname}.install"
+source=("git+${url}.git")
+sha512sums=('SKIP')
pkgver() {
- cd "$pkgname"
+ cd "${_pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
+prepare() {
+ cd "${_pkgname}"
+ sed -ri 's|#!/usr/bin/env( -S)? python3|#!/usr/bin/python3|' contrib/*.py
+}
+
+check() {
+ cd "${_pkgname}"
+ python -m pytest
+}
+
package() {
- cd "$srcdir/$pkgname"
- install -D "matrix.lua" -t "$pkgdir/opt"
+ cd "${_pkgname}"
+
+ make DESTDIR="${pkgdir}" PREFIX=/usr/share/weechat install
+
+ for _script in matrix_decrypt matrix_sso_helper matrix_upload
+ do
+ install -Dm755 "contrib/${_script}.py" \
+ "${pkgdir}/usr/bin/${_script}"
+ done
+
+ install -Dm644 'LICENSE' \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/weechat-matrix-git.install b/weechat-matrix-git.install
index c9c56a18015a..f81f16a782d3 100644
--- a/weechat-matrix-git.install
+++ b/weechat-matrix-git.install
@@ -1,6 +1,18 @@
-post_install () {
- echo "[weechat-matrix-git] Please run the following to complete installation:"
- echo "[weechat-matrix-git] mkdir -p ~/.weechat/lua/autoload"
- echo "[weechat-matrix-git] ln -s /opt/matrix.lua ~/.weechat/lua"
- echo "[weechat-matrix-git] ln -s ~/.weechat/lua/matrix.lua ~/.weechat/lua/autoload"
+_install_update_msg() {
+ echo "In order to use this plugin after installation, you'll need to run the following command as the user running weechat:"
+ echo ""
+ echo " $ ln -s /usr/share/weechat/python/{matrix,matrix.py} -t ~/.weechat/python"
+ echo ""
+ echo "If you want the script to be loaded on start-up, you'll also need to symlink it into the autoload folder:"
+ echo ""
+ echo " $ ln -s /usr/share/weechat/python/matrix.py ~/.weechat/python/autoload/"
+ echo ""
+}
+
+post_install() {
+ _install_update_msg
+}
+
+post_upgrade() {
+ _install_update_msg
}