Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/trojan/files/, net-proxy/trojan/
Date: Thu, 11 Oct 2018 08:30:35
Message-Id: 1539245638.31847f8923c26e1df0410c8842834c63b543048e.mgorny@gentoo
1 commit: 31847f8923c26e1df0410c8842834c63b543048e
2 Author: YangMame <yangmame <AT> icloud <DOT> com>
3 AuthorDate: Sun Oct 7 23:37:52 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 11 08:13:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31847f89
7
8 net-proxy/trojan: new package
9
10 Signed-off-by: Xin Yang <yangmame <AT> icloud.com>
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12 Closes: https://github.com/gentoo/gentoo/pull/9776
13
14 net-proxy/trojan/Manifest | 1 +
15 net-proxy/trojan/files/trojan.initd | 26 ++++++++++++++++++++
16 net-proxy/trojan/metadata.xml | 28 ++++++++++++++++++++++
17 net-proxy/trojan/trojan-1.8.1.ebuild | 46 ++++++++++++++++++++++++++++++++++++
18 4 files changed, 101 insertions(+)
19
20 diff --git a/net-proxy/trojan/Manifest b/net-proxy/trojan/Manifest
21 new file mode 100644
22 index 00000000000..958dea17ea5
23 --- /dev/null
24 +++ b/net-proxy/trojan/Manifest
25 @@ -0,0 +1 @@
26 +DIST trojan-1.8.1.tar.gz 37199 BLAKE2B be93a119ca95e5f4151db6ab58ffaa123d5bd304247d7835ca34ba870808d7e246d551c204d60ffb2a982f2fcb2c35ada1d9823e7f931b36377f99ebd0f48bd6 SHA512 1e2b8e2ddb02b2009181a980781574e6e6375c98475bda4096b70a9c00e61c5ca445f28730e195a5179b85bf5464a6dcb1bcb6ba8dc841d95c9a111f8f87c511
27
28 diff --git a/net-proxy/trojan/files/trojan.initd b/net-proxy/trojan/files/trojan.initd
29 new file mode 100755
30 index 00000000000..f525eefe74d
31 --- /dev/null
32 +++ b/net-proxy/trojan/files/trojan.initd
33 @@ -0,0 +1,26 @@
34 +#!/sbin/openrc-run
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +TJ_CONFIG="/etc/trojan/config.json"
39 +TJ_PIDFILE="/run/trojan.pid"
40 +TJ_LOG="/var/log/trojan.log"
41 +
42 +depend() {
43 + need net
44 +}
45 +
46 +start() {
47 + ebegin "Starting Trojan, Log File: ${TJ_LOG}"
48 + start-stop-daemon --start -b \
49 + -1 "${TJ_LOG}" -2 "${TJ_LOG}" \
50 + -m -p "${TJ_PIDFILE}" \
51 + --exec /usr/bin/trojan -- "${TJ_CONFIG}"
52 + eend $?
53 +}
54 +
55 +stop() {
56 + ebegin "Stopping Trojan"
57 + start-stop-daemon --stop -p "${TJ_PIDFILE}"
58 + eend $?
59 +}
60
61 diff --git a/net-proxy/trojan/metadata.xml b/net-proxy/trojan/metadata.xml
62 new file mode 100644
63 index 00000000000..9b97efd6cb4
64 --- /dev/null
65 +++ b/net-proxy/trojan/metadata.xml
66 @@ -0,0 +1,28 @@
67 +<?xml version="1.0" encoding="UTF-8"?>
68 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
69 +<pkgmetadata>
70 + <maintainer type="person">
71 + <email>yangmame@××××××.com</email>
72 + <name>Xin Yang</name>
73 + </maintainer>
74 + <maintainer type="project">
75 + <email>proxy-maint@g.o</email>
76 + <name>Proxy Maintainers</name>
77 + </maintainer>
78 + <longdescription lang="en">
79 + An unidentifiable mechanism that helps you bypass GFW.
80 + Trojan features multiple protocols over TLS to avoid both
81 + active/passive detections and ISP QoS limitations.
82 + Trojan is not a fixed program or protocol. It's an idea,
83 + an idea that imitating the most common service, to an extent
84 + that it behaves identically, could help you get across the
85 + Great FireWall permanently, without being identified ever.
86 + We are the GreatER Fire; we ship Trojan Horses.
87 + </longdescription>
88 + <use>
89 + <flag name="mysql">build with MySQL support</flag>
90 + </use>
91 + <upstream>
92 + <remote-id type="github">trojan-gfw/trojan</remote-id>
93 + </upstream>
94 +</pkgmetadata>
95
96 diff --git a/net-proxy/trojan/trojan-1.8.1.ebuild b/net-proxy/trojan/trojan-1.8.1.ebuild
97 new file mode 100644
98 index 00000000000..b6c8edf97d8
99 --- /dev/null
100 +++ b/net-proxy/trojan/trojan-1.8.1.ebuild
101 @@ -0,0 +1,46 @@
102 +# Copyright 1999-2018 Gentoo Foundation
103 +# Distributed under the terms of the GNU General Public License v2
104 +
105 +EAPI=6
106 +
107 +PYTHON_COMPAT=( python{3_4,3_5,3_6,3_7} )
108 +
109 +inherit cmake-utils python-any-r1
110 +
111 +DESCRIPTION="An unidentifiable mechanism that helps you bypass GFW"
112 +HOMEPAGE="https://github.com/trojan-gfw/${PN}"
113 +SRC_URI="https://github.com/trojan-gfw/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
114 +
115 +LICENSE="GPL-3+"
116 +SLOT="0"
117 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
118 +IUSE="mysql test"
119 +RESTRICT="!test? ( test )"
120 +
121 +RDEPEND="
122 + >=dev-libs/boost-1.54.0:=
123 + >=dev-libs/openssl-1.0.2:=
124 + mysql? ( dev-db/mysql-connector-c:= )
125 +"
126 +DEPEND="
127 + ${RDEPEND}
128 + test? ( net-misc/curl ${PYTHON_DEPS} )
129 +"
130 +
131 +src_configure() {
132 + local mycmakeargs=(
133 + -DENABLE_MYSQL=$(usex mysql)
134 + -DSYSTEMD_SERVICE=ON
135 + -DCMAKE_INSTALL_DOCDIR=share/doc/${PF}
136 + )
137 + cmake-utils_src_configure
138 +}
139 +
140 +src_install() {
141 + cmake-utils_src_install
142 + newinitd "${FILESDIR}/trojan.initd" trojan
143 +}
144 +
145 +src_test() {
146 + cmake-utils_src_test -j1
147 +}