summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD58
-rw-r--r--weechat-poljar-matrix-git.install13
3 files changed, 53 insertions, 41 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bd7e883ab85f..4cae903406b0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,30 @@
pkgbase = weechat-poljar-matrix-git
- pkgdesc = Python plugin for Weechat to communicate over the Matrix protocol
- pkgver = r701.6d58ff0
+ pkgdesc = Weechat Matrix protocol script written in Python
+ pkgver = r717.2a24096
pkgrel = 1
url = https://github.com/poljar/weechat-matrix
install = weechat-poljar-matrix-git.install
arch = any
- license = custom
+ license = ISC
+ checkdepends = python-hypothesis
+ checkdepends = python-pytest
makedepends = git
- depends = python-aiohttp
depends = python-atomicwrites
depends = python-attrs
depends = python-future
depends = python-logbook
- depends = python-nio
+ depends = python-matrix-nio
depends = python-pygments
depends = python-pyopenssl
depends = python-webcolors
- provides = weechat-poljar-matrix
- conflicts = weechat-poljar-matrix
- source = weechat-matrix::git+https://github.com/poljar/weechat-matrix.git
- md5sums = SKIP
+ 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
+ source = git+https://github.com/poljar/weechat-matrix.git
+ sha512sums = SKIP
pkgname = weechat-poljar-matrix-git
diff --git a/PKGBUILD b/PKGBUILD
index 5b0ee97169b9..d71d37d8ac79 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,40 +1,54 @@
# Maintainer: Slash <youremail@domain.com>
pkgname=weechat-poljar-matrix-git
-pkgver=r701.6d58ff0
+#_pkgname=${pkgname%-git}
+_pkgname='weechat-matrix'
+pkgver=r717.2a24096
pkgrel=1
-pkgdesc="Python plugin for Weechat to communicate over the Matrix protocol"
+pkgdesc='Weechat Matrix protocol script written in Python'
arch=('any')
url="https://github.com/poljar/weechat-matrix"
-license=('custom')
-groups=()
-depends=('python-aiohttp' 'python-atomicwrites' 'python-attrs' 'python-future' 'python-logbook'
- 'python-nio' 'python-pygments' 'python-pyopenssl' 'python-webcolors')
+license=('ISC')
+depends=('python-atomicwrites' 'python-attrs' 'python-future' 'python-logbook'
+ 'python-matrix-nio' 'python-pygments' 'python-pyopenssl' 'python-webcolors')
makedepends=('git')
-provides=('weechat-poljar-matrix')
-conflicts=('weechat-poljar-matrix')
-install='weechat-poljar-matrix-git.install'
-source=('weechat-matrix::git+https://github.com/poljar/weechat-matrix.git')
-md5sums=('SKIP')
+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')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+install="${pkgname}.install"
+source=("git+${url}.git")
+sha512sums=('SKIP')
pkgver() {
- cd "${srcdir}/weechat-matrix"
+ 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}/weechat-matrix"
+ cd "${_pkgname}"
- # Install plugin scripts
- make WEECHAT_HOME="${pkgdir}/usr/lib/weechat" install
+ make DESTDIR="${pkgdir}" PREFIX=/usr/share/weechat install
- # Install contrib scripts
- for script in contrib/*; do
- install -D -m 755 "${script}" \
- "${pkgdir}/usr/lib/weechat/python/matrix/${script}"
- done;
+ for _script in matrix_decrypt matrix_sso_helper matrix_upload
+ do
+ install -Dm755 "contrib/${_script}.py" \
+ "${pkgdir}/usr/bin/${_script}"
+ done
- # Install License
- install -D -m 644 'LICENSE' \
+ install -Dm644 'LICENSE' \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/weechat-poljar-matrix-git.install b/weechat-poljar-matrix-git.install
index 4222419bd125..f81f16a782d3 100644
--- a/weechat-poljar-matrix-git.install
+++ b/weechat-poljar-matrix-git.install
@@ -1,18 +1,11 @@
_install_update_msg() {
- echo "In order to use this plugin after installation, you'll need to run the following commands as the user that is running weechat:"
+ 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/lib/weechat/python/matrix/ ~/.weechat/python/"
- echo " $ ln -s /usr/lib/weechat/python/matrix.py ~/.weechat/python/"
+ 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/lib/weechat/python/matrix.py ~/.weechat/python/autoload/"
- echo ""
- echo "Optional scripts, like matrix_decrypt, matrix_sso_helper, and matrix_upload are available in the following directory:"
- echo ""
- echo " /usr/lib/weechat/python/matrix/contrib/"
- echo ""
- echo " Symlink these files or add this directory to your \$PATH to use these scripts."
+ echo " $ ln -s /usr/share/weechat/python/matrix.py ~/.weechat/python/autoload/"
echo ""
}