aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2018-12-08 09:24:43 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2018-12-08 09:24:43 +0000
commitd0211e63074b56f7317c72638625f76aec1bea87 (patch)
tree069acb4e07ba95f57d71eafc7d384cac50a3fc90
parent8bff768904e3be44253b081c93137a2d29b27e8e (diff)
downloadports-d0211e63074b56f7317c72638625f76aec1bea87.tar.gz
ports-d0211e63074b56f7317c72638625f76aec1bea87.zip
Notes
-rw-r--r--net/Makefile1
-rw-r--r--net/clash/Makefile49
-rw-r--r--net/clash/distinfo37
-rw-r--r--net/clash/files/patch-proxy_redir_tcp__freebsd.go12
-rw-r--r--net/clash/pkg-descr8
5 files changed, 107 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index d471d1a1a86a..0972b01d1c41 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -81,6 +81,7 @@
SUBDIR += chrony
SUBDIR += citrix_ica
SUBDIR += cjdns
+ SUBDIR += clash
SUBDIR += cloud-init
SUBDIR += cloud-init-azure
SUBDIR += clusterit
diff --git a/net/clash/Makefile b/net/clash/Makefile
new file mode 100644
index 000000000000..9742b7f9bde2
--- /dev/null
+++ b/net/clash/Makefile
@@ -0,0 +1,49 @@
+# $FreeBSD$
+
+PORTNAME= clash
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.10.1
+CATEGORIES= net
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Rule-based tunnel on Go
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= go:lang/go
+
+USE_GITHUB= yes
+GH_ACCOUNT= Dreamacro
+GH_SUBDIR= src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME}
+GH_TUPLE= aead:chacha20:8b13a72:chacha20/src/github.com/aead/chacha20 \
+ eapache:channels:v1.1.0:channels/src/gopkg.in/eapache/channels.v1 \
+ eapache:queue:v1.1.0:queue/src/github.com/eapache/queue \
+ Dreamacro:go-shadowsocks2:v0.1.2:shadowsocks/src/github.com/Dreamacro/go-shadowsocks2 \
+ go-chi:chi:v3.3.3:chi/src/github.com/go-chi/chi \
+ go-chi:cors:07727c8:cors/src/github.com/go-chi/cors \
+ go-chi:render:v1.0.1:render/src/github.com/go-chi/render \
+ go-yaml:yaml:v2.2.1:yaml/src/gopkg.in/yaml.v2 \
+ gofrs:uuid:v3.1.2:uuid/src/github.com/gofrs/uuid \
+ gorilla:websocket:v1.4.0:websocket/src/github.com/gorilla/websocket \
+ miekg:dns:v1.1.1:dns/src/github.com/miekg/dns \
+ oschwald:geoip2-golang:v1.2.1:geoip2_golang/src/github.com/oschwald/geoip2-golang \
+ oschwald:maxminddb-golang:v1.3.0:maxminddb_golang/src/github.com/oschwald/maxminddb-golang \
+ sirupsen:logrus:v1.2.0:logrus/src/github.com/sirupsen/logrus \
+ stretchr:testify:v1.2.2:testify/src/github.com/stretchr/testify \
+ golang:crypto:505ab14:golang_crypto/src/golang.org/x/crypto \
+ golang:sys:70b957f:golang_sys/src/golang.org/x/sys
+
+PLIST_FILES= bin/${PORTNAME}
+
+pre-patch:
+ @cd ${WRKSRC} && ${CP} proxy/redir/tcp_linux.go proxy/redir/tcp_freebsd.go
+
+do-build:
+ @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT} && \
+ ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/net/clash/distinfo b/net/clash/distinfo
new file mode 100644
index 000000000000..7646b79bbff6
--- /dev/null
+++ b/net/clash/distinfo
@@ -0,0 +1,37 @@
+TIMESTAMP = 1544248333
+SHA256 (Dreamacro-clash-v0.10.1_GH0.tar.gz) = bb01aad892c768e0f4d52c8a0fa46a86f3608300e3700d81f803991683de79a6
+SIZE (Dreamacro-clash-v0.10.1_GH0.tar.gz) = 58383
+SHA256 (Dreamacro-go-shadowsocks2-v0.1.2_GH0.tar.gz) = 7c6dde7acdd7c4a460da218467a4be6a83ceb4788609d9f306a1cee5dd604dca
+SIZE (Dreamacro-go-shadowsocks2-v0.1.2_GH0.tar.gz) = 19686
+SHA256 (go-chi-chi-v3.3.3_GH0.tar.gz) = 9c0ee069a5a05cd08ce337c3cef43b4a8ba77f9cd119a841b3238bf7820a4c7d
+SIZE (go-chi-chi-v3.3.3_GH0.tar.gz) = 67041
+SHA256 (go-chi-cors-07727c8_GH0.tar.gz) = d36901cda54dd581eee79a2d2af1d370305c407659973e2bfa6187a2ea6c76a6
+SIZE (go-chi-cors-07727c8_GH0.tar.gz) = 6087
+SHA256 (go-chi-render-v1.0.1_GH0.tar.gz) = b7ee66207e869baa271f104d084a38d3d89bb3ebaea1d89169ca26303446422d
+SIZE (go-chi-render-v1.0.1_GH0.tar.gz) = 5571
+SHA256 (gofrs-uuid-v3.1.2_GH0.tar.gz) = 10c26a0a696a3a71e4b8683aeeb23c32d815e5725c2845bb9eeac8e77afdc299
+SIZE (gofrs-uuid-v3.1.2_GH0.tar.gz) = 16858
+SHA256 (gorilla-websocket-v1.4.0_GH0.tar.gz) = 2b5743c72bd0930c5a80e49c0138b5b7d27fa7c085efd0c86805cccfa7220c9d
+SIZE (gorilla-websocket-v1.4.0_GH0.tar.gz) = 50228
+SHA256 (miekg-dns-v1.1.1_GH0.tar.gz) = 38b31613c6e92a56767755284c214cd575a14dc2b551eca4561c45c43c74420a
+SIZE (miekg-dns-v1.1.1_GH0.tar.gz) = 3880802
+SHA256 (oschwald-geoip2-golang-v1.2.1_GH0.tar.gz) = ede4f007b09cde767b58042ab712415fbbb7031cc9c35612b2917712e7f84c3a
+SIZE (oschwald-geoip2-golang-v1.2.1_GH0.tar.gz) = 6179
+SHA256 (oschwald-maxminddb-golang-v1.3.0_GH0.tar.gz) = 176a45e9ebfe67d0cf3fa647778857dd2bc96bf112e39f31ce158b0437d6db05
+SIZE (oschwald-maxminddb-golang-v1.3.0_GH0.tar.gz) = 17984
+SHA256 (sirupsen-logrus-v1.2.0_GH0.tar.gz) = 679aa05d23ca81b74f1327e7a25267a322dc9fd807a276e73e781f62ee679c6d
+SIZE (sirupsen-logrus-v1.2.0_GH0.tar.gz) = 37794
+SHA256 (eapache-channels-v1.1.0_GH0.tar.gz) = 443b9361ff7db635b830e84d8eb0830477083efba53fb0c531af04e07cde3a59
+SIZE (eapache-channels-v1.1.0_GH0.tar.gz) = 11705
+SHA256 (eapache-queue-v1.1.0_GH0.tar.gz) = 2be4716ba2bba5f7c125a8fe72ba534f02cf0d7d98d3a372d4ebe54b170f7329
+SIZE (eapache-queue-v1.1.0_GH0.tar.gz) = 3502
+SHA256 (go-yaml-yaml-v2.2.1_GH0.tar.gz) = 33218aa3bd60a307fe14e66b970473cb411bb6ca3d4f4a5e30c97b44f9b4e84b
+SIZE (go-yaml-yaml-v2.2.1_GH0.tar.gz) = 70217
+SHA256 (stretchr-testify-v1.2.2_GH0.tar.gz) = 0728bb470254e8b39deae3e6c1c92a98e737239ae0be484188fb9083250adf5f
+SIZE (stretchr-testify-v1.2.2_GH0.tar.gz) = 101698
+SHA256 (aead-chacha20-8b13a72_GH0.tar.gz) = 3ec002c64dc2e6f9c4e3fd06021d16f6834ad011b55fe78375a8689bd8d41344
+SIZE (aead-chacha20-8b13a72_GH0.tar.gz) = 21592
+SHA256 (golang-sys-70b957f_GH0.tar.gz) = 441e259f5e287d6a83794e53a601208e895884828dd2df457da8492e8d635d00
+SIZE (golang-sys-70b957f_GH0.tar.gz) = 1119114
+SHA256 (golang-crypto-505ab14_GH0.tar.gz) = 66208e5bab6d39db520fb59b79a597ddb38cd6160e7ae7fb3e5c212fe9146125
+SIZE (golang-crypto-505ab14_GH0.tar.gz) = 1644620
diff --git a/net/clash/files/patch-proxy_redir_tcp__freebsd.go b/net/clash/files/patch-proxy_redir_tcp__freebsd.go
new file mode 100644
index 000000000000..ecffde3e282d
--- /dev/null
+++ b/net/clash/files/patch-proxy_redir_tcp__freebsd.go
@@ -0,0 +1,12 @@
+--- proxy/redir/tcp_freebsd.go.orig 2018-12-08 09:12:52 UTC
++++ proxy/redir/tcp_freebsd.go
+@@ -38,7 +38,8 @@ func parserPacket(conn net.Conn) (socks.
+ func getorigdst(fd uintptr) (socks.Addr, error) {
+ raw := syscall.RawSockaddrInet4{}
+ siz := unsafe.Sizeof(raw)
+- if err := socketcall(GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz)), 0); err != nil {
++ _, _, err := syscall.Syscall6(syscall.SYS_GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz)), 0);
++ if err != 0 {
+ return nil, err
+ }
+
diff --git a/net/clash/pkg-descr b/net/clash/pkg-descr
new file mode 100644
index 000000000000..27d9082c695f
--- /dev/null
+++ b/net/clash/pkg-descr
@@ -0,0 +1,8 @@
+Features:
+* HTTP/HTTPS and SOCKS protocol
+* Surge like configuration
+* GeoIP rule support
+* Support Vmess/Shadowsocks/Socks5
+* Support for Netfilter TCP redirect
+
+WWW: https://github.com/Dreamacro/clash