summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Song2016-04-11 21:40:29 +0800
committerRay Song2016-04-11 21:40:29 +0800
commit104458f69aae08a37c819e40d108bd0e3082feef (patch)
tree93016f38ae03d2c3b48003e5b720663c35341873
downloadaur-104458f69aae08a37c819e40d108bd0e3082feef.tar.gz
initial
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD29
-rw-r--r--install27
-rw-r--r--webqqircd.service10
4 files changed, 89 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b72ee3bd76b8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = webqqircd-git
+ pkgdesc = IRC server capable of controlling WebQQ (w.qq.com)
+ pkgver = r1.7e50702
+ pkgrel = 1
+ url = https://github.com/MaskRay/webqqircd
+ install = install
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ depends = python-aiohttp
+ optdepends = python-ipython: pretty error messages with the '-d' option
+ provides = webqqircd
+ conflicts = webqqircd
+ source = git+https://github.com/MaskRay/webqqircd.git
+ source = webqqircd.service
+ source = install
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = webqqircd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..03e46f5690f6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,29 @@
+# Maintainer: Ray Song <i at maskrayme dot me>
+
+pkgname=webqqircd-git
+_pkgname=webqqircd
+pkgver=r1.f8565e3
+pkgrel=1
+pkgdesc="IRC server capable of controlling WebQQ (w.qq.com)"
+arch=('i686' 'x86_64')
+url="https://github.com/MaskRay/webqqircd"
+license=('MIT')
+depends=('python-aiohttp')
+optdepends=("python-ipython: pretty error messages with the '-d' option")
+makedepends=('git')
+provides=('webqqircd')
+conflicts=('webqqircd')
+source=('git+https://github.com/MaskRay/webqqircd.git' webqqircd.service install)
+install=install
+md5sums=('SKIP' 'SKIP' 'SKIP')
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ install -D "$_pkgname/webqqircd.py" "$pkgdir/usr/bin/webqqircd"
+ install -Dm644 "$_pkgname/mq.js" -t "$pkgdir/usr/share/webqqircd/"
+ install -Dm644 webqqircd.service -t "$pkgdir/usr/lib/systemd/system/"
+}
diff --git a/install b/install
new file mode 100644
index 000000000000..5f061876a246
--- /dev/null
+++ b/install
@@ -0,0 +1,27 @@
+post_install() {
+ if [[ ! -f /etc/webqqircd/key.pem ]]; then
+ mkdir -p /etc/webqqircd
+ openssl req -x509 -newkey rsa:2048 -nodes -keyout /etc/webqqircd/key.pem -out /etc/webqqircd/cert.pem -subj '/CN=127.0.0.1' -days 9999
+ cat <<NOTE
+NOTE:
+1. Install URL redirection extension (Chrome: Switcheroo Redirector)
+2. Redirect http://pub.idqqimg.com/smartqq/js/mq.js to https://127.0.0.1:9002/mq.js
+3. Import /etc/webqqircd/cert.pem to your browser. Instructions for Chrome/Chromium are listed below:
+ a. Visit chrome://settings/certificates
+ b. Import /etc/webqqircd/cert.pem
+ c. 'Authorities' tab page -> 'Untrusted 127.0.0.1' -> 'Edit...' -> 'Trust this certificate for identifying websites.'
+
+Refer to https://github.com/MaskRay/webqqircd for details.
+NOTE
+ fi
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ echo Removing /etc/webqqircd/
+ rm /etc/webqqircd/{cert,key}.pem
+ rmdir /etc/webqqircd
+}
diff --git a/webqqircd.service b/webqqircd.service
new file mode 100644
index 000000000000..46b5360f919b
--- /dev/null
+++ b/webqqircd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=IRC server capable of controlling WebQQ
+Documentation=https://github.com/MaskRay/webqqircd
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/webqqircd --tls-key /etc/webqqircd/key.pem --tls-cert /etc/webqqircd/cert.pem --http-root /usr/share/webqqircd
+
+[Install]
+WantedBy=multi-user.target