summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsdp2018-07-14 23:09:42 +0800
committerpsdp2018-07-14 23:14:28 +0800
commitcde53dfb0e12593e70c31353e0c5e721d6fb7d6a (patch)
tree62a30cc949ca4b79eed235df258fd94c2dc7f4c0
downloadaur-cde53dfb0e12593e70c31353e0c5e721d6fb7d6a.tar.gz
Python port of ShadowsocksR
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD40
-rw-r--r--shadowsocksr-server@.service11
-rw-r--r--shadowsocksr.install4
-rw-r--r--shadowsocksr@.service11
5 files changed, 95 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..6323757f776
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = shadowsocksr
+ pkgdesc = Python port of ShadowsocksR
+ pkgver = 3.2.2
+ pkgrel = 2
+ url = https://github.com/shadowsocksrr/shadowsocksr
+ install = shadowsocksr.install
+ arch = any
+ license = Apache
+ checkdepends = python-coverage
+ checkdepends = python-pyflakes
+ checkdepends = libsodium
+ checkdepends = python-nose
+ checkdepends = dante
+ checkdepends = procps-ng
+ checkdepends = util-linux
+ makedepends = git
+ depends = python
+ depends = python-setuptools
+ optdepends = libsodium: For salsa20 and chacha20 support
+ conflicts = shadowsocks
+ source = git+https://github.com/shadowsocksrr/shadowsocksr.git#tag=3.2.2
+ source = shadowsocksr@.service
+ source = shadowsocksr-server@.service
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+
+pkgname = shadowsocksr
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..4f951582652
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id$
+# Maintainer: psdp <psdp.dev@gmail.com>
+
+pkgname=shadowsocksr
+pkgver=3.2.2
+pkgrel=2
+pkgdesc="Python port of ShadowsocksR"
+license=('Apache')
+url="https://github.com/shadowsocksrr/shadowsocksr"
+arch=('any')
+depends=('python' 'python-setuptools')
+makedepends=('git')
+optdepends=('libsodium: For salsa20 and chacha20 support')
+checkdepends=('python-coverage' 'python-pyflakes' 'libsodium' 'python-nose' 'dante' 'procps-ng' 'util-linux')
+install=${pkgname}.install
+conflicts=('shadowsocks')
+source=("git+https://github.com/shadowsocksrr/shadowsocksr.git#tag=$pkgver"
+ "shadowsocksr@.service"
+ "shadowsocksr-server@.service")
+sha512sums=('SKIP'
+ 'SKIP'
+ 'SKIP')
+
+check() {
+ cd shadowsocksr
+ tests/jenkins.sh || warning "Tests failed"
+}
+
+package() {
+ cd shadowsocksr
+
+ python setup.py install -O1 --root="$pkgdir"
+
+ install -dm755 "$pkgdir/usr/share/man/man1"
+ install -m644 debian/{ssserver.1,sslocal.1} "$pkgdir/usr/share/man/man1"
+ install -Dm644 debian/config.json "$pkgdir/etc/shadowsocksr/config.json"
+
+ install -Dm644 "$srcdir/shadowsocksr@.service" "$pkgdir/usr/lib/systemd/system/shadowsocksr@.service"
+ install -Dm644 "$srcdir/shadowsocksr-server@.service" "$pkgdir/usr/lib/systemd/system/shadowsocksr-server@.service"
+}
diff --git a/shadowsocksr-server@.service b/shadowsocksr-server@.service
new file mode 100644
index 00000000000..fc7406fe860
--- /dev/null
+++ b/shadowsocksr-server@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=ShadowsocksR Server Service
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+ExecStart=/usr/bin/ssserver -c /etc/shadowsocksr/%i.json
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/shadowsocksr.install b/shadowsocksr.install
new file mode 100644
index 00000000000..27852db1787
--- /dev/null
+++ b/shadowsocksr.install
@@ -0,0 +1,4 @@
+post_install() {
+ echo "You can use profiled systemd units to start/stop shadowsocksr: (Profiles are placed under /etc/shadowsocksr/*.json)"
+ echo "# systemctl start/stop shadowsocksr[-server]@<conf-name>"
+} \ No newline at end of file
diff --git a/shadowsocksr@.service b/shadowsocksr@.service
new file mode 100644
index 00000000000..2c378b6a13f
--- /dev/null
+++ b/shadowsocksr@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=ShadowsocksR Client Service
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+ExecStart=/usr/bin/sslocal -c /etc/shadowsocksr/%i.json
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file