summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormaniacata2020-04-05 00:38:10 +0800
committermaniacata2020-04-05 00:38:10 +0800
commite9a97e1a3c17d27739d2da0a9827d09fe3f407f8 (patch)
treeb2bd2fcad3cae8b4686fa2d10981a3291e47ba7d
downloadaur-e9a97e1a3c17d27739d2da0a9827d09fe3f407f8.tar.gz
initial commit.
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD39
-rw-r--r--clashr.install44
-rw-r--r--clashr@.service12
-rw-r--r--clashr_user.service11
6 files changed, 131 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d231c3b84a1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = clashr-bin
+ pkgdesc = A rule based proxy in Go with SSR protocol support.
+ pkgver = 0.19.0.1
+ pkgrel = 1
+ url = https://github.com/frainzy1477/clashrdev
+ install = clashr.install
+ arch = x86_64
+ license = MIT
+ depends = glibc
+ provides = clashr
+ conflicts = clashr
+ noextract = clashr-0.19.0.1.gz
+ source = clashr@.service
+ source = clashr_user.service
+ source = clashr-0.19.0.1.gz::https://github.com/frainzy1477/clashrdev/releases/download/v0.19.0.1/clashr-linux-amd64-v0.19.0.1.gz
+ sha256sums = 7aa265e329a54c9a1c86464a0a4567d332f04de3a618a85b71934d04e0210343
+ sha256sums = ea8c4bfb4291e0fa6442644a233e168302c186ef36a39ef56fc75989b56213d9
+ sha256sums = 676ea1e3743f800eed59317ef281c28c23f8017c97a11c833ee2aaa91fd608f7
+
+pkgname = clashr-bin
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..c570ac55a03
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.tar.xz
+*.gz
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..9b7416e046a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: maniacata <maniaciachao at gmail dot com>
+# Contributor: sdvcrx <memory.silentvoyage at gmail dot com>
+
+pkgname=clashr-bin
+_pkgname=clashr
+pkgver=0.19.0.1
+pkgrel=1
+pkgdesc="A rule based proxy in Go with SSR protocol support."
+url="https://github.com/frainzy1477/clashrdev"
+license=("MIT")
+arch=("x86_64")
+provides=("clashr")
+conflicts=("clashr")
+depends=("glibc")
+source=(clashr@.service
+ clashr_user.service
+ "$_pkgname-$pkgver.gz::${url}/releases/download/v${pkgver}/clashr-linux-amd64-v${pkgver}.gz")
+noextract=("$_pkgname-$pkgver.gz")
+sha256sums=(
+ "7aa265e329a54c9a1c86464a0a4567d332f04de3a618a85b71934d04e0210343"
+ "ea8c4bfb4291e0fa6442644a233e168302c186ef36a39ef56fc75989b56213d9"
+ "676ea1e3743f800eed59317ef281c28c23f8017c97a11c833ee2aaa91fd608f7"
+)
+
+install=$_pkgname.install
+
+prepare() {
+ cd "${srcdir}/"
+ gunzip -k -f "$_pkgname-$pkgver.gz"
+}
+
+package() {
+ cd "${srcdir}/"
+
+ install -Dm755 "$_pkgname-$pkgver" "${pkgdir}/usr/bin/${_pkgname}"
+ install -Dm644 clashr@.service ${pkgdir}/usr/lib/systemd/system/clashr@.service
+ install -Dm644 clashr_user.service ${pkgdir}/usr/lib/systemd/user/clashr.service
+}
+
diff --git a/clashr.install b/clashr.install
new file mode 100644
index 00000000000..9850e21d02e
--- /dev/null
+++ b/clashr.install
@@ -0,0 +1,44 @@
+# Thanks aur#cow-proxy
+post_install() {
+ post_upgrade
+}
+
+post_upgrade() {
+
+ cat << EOF
+ Configuration document can be found at :
+
+ https://github.com/Dreamacro/clash
+ https://github.com/frainzy1477/clashrdev
+
+ Running clashr system instance for user account:
+
+ To reload system systemd modules, execute
+
+ systemctl daemon-reload
+
+ To start clashr, execute:
+
+ systemctl start clashr@user
+
+ To autostart clashr on system start, execute
+
+ systemctl enable clashr@user
+
+ Running clashr user instance (will used current user account):
+
+ To reload user systemd modules, execute
+
+ systemctl --user daemon-reload
+
+ To start clashr manually, execute:
+
+ systemctl --user start clashr
+
+ To autostart clashr on user login, execute
+
+ systemctl --user enable clashr
+
+EOF
+
+}
diff --git a/clashr@.service b/clashr@.service
new file mode 100644
index 00000000000..48fc9d08a7d
--- /dev/null
+++ b/clashr@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=A rule based proxy in Go with SSR protocol support for %i.
+After=network.target
+
+[Service]
+Type=simple
+User=%i
+Restart=on-abort
+ExecStart=/usr/bin/clashr
+
+[Install]
+WantedBy=multi-user.target
diff --git a/clashr_user.service b/clashr_user.service
new file mode 100644
index 00000000000..224b3498e80
--- /dev/null
+++ b/clashr_user.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=A rule based proxy in Go with SSR protocol support.
+After=network.target
+
+[Service]
+Type=simple
+Restart=on-abort
+ExecStart=/usr/bin/clashr
+
+[Install]
+WantedBy=default.target