--- net/mtg/Makefile (nonexistent) +++ net/mtg/Makefile (working copy) @@ -0,0 +1,37 @@ +# $FreeBSD$ + +PORTNAME= mtg +DISTVERSION= 0.15.1 +CATEGORIES= net + +MAINTAINER= onlinehead@gmail.com +COMMENT= Golang implementation of MTProto proxy server for Telegram + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/LICENSE + +BUILD_DEPENDS= git:devel/git + +USES= go + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} + +USE_GITHUB= yes +GH_ACCOUNT= 9seconds +GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME} + +MAKE_ENV+= GO111MODULE=on +USE_RC_SUBR= mtg + +post-patch: + @${MKDIR} ${WRKSRC}/src/golang.org + +do-build: + @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \ + ${SETENV} ${MAKE_ENV} ${BUILD_ENV} GO111MODULE=on go build -ldflags \ + "-s -w -X 'main.version=v${DISTVERSION}'" -o mtg; + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/mtg ${STAGEDIR}${PREFIX}/bin/mtg + +.include --- net/mtg/distinfo (nonexistent) +++ net/mtg/distinfo (working copy) @@ -0,0 +1,3 @@ +TIMESTAMP = 1544396609 +SHA256 (9seconds-mtg-0.15.1_GH0.tar.gz) = 95a59b4a7281d38ae6dacc4fe537dbf87af7b8500949a8c478226cf2d31cd1db +SIZE (9seconds-mtg-0.15.1_GH0.tar.gz) = 37372 --- net/mtg/files/mtg.in (nonexistent) +++ net/mtg/files/mtg.in (working copy) @@ -0,0 +1,31 @@ +#!/bin/sh +# $FreeBSD$ +# +# PROVIDE: mtg +# REQUIRE: DAEMON NETWORKING LOGIN +# KEYWORD: shutdown +# +# Add following lines to /etc/rc.conf to enable the MTG: +# +# mtg_enabl (bool): Set NO by default +# Set YES to enable daemon +# +# +# mtg_args (str): CLI arguments for mtg. +# Use `mtg --help` to get instruction. +. /etc/rc.subr + +name="mtg" +rcvar=mtg_enable +mtg_command="/usr/local/bin/${name}" +pidfile="/var/run/${name}.pid" + +load_rc_config $name + +: ${mtg_enable:=no} +: ${mtg_args:=""} + +command="/usr/sbin/daemon" +command_args="-P ${pidfile} -S -T ${name} -r -f ${mtg_command} ${mtg_args}" + +run_rc_command "$1" --- net/mtg/pkg-descr (nonexistent) +++ net/mtg/pkg-descr (working copy) @@ -0,0 +1,9 @@ +Mtg is an implementation of MTProto proxy in golang which is intended to be: + +- Lightweight. It has to consume as less resources as possible but not by losing maintainability. +- Easily deployable. I strongly believe that Telegram proxies should follow the way + of ShadowSocks: promoted channels is a strange way of doing business I suppose. +- Single secret. I think that multiple secrets solves no problems and just complexify software. +- No management WebUI. This is an implementation of simple lightweight proxy. + +WWW: https://github.com/9seconds/mtg --- net/mtg/pkg-plist (nonexistent) +++ net/mtg/pkg-plist (working copy) @@ -0,0 +1,2 @@ +bin/mtg +etc/rc.d/mtg