Date: Saturday, December 13, 2014 @ 10:10:38 Author: fyan Revision: 123827
archrelease: copy trunk to community-any Added: goagent/repos/community-any/PKGBUILD (from rev 123826, goagent/trunk/PKGBUILD) goagent/repos/community-any/goagent.install (from rev 123826, goagent/trunk/goagent.install) goagent/repos/community-any/goagent.service (from rev 123826, goagent/trunk/goagent.service) goagent/repos/community-any/goagent.user.ini (from rev 123826, goagent/trunk/goagent.user.ini) goagent/repos/community-any/sslwrap-python-2.7.9.patch (from rev 123826, goagent/trunk/sslwrap-python-2.7.9.patch) Deleted: goagent/repos/community-any/PKGBUILD goagent/repos/community-any/goagent.install goagent/repos/community-any/goagent.service goagent/repos/community-any/goagent.user.ini ----------------------------+ PKGBUILD | 128 ++++++++++++++++++++++--------------------- goagent.install | 42 +++++++------- goagent.service | 24 ++++---- sslwrap-python-2.7.9.patch | 47 +++++++++++++++ 4 files changed, 146 insertions(+), 95 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2014-12-13 09:09:54 UTC (rev 123826) +++ PKGBUILD 2014-12-13 09:10:38 UTC (rev 123827) @@ -1,62 +0,0 @@ -# $Id$ -# Maintainer: Felix Yan <felixonm...@gmail.com> -# Contributor: cuihao <cuihao dot leo at gmail dot com> -# Contributor: Guten <ywzhai...@gmail.com> - -pkgname=goagent -pkgver=3.2.3 -#_commit=d911497475c516405dde59a968cd506424326b55 -pkgrel=1 -pkgdesc="A gae proxy forked from gappproxy/wallproxy" -arch=("any") -url="http://goagent.googlecode.com" -license=("GPL2") -depends=('python2' 'python2-pyopenssl' 'python2-gevent' 'python2-dnslib') -optdepends=('python2-crypto: Optimization for RC4' - 'python2-pygeoip: for GAE Regions mode support & DNS region auto detect') -makedepends=('git') -source=("git+https://github.com/goagent/goagent.git#tag=v$pkgver" -#source=("git+https://github.com/goagent/goagent.git#commit=$_commit" - "${pkgname}.user.ini" - "${pkgname}.service") -backup=('etc/goagent') -install=goagent.install - -prepare() { - cd $pkgname - - sed -e "s|^#!/usr/bin/env python|#!/usr/bin/env python2|" \ - -i local/{proxy.py,dnsproxy.py} - sed -e 's|^ self.geoip = .*$| self.geoip = pygeoip.GeoIP("/usr/share/GeoIP/GeoIP.dat")|' \ - -e "s|os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cacert.pem')|'/etc/ssl/certs/ca-certificates.crt'|" \ - -i local/proxylib.py - sed -e 's|^.*google_appengine.zip.*$||' \ - -e 's|sys\.modules\.pop(.google., None)||' \ - -i server/uploader.py -} - -package() { - cd $pkgname - - install -Dm755 local/proxy.py "$pkgdir/usr/share/$pkgname/local/goagent" - install -Dm755 local/dnsproxy.py "$pkgdir/usr/share/$pkgname/local/dnsproxy.py" - install -Dm644 local/proxylib.py "$pkgdir/usr/share/$pkgname/local/proxylib.py" - install -Dm644 local/proxy.pac "$pkgdir/usr/share/$pkgname/local/proxy.pac" - install -Dm644 local/SwitchyOptions.bak "$pkgdir/usr/share/$pkgname/local/SwitchyOptions.bak" - install -Dm644 local/SwitchySharp.crx "$pkgdir/usr/share/$pkgname/local/SwitchySharp_1_9_52.crx" - - install -Dm644 local/proxy.ini "$pkgdir/usr/share/$pkgname/local/goagent.ini" - install -Dm640 -g nobody ../goagent.user.ini "$pkgdir/etc/goagent" - ln -sf "/etc/goagent" "${pkgdir}/usr/share/$pkgname/local/goagent.user.ini" - - cp -r server "$pkgdir/usr/share/$pkgname/" - rm "$pkgdir/usr/share/$pkgname/server/"{uploader.bat,google_appengine.zip} - - # systemd service - install -Dm644 "${srcdir}/goagent.service" "${pkgdir}/usr/lib/systemd/system/goagent.service" -} - -# vim:set ts=2 sw=2 et: -sha512sums=('SKIP' - 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e' - '4327d5b874c5150296f9c027a60994853de1b68d4c4e32291a5c41c0e162ffbccf68b6208cbc096d099721b470e1df897ad61596d8ddd705543c15b58e9a0f7c') Copied: goagent/repos/community-any/PKGBUILD (from rev 123826, goagent/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2014-12-13 09:10:38 UTC (rev 123827) @@ -0,0 +1,66 @@ +# $Id$ +# Maintainer: Felix Yan <felixonm...@gmail.com> +# Contributor: cuihao <cuihao dot leo at gmail dot com> +# Contributor: Guten <ywzhai...@gmail.com> + +pkgname=goagent +pkgver=3.2.3 +#_commit=d911497475c516405dde59a968cd506424326b55 +pkgrel=2 +pkgdesc="A gae proxy forked from gappproxy/wallproxy" +arch=("any") +url="http://goagent.googlecode.com" +license=("GPL2") +depends=('python2' 'python2-pyopenssl' 'python2-gevent' 'python2-dnslib') +optdepends=('python2-crypto: Optimization for RC4' + 'python2-pygeoip: for GAE Regions mode support & DNS region auto detect') +makedepends=('git') +source=("git+https://github.com/goagent/goagent.git#tag=v$pkgver" +#source=("git+https://github.com/goagent/goagent.git#commit=$_commit" + "${pkgname}.user.ini" + "${pkgname}.service" + sslwrap-python-2.7.9.patch) +backup=('etc/goagent') +install=goagent.install +sha512sums=('SKIP' + 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e' + '4327d5b874c5150296f9c027a60994853de1b68d4c4e32291a5c41c0e162ffbccf68b6208cbc096d099721b470e1df897ad61596d8ddd705543c15b58e9a0f7c' + 'c999f2c3de574a2826b2ae51a0469c0a070e2f7177a86c70a21304fadede999342d1b01f5925a8785fa56f0745154734df65cb929b00bd5f9066f85c3d300354') + +prepare() { + cd $pkgname + + patch -p1 -i ../sslwrap-python-2.7.9.patch + + sed -e "s|^#!/usr/bin/env python|#!/usr/bin/env python2|" \ + -i local/{proxy.py,dnsproxy.py} + sed -e 's|^ self.geoip = .*$| self.geoip = pygeoip.GeoIP("/usr/share/GeoIP/GeoIP.dat")|' \ + -e "s|os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cacert.pem')|'/etc/ssl/certs/ca-certificates.crt'|" \ + -i local/proxylib.py + sed -e 's|^.*google_appengine.zip.*$||' \ + -e 's|sys\.modules\.pop(.google., None)||' \ + -i server/uploader.py +} + +package() { + cd $pkgname + + install -Dm755 local/proxy.py "$pkgdir/usr/share/$pkgname/local/goagent" + install -Dm755 local/dnsproxy.py "$pkgdir/usr/share/$pkgname/local/dnsproxy.py" + install -Dm644 local/proxylib.py "$pkgdir/usr/share/$pkgname/local/proxylib.py" + install -Dm644 local/proxy.pac "$pkgdir/usr/share/$pkgname/local/proxy.pac" + install -Dm644 local/SwitchyOptions.bak "$pkgdir/usr/share/$pkgname/local/SwitchyOptions.bak" + install -Dm644 local/SwitchySharp.crx "$pkgdir/usr/share/$pkgname/local/SwitchySharp_1_9_52.crx" + + install -Dm644 local/proxy.ini "$pkgdir/usr/share/$pkgname/local/goagent.ini" + install -Dm640 -g nobody ../goagent.user.ini "$pkgdir/etc/goagent" + ln -sf "/etc/goagent" "${pkgdir}/usr/share/$pkgname/local/goagent.user.ini" + + cp -r server "$pkgdir/usr/share/$pkgname/" + rm "$pkgdir/usr/share/$pkgname/server/"{uploader.bat,google_appengine.zip} + + # systemd service + install -Dm644 "${srcdir}/goagent.service" "${pkgdir}/usr/lib/systemd/system/goagent.service" +} + +# vim:set ts=2 sw=2 et: Deleted: goagent.install =================================================================== --- goagent.install 2014-12-13 09:09:54 UTC (rev 123826) +++ goagent.install 2014-12-13 09:10:38 UTC (rev 123827) @@ -1,21 +0,0 @@ -post_install() { - echo "Since 3.1.2-2, /etc/goagent becomes user configuration for goagent. Put any customization there, not the default settings. For details, please refer to wiki: https://wiki.archlinux.org/index.php?title=GoAgent_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)" - - #cd /opt/goagent/local - #python2 -c 'from proxy import CertUtil; CertUtil.check_ca()' - chown -R nobody:daemon /usr/share/goagent/local -} - -post_upgrade() { - post_install -} - -pre_upgrade() { - # Disable certs cleaning until some more issue detected - #rm -rf /usr/share/goagent/local/certs - : -} - -pre_remove() { - rm -rf /usr/share/goagent/local/certs -} Copied: goagent/repos/community-any/goagent.install (from rev 123826, goagent/trunk/goagent.install) =================================================================== --- goagent.install (rev 0) +++ goagent.install 2014-12-13 09:10:38 UTC (rev 123827) @@ -0,0 +1,21 @@ +post_install() { + echo "Since 3.1.2-2, /etc/goagent becomes user configuration for goagent. Put any customization there, not the default settings. For details, please refer to wiki: https://wiki.archlinux.org/index.php?title=GoAgent_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)" + + #cd /opt/goagent/local + #python2 -c 'from proxy import CertUtil; CertUtil.check_ca()' + chown -R nobody:daemon /usr/share/goagent/local +} + +post_upgrade() { + post_install +} + +pre_upgrade() { + # Disable certs cleaning until some more issue detected + #rm -rf /usr/share/goagent/local/certs + : +} + +pre_remove() { + rm -rf /usr/share/goagent/local/certs +} Deleted: goagent.service =================================================================== --- goagent.service 2014-12-13 09:09:54 UTC (rev 123826) +++ goagent.service 2014-12-13 09:10:38 UTC (rev 123827) @@ -1,12 +0,0 @@ -[Unit] -Description=GoAgent Service -After=network.target - -[Service] -Type=simple -User=nobody -ExecStart=/usr/share/goagent/local/goagent - -[Install] -WantedBy=multi-user.target - Copied: goagent/repos/community-any/goagent.service (from rev 123826, goagent/trunk/goagent.service) =================================================================== --- goagent.service (rev 0) +++ goagent.service 2014-12-13 09:10:38 UTC (rev 123827) @@ -0,0 +1,12 @@ +[Unit] +Description=GoAgent Service +After=network.target + +[Service] +Type=simple +User=nobody +ExecStart=/usr/share/goagent/local/goagent + +[Install] +WantedBy=multi-user.target + Deleted: goagent.user.ini =================================================================== Copied: goagent/repos/community-any/goagent.user.ini (from rev 123826, goagent/trunk/goagent.user.ini) =================================================================== Copied: goagent/repos/community-any/sslwrap-python-2.7.9.patch (from rev 123826, goagent/trunk/sslwrap-python-2.7.9.patch) =================================================================== --- sslwrap-python-2.7.9.patch (rev 0) +++ sslwrap-python-2.7.9.patch 2014-12-13 09:10:38 UTC (rev 123827) @@ -0,0 +1,47 @@ +From 0a050807191e0aaff09160256d254a7368b8892e Mon Sep 17 00:00:00 2001 +From: Felix Yan <felixonm...@gmail.com> +Date: Sat, 13 Dec 2014 16:24:15 +0800 +Subject: [PATCH] Re-add sslwrap to workaround gevent on Python 2.7.9 + +--- + local/proxylib.py | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/local/proxylib.py b/local/proxylib.py +index 73e032e..ebaf067 100644 +--- a/local/proxylib.py ++++ b/local/proxylib.py +@@ -40,6 +40,33 @@ + gevent = sys.modules.get('gevent') or logging.warn('please enable gevent.') + + ++# Re-add sslwrap to Python 2.7.9 ++import inspect ++__ssl__ = __import__('ssl') ++ ++try: ++ _ssl = __ssl__._ssl ++except AttributeError: ++ _ssl = __ssl__._ssl2 ++ ++ ++def new_sslwrap(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=__ssl__.CERT_NONE, ssl_version=__ssl__.PROTOCOL_SSLv23, ca_certs=None, ciphers=None): ++ context = __ssl__.SSLContext(ssl_version) ++ context.verify_mode = cert_reqs or __ssl__.CERT_NONE ++ if ca_certs: ++ context.load_verify_locations(ca_certs) ++ if certfile: ++ context.load_cert_chain(certfile, keyfile) ++ if ciphers: ++ context.set_ciphers(ciphers) ++ ++ caller_self = inspect.currentframe().f_back.f_locals['self'] ++ return context._wrap_socket(sock, server_side=server_side, ssl_sock=caller_self) ++ ++if not hasattr(_ssl, 'sslwrap'): ++ _ssl.sslwrap = new_sslwrap ++ ++ + try: + from Crypto.Cipher.ARC4 import new as RC4Cipher + except ImportError: