View | Details | Raw Unified | Return to bug 233908 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 233908