Browse Source

Initial commit

master
Baltazár Radics 7 months ago
commit
9c12cdce19
Signed by: baltazar GPG Key ID: 9440F591E4397C3E
  1. 39
      .SRCINFO
  2. 4
      .gitignore
  3. 57
      PKGBUILD
  4. 23
      config.patch
  5. 14
      mautrix-facebook.service
  6. 1
      mautrix-facebook.sysusers
  7. 1
      mautrix-facebook.tmpfiles

39
.SRCINFO

@ -0,0 +1,39 @@
pkgbase = mautrix-facebook-git
pkgdesc = A Matrix-Facebook Messenger puppeting bridge
pkgver = 0.2.0.r5.2fb76cb
pkgrel = 1
url = https://github.com/tulir/mautrix-facebook
arch = any
license = AGPL3
makedepends = git
depends = python
depends = python-aiohttp
depends = python-yarl
depends = python-asyncpg
depends = python-ruamel-yaml
depends = python-commonmark
depends = python-magic-git
depends = python-mautrix
depends = python-pycryptodome
depends = python-paho-mqtt
optdepends = python-pillow: animated_stickers
optdepends = python-olm: e2be
optdepends = python-unpaddedbase64: e2be
optdepends = python-prometheus_client: metrics
optdepends = python-setuptools: weblogin
provides = mautrix-facebook
conflicts = mautrix-facebook
backup = etc/mautrix-facebook/config.yaml
source = git+https://github.com/tulir/mautrix-facebook.git
source = mautrix-facebook.sysusers
source = mautrix-facebook.tmpfiles
source = mautrix-facebook.service
source = config.patch
sha256sums = SKIP
sha256sums = c7bb43143885e811028e2bca23c175d67128d6f9c1638446779cefb267a24226
sha256sums = 368d44410aca3ba8bdb74f38a9cfdece49686709c01ba6d06aa05cc0d102db9d
sha256sums = 882aee27fcd4f2fef193adad0302c40afa658c3804b73fc4e0c4d164f52014c3
sha256sums = 0173a47e99e7de79a618b7255493d56bc45c9f275444a9d0ffbfae73b73f6e90
pkgname = mautrix-facebook-git

4
.gitignore

@ -0,0 +1,4 @@
/pkg/
/src/
/mautrix-facebook/
mautrix-facebook-git-*.pkg.tar.*

57
PKGBUILD

@ -0,0 +1,57 @@
# Maintainer: Baltazár Radics <baltazar.radics@gmail.com>
_pkgname=mautrix-facebook
pkgname=$_pkgname-git
pkgver=0.2.0.r5.2fb76cb
pkgrel=1
pkgdesc='A Matrix-Facebook Messenger puppeting bridge'
arch=(any)
url='https://github.com/tulir/mautrix-facebook'
license=(AGPL3)
depends=(python python-{aiohttp,yarl,asyncpg,ruamel-yaml,commonmark,magic-git,mautrix,pycryptodome,paho-mqtt})
makedepends=(git)
optdepends=(
'python-pillow: animated_stickers'
'python-olm: e2be'
'python-unpaddedbase64: e2be'
'python-prometheus_client: metrics'
'python-setuptools: weblogin'
)
provides=($_pkgname)
conflicts=($_pkgname)
backup=("etc/$_pkgname/config.yaml")
source=(
"git+https://github.com/tulir/$_pkgname.git"
"$_pkgname.sysusers"
"$_pkgname.tmpfiles"
"$_pkgname.service"
"config.patch"
)
sha256sums=('SKIP'
'c7bb43143885e811028e2bca23c175d67128d6f9c1638446779cefb267a24226'
'368d44410aca3ba8bdb74f38a9cfdece49686709c01ba6d06aa05cc0d102db9d'
'882aee27fcd4f2fef193adad0302c40afa658c3804b73fc4e0c4d164f52014c3'
'0173a47e99e7de79a618b7255493d56bc45c9f275444a9d0ffbfae73b73f6e90')
pkgver() {
cd $_pkgname
git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}
prepare() {
cd $_pkgname
git apply ../config.patch
}
package() {
install -Dm644 $_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname.service
install -Dm644 $_pkgname.sysusers "$pkgdir"/usr/lib/sysusers.d/$_pkgname.conf
install -Dm644 $_pkgname.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$_pkgname.conf
cd $_pkgname
python setup.py install --root="$pkgdir" --optimize=1
install -d "$pkgdir"/etc/$_pkgname
mv "$pkgdir"/usr/example-config.yaml "$pkgdir"/etc/$_pkgname/config.yaml
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

23
config.patch

@ -0,0 +1,23 @@
diff --git a/mautrix_facebook/example-config.yaml b/mautrix_facebook/example-config.yaml
index 6b96e3e..e50cb46 100644
--- a/mautrix_facebook/example-config.yaml
+++ b/mautrix_facebook/example-config.yaml
@@ -14,6 +14,9 @@ homeserver:
# Application service host/registration related details
# Changing these values requires regeneration of the registration.
+# # python3 -m mautrix_facebook -g -c /etc/mautrix-facebook/config.yaml -r /path/to/registration.yaml
+# After generating, add the file to app_service_config_files in your homeserver.yaml,
+# make sure your homeserver can read it, then restart your homeserver.
appservice:
# The address that the homeserver can use to connect to this appservice.
address: http://localhost:29319
@@ -228,7 +231,7 @@ logging:
file:
class: logging.handlers.RotatingFileHandler
formatter: normal
- filename: ./mautrix-facebook.log
+ filename: /var/log/mautrix-facebook/log
maxBytes: 10485760
backupCount: 10
console:

14
mautrix-facebook.service

@ -0,0 +1,14 @@
[Unit]
Description=A Matrix-Facebook Messenger puppeting bridge.
[Service]
Type=simple
User=mautrix-facebook
LogsDirectory=mautrix-facebook
ExecStart=/usr/bin/python3 -m mautrix_facebook -c /etc/mautrix-facebook/config.yaml
SyslogIdentifier=mautrix-facebook
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

1
mautrix-facebook.sysusers

@ -0,0 +1 @@
u mautrix-facebook - "Mautrix Facebook user"

1
mautrix-facebook.tmpfiles

@ -0,0 +1 @@
z /etc/mautrix-facebook/config.yaml 0640 mautrix-facebook root
Loading…
Cancel
Save