summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO54
-rw-r--r--0000-change-default-config-path.patch17
-rw-r--r--PKGBUILD69
-rw-r--r--pagermaid.service14
-rw-r--r--sysusers.d1
-rw-r--r--tmpfiles.d1
6 files changed, 156 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..006e0bab7df
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,54 @@
+pkgbase = pagermaid-modify-git
+ pkgdesc = A utility daemon for telegram.
+ pkgver = r51.f6b17bb
+ pkgrel = 1
+ url = https://github.com/xtaodada/PagerMaid-Modify
+ arch = any
+ license = GPL3
+ makedepends = python-setuptools
+ depends = python-psutil
+ depends = python-pyqrcode
+ depends = python-pypng
+ depends = pyzbar
+ depends = python-emoji
+ depends = youtube-dl
+ depends = python-pyaml
+ depends = python-redis
+ depends = python-coloredlogs
+ depends = python-requests
+ depends = python-pytz
+ depends = python-googletrans
+ depends = python-beautifulsoup4
+ depends = python-gtts
+ depends = python-gtts-token
+ depends = python-wordcloud
+ depends = python-telethon
+ depends = python-pillow
+ depends = python-magic
+ depends = python-pygments
+ depends = python-distlib
+ depends = speedtest-cli
+ depends = python-gitpython
+ depends = python-werkzeug
+ depends = python-wtforms
+ depends = python-cheroot
+ depends = python-flask
+ depends = python-flask-sqlalchemy
+ depends = python-flask-login
+ depends = python-flask-bcrypt
+ depends = python-flask-wtf
+ depends = python-cowpy
+ backup = etc/pagermaid.yml
+ source = pagermaid-modify::git+https://github.com/xtaodada/PagerMaid-Modify.git
+ source = pagermaid.service
+ source = 0000-change-default-config-path.patch
+ source = tmpfiles.d
+ source = sysusers.d
+ sha512sums = SKIP
+ sha512sums = 03f99135e4e78c50800550d1712a7b1b6eae6f859a5db9ad96fa4d96891cd4a623742bb2c128099ba629a6874bf287aecae16ec386e34a300fe0af8a722dcec1
+ sha512sums = 92a02af88966dbbddc02ed86c8220fb371b2432b44550ee616b18ba792163798b5496db3397c550ff2a810d53844f69c29a5bdb16b84f568e626dfefcb6ab3dc
+ sha512sums = 4da217a17f26738e4704886fd9a188132768945f222ba97184c02e32dfae10dbe3082ca40f1907e8ee53e8824169d175a5188b3b5c58b0bb7bbe2e626e76c847
+ sha512sums = 49f26a80155505aee7299778d850fdb9437dd2f064f720e46a92b53d4bfbb56cd13d3ddb0a6fb2890113c6a1c83e70a5369d0e35dffc1f71854e2a161faa2301
+
+pkgname = pagermaid-modify-git
+
diff --git a/0000-change-default-config-path.patch b/0000-change-default-config-path.patch
new file mode 100644
index 00000000000..73af81a1a55
--- /dev/null
+++ b/0000-change-default-config-path.patch
@@ -0,0 +1,17 @@
+diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py
+index a10a619..16d921b 100644
+--- a/pagermaid/__init__.py
++++ b/pagermaid/__init__.py
+@@ -24,10 +24,10 @@ logs.addHandler(logging_handler)
+ logs.setLevel(INFO)
+
+ try:
+- config = load(open(r"config.yml"), Loader=FullLoader)
++ config = load(open(r"/etc/pagermaid.yml"), Loader=FullLoader)
+ except FileNotFoundError:
+ logs.fatal("出错了呜呜呜 ~ 配置文件不存在,正在生成新的配置文件。")
+- copyfile(f"{module_dir}/assets/config.gen.yml", "config.yml")
++ copyfile(f"{module_dir}/assets/config.gen.yml", "/etc/pagermaid.yml")
+ exit(1)
+
+ if strtobool(config['debug']):
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..7996aee5b53
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,69 @@
+# Maintainer: NebulaNeko <chfsefefgesfen foxmail>
+
+_pkgname=pagermaid-modify
+pkgname=${_pkgname}-git
+pkgver=r51.f6b17bb
+pkgrel=1
+pkgdesc='A utility daemon for telegram.'
+arch=('any')
+url='https://github.com/xtaodada/PagerMaid-Modify'
+depends=('python-psutil' 'python-pyqrcode' 'python-pypng' 'pyzbar' 'python-emoji'
+ 'youtube-dl' 'python-pyaml' 'python-redis' 'python-coloredlogs'
+ 'python-requests' 'python-pytz' 'python-googletrans' 'python-beautifulsoup4'
+ 'python-gtts' 'python-gtts-token' 'python-wordcloud' 'python-telethon'
+ 'python-pillow' 'python-magic' 'python-pygments' 'python-distlib'
+ 'speedtest-cli' 'python-gitpython' 'python-werkzeug' 'python-wtforms'
+ 'python-cheroot' 'python-flask' 'python-flask-sqlalchemy' 'python-flask-login'
+ 'python-flask-bcrypt' 'python-flask-wtf' 'python-cowpy')
+backup=('etc/pagermaid.yml')
+makedepends=('python-setuptools')
+license=('GPL3')
+source=("${_pkgname}::git+https://github.com/xtaodada/PagerMaid-Modify.git"
+ "pagermaid.service"
+ "0000-change-default-config-path.patch"
+ "tmpfiles.d"
+ "sysusers.d")
+sha512sums=('SKIP'
+ '03f99135e4e78c50800550d1712a7b1b6eae6f859a5db9ad96fa4d96891cd4a623742bb2c128099ba629a6874bf287aecae16ec386e34a300fe0af8a722dcec1'
+ '92a02af88966dbbddc02ed86c8220fb371b2432b44550ee616b18ba792163798b5496db3397c550ff2a810d53844f69c29a5bdb16b84f568e626dfefcb6ab3dc'
+ '4da217a17f26738e4704886fd9a188132768945f222ba97184c02e32dfae10dbe3082ca40f1907e8ee53e8824169d175a5188b3b5c58b0bb7bbe2e626e76c847'
+ '49f26a80155505aee7299778d850fdb9437dd2f064f720e46a92b53d4bfbb56cd13d3ddb0a6fb2890113c6a1c83e70a5369d0e35dffc1f71854e2a161faa2301')
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$_pkgname"
+
+ patch -p1 -i ../0000-change-default-config-path.patch
+ find -type f -name '*py' -exec sed -e 's/distutils2/distutils/g' -i {} \;
+}
+
+build() {
+ cd "$_pkgname"
+ python setup.py build
+
+ cd ..
+ tee wrapper << EOF
+#!/bin/sh
+python -m pagermaid
+EOF
+}
+
+package() {
+ cd "$_pkgname"
+
+ echo > requirements.txt
+ cp some-plugins/* pagermaid/modules/
+ install -Dm644 config.gen.yml "$pkgdir/etc/pagermaid.yml"
+ python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
+
+ cd ..
+ install -Dm755 wrapper "$pkgdir/usr/bin/pagermaid"
+ install -Dm644 pagermaid.service "$pkgdir/usr/lib/systemd/system/pagermaid.service"
+
+ install -Dm644 tmpfiles.d "$pkgdir/usr/lib/tmpfiles.d/pagermaid.conf"
+ install -Dm644 sysusers.d "$pkgdir/usr/lib/sysusers.d/pagermaid.conf"
+}
diff --git a/pagermaid.service b/pagermaid.service
new file mode 100644
index 00000000000..cfecf989a3b
--- /dev/null
+++ b/pagermaid.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=PagerMaid-Modify telegram utility daemon
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+User=pagermaid
+Group=pagermaid
+WorkingDirectory=/var/lib/pagermaid
+ExecStart=/usr/bin/pagermaid
+Restart=always
diff --git a/sysusers.d b/sysusers.d
new file mode 100644
index 00000000000..0a716ed192c
--- /dev/null
+++ b/sysusers.d
@@ -0,0 +1 @@
+u pagermaid - - /var/lib/pagermaid
diff --git a/tmpfiles.d b/tmpfiles.d
new file mode 100644
index 00000000000..aed6a20cd2b
--- /dev/null
+++ b/tmpfiles.d
@@ -0,0 +1 @@
+d /var/lib/pagermaid 0755 pagermaid pagermaid