[arch-commits] Commit in shadowsocks/repos (6 files)

Felix Yan felixonmars at archlinux.org
Mon Nov 4 08:26:40 UTC 2019


    Date: Monday, November 4, 2019 @ 08:26:39
  Author: felixonmars
Revision: 523737

archrelease: copy trunk to community-staging-any

Added:
  shadowsocks/repos/community-staging-any/
  shadowsocks/repos/community-staging-any/PKGBUILD
    (from rev 523734, shadowsocks/trunk/PKGBUILD)
  shadowsocks/repos/community-staging-any/pycodestyle.patch
    (from rev 523734, shadowsocks/trunk/pycodestyle.patch)
  shadowsocks/repos/community-staging-any/shadowsocks-server at .service
    (from rev 523734, shadowsocks/trunk/shadowsocks-server at .service)
  shadowsocks/repos/community-staging-any/shadowsocks.install
    (from rev 523734, shadowsocks/trunk/shadowsocks.install)
  shadowsocks/repos/community-staging-any/shadowsocks at .service
    (from rev 523734, shadowsocks/trunk/shadowsocks at .service)

-----------------------------+
 PKGBUILD                    |   58 +++++++++++++++++++++++++++++++++++++++
 pycodestyle.patch           |   62 ++++++++++++++++++++++++++++++++++++++++++
 shadowsocks-server at .service |   12 ++++++++
 shadowsocks.install         |    5 +++
 shadowsocks at .service        |   12 ++++++++
 5 files changed, 149 insertions(+)

Copied: shadowsocks/repos/community-staging-any/PKGBUILD (from rev 523734, shadowsocks/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2019-11-04 08:26:39 UTC (rev 523737)
@@ -0,0 +1,58 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=shadowsocks
+pkgver=3.0.0a.20180219
+_commit=e332ec93e9c90f1cbee676b022bf2c5d5b7b1239
+pkgrel=2
+pkgdesc="A lightweight tunnel proxy"
+license=('Apache')
+url="https://pypi.python.org/pypi/shadowsocks"
+arch=('any')
+depends=('python-setuptools')
+makedepends=('git')
+optdepends=('libsodium: For salsa20 and chacha20 support'
+            'mbedtls: Optional mbedtls modes')
+checkdepends=('bc' 'bind-tools' 'dante' 'libsodium' 'mbedtls' 'procps-ng' 'python-coverage' 'python-nose'
+              'python-pycodestyle' 'python-pyflakes' 'python-pysocks')
+install=$pkgname.install
+source=("$pkgname-$pkgver.tar.gz::https://github.com/shadowsocks/shadowsocks/archive/$_commit.tar.gz"
+        pycodestyle.patch
+        "shadowsocks at .service"
+        "shadowsocks-server at .service")
+sha512sums=('d3370cedffed385ad9cf1e0390edb535d2d7f949fc79b77875a78cac5bad7b601a5605063e130416a7871a0b7798d4c088c08b2d472570a6429f59d38091e5a7'
+            '89d8d984d9f1c20c020e619b8c22315737e1f53e42caf41643232997b7862b92bc3295985b7ddc4a3f3e0c29d962c2f1ee97b8dd6409be82cb93c09d5df1f7ff'
+            '96ecb174a476f64dec3ec086732d93a76d27e9a1cc56b1dc3fa87bf8e00d4b3c44076a01a0d525e42174cacc58fd5c16d5c8af5d4636dae13df549dec8204f7d'
+            'f2f8240c18a4483bf3e03b3a5ac8822c3deae713224f732bf28f7fddfcc5d0b02aa91652665ff93f05731e162a9407109c18f43d732a3a9b19d9eacfc806a4df')
+
+prepare() {
+  mv shadowsocks-{$_commit,$pkgver}
+
+  cd shadowsocks-$pkgver
+  patch -p1 -i ../pycodestyle.patch
+}
+
+check() {
+  cd shadowsocks-$pkgver
+  export SOCKS_CONF=tests/socksify/socks.conf
+
+  # No local http server running, point to a random site
+  sed -i "s|default_url = 'http://localhost/'|default_url = 'https://www.gstatic.com/generate_204'|" tests/test.py
+  sed -i 's|http://127.0.0.1/|https://www.gstatic.com/generate_204|' tests/jenkins.sh
+
+  sed -i 's|/usr/local/lib/|/usr/lib/|g' tests/jenkins.sh tests/*.json
+
+  tests/jenkins.sh || warning "Tests failed"
+}
+
+package() {
+  cd shadowsocks-$pkgver
+
+  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/shadowsocks/example.json
+
+  install -Dm644 "$srcdir"/shadowsocks at .service "$pkgdir"/usr/lib/systemd/system/shadowsocks at .service
+  install -Dm644 "$srcdir"/shadowsocks-server at .service "$pkgdir"/usr/lib/systemd/system/shadowsocks-server at .service
+}
\ No newline at end of file

Copied: shadowsocks/repos/community-staging-any/pycodestyle.patch (from rev 523734, shadowsocks/trunk/pycodestyle.patch)
===================================================================
--- community-staging-any/pycodestyle.patch	                        (rev 0)
+++ community-staging-any/pycodestyle.patch	2019-11-04 08:26:39 UTC (rev 523737)
@@ -0,0 +1,62 @@
+commit 0225b05029493d477bde6391f3b0108519783a2e
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Tue Nov 13 02:50:07 2018 +0800
+
+    Use pycodestyle instead of pep8
+
+diff --git a/.travis.yml b/.travis.yml
+index f11e179..cb02428 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -13,7 +13,7 @@ before_install:
+   - sudo dd if=/dev/urandom of=/usr/share/nginx/html/file bs=1M count=10
+   - sudo sh -c "echo '127.0.0.1    localhost' > /etc/hosts"
+   - sudo service nginx restart
+-  - pip install pep8 pyflakes nose coverage PySocks
++  - pip install pycodestyle pyflakes nose coverage PySocks
+   - sudo tests/socksify/install.sh
+   - sudo tests/libsodium/install.sh
+   - sudo tests/libmbedtls/install.sh
+diff --git a/shadowsocks/common.py b/shadowsocks/common.py
+index 1a58457..840608f 100644
+--- a/shadowsocks/common.py
++++ b/shadowsocks/common.py
+@@ -185,8 +185,8 @@ def parse_header(data):
+             addrlen = ord(data[1])
+             if len(data) >= 4 + addrlen:
+                 dest_addr = data[2:2 + addrlen]
+-                dest_port = struct.unpack('>H', data[2 + addrlen:4 +
+-                                                     addrlen])[0]
++                dest_port = struct.unpack('>H', data[2 + addrlen:
++                                                     4 + addrlen])[0]
+                 header_length = 4 + addrlen
+             else:
+                 logging.warn('header is too short')
+diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py
+index 0ef913f..423cc80 100644
+--- a/shadowsocks/tcprelay.py
++++ b/shadowsocks/tcprelay.py
+@@ -519,8 +519,8 @@ class TCPRelayHandler(object):
+         socks_version = common.ord(data[0])
+         nmethods = common.ord(data[1])
+         if socks_version != 5:
+-            logging.warning('unsupported SOCKS protocol version ' +
+-                            str(socks_version))
++            logging.warning('unsupported SOCKS protocol version {}'
++                            .format(socks_version))
+             raise BadSocksHeader
+         if nmethods < 1 or len(data) != nmethods + 2:
+             logging.warning('NMETHODS and number of METHODS mismatch')
+diff --git a/tests/jenkins.sh b/tests/jenkins.sh
+index 85dd01a..4288336 100755
+--- a/tests/jenkins.sh
++++ b/tests/jenkins.sh
+@@ -27,7 +27,7 @@ function run_test {
+ python --version
+ coverage erase
+ mkdir tmp
+-run_test pep8 --ignore=E402 .
++run_test pycodestyle --ignore=E402,E305,E741 .
+ run_test pyflakes .
+ run_test coverage run tests/nose_plugin.py -v
+ run_test python setup.py sdist

Copied: shadowsocks/repos/community-staging-any/shadowsocks-server at .service (from rev 523734, shadowsocks/trunk/shadowsocks-server at .service)
===================================================================
--- community-staging-any/shadowsocks-server at .service	                        (rev 0)
+++ community-staging-any/shadowsocks-server at .service	2019-11-04 08:26:39 UTC (rev 523737)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Shadowsocks Server Service
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+ExecStart=/usr/bin/ssserver -c /etc/shadowsocks/%i.json
+
+[Install]
+WantedBy=multi-user.target
+

Copied: shadowsocks/repos/community-staging-any/shadowsocks.install (from rev 523734, shadowsocks/trunk/shadowsocks.install)
===================================================================
--- community-staging-any/shadowsocks.install	                        (rev 0)
+++ community-staging-any/shadowsocks.install	2019-11-04 08:26:39 UTC (rev 523737)
@@ -0,0 +1,5 @@
+post_install() {
+    echo "You can use profiled systemd units to start/stop shadowsocks: (Profiles are placed under /etc/shadowsocks/*.json)"
+    echo "# systemctl start/stop shadowsocks[-server]@<conf-name>"
+}
+

Copied: shadowsocks/repos/community-staging-any/shadowsocks at .service (from rev 523734, shadowsocks/trunk/shadowsocks at .service)
===================================================================
--- community-staging-any/shadowsocks at .service	                        (rev 0)
+++ community-staging-any/shadowsocks at .service	2019-11-04 08:26:39 UTC (rev 523737)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Shadowsocks Client Service
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/%i.json
+
+[Install]
+WantedBy=multi-user.target
+



More information about the arch-commits mailing list