准备在Linux平台上进行打包测试。

pull/105/head
Apex Liu 2017-11-24 23:28:38 +08:00
parent 461c8d2dad
commit f56277fc30
5 changed files with 34 additions and 25 deletions

View File

@ -2,8 +2,8 @@
from core import colorconsole as cc
from core import utils
from core.context import *
from core.ver import *
from core.context import *
from core.env import env
ctx = BuildContext()
@ -46,9 +46,9 @@ class BuilderWin(BuilderBase):
# utils.ensure_file_exists(out_file)
def build_installer(self):
cc.i('build assist package for website...')
cc.i('build assist installer...')
name = 'teleport-assist-{}'.format(VER_TELEPORT_ASSIST)
name = 'teleport-assist-{}'.format(VER_TP_ASSIST)
out_path = os.path.join(env.root_path, 'out', 'installer')
utils.makedirs(out_path)
@ -69,21 +69,14 @@ class BuilderWin(BuilderBase):
if os.path.exists(tmp_app_path):
utils.remove(tmp_app_path)
# if os.path.exists(tmp_cfg_path):
# utils.remove(tmp_cfg_path)
utils.makedirs(tmp_app_path)
utils.makedirs(tmp_cfg_path)
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'ssh.ini')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'scp.ini')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'telnet.ini')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'ssh.ini')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'scp.ini')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'telnet.ini')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'cfg'), tmp_cfg_path, ('tp-assist.default.json', 'tp-assist.json'))
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist'), tmp_app_path, 'site')
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site')
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')

View File

@ -10,6 +10,8 @@ from core.context import *
from core.ver import *
ctx = BuildContext()
with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp'))
with_telnet = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet'))
# COMMON_MODULES = ['paste', 'pyasn1', 'pymemcache', 'pymysql', 'rsa', 'tornado', 'six.py']
@ -47,7 +49,7 @@ class BuilderBase:
class BuilderWin(BuilderBase):
def __init__(self):
super().__init__()
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
self.name = 'teleport-server-windows-{}-{}'.format(ctx.bits_path, VER_TP_SERVER)
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.zip'.format(self.name))
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
@ -73,7 +75,8 @@ class BuilderWin(BuilderBase):
utils.copy_ex(out_path, bin_path, 'tp_web.exe')
utils.copy_ex(out_path, bin_path, 'tp_core.exe')
utils.copy_ex(out_path, bin_path, 'tpssh.dll')
utils.copy_ex(out_path, bin_path, 'tprdp.dll')
if with_rdp:
utils.copy_ex(out_path, bin_path, 'tprdp.dll')
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))
@ -92,7 +95,7 @@ class BuilderWin(BuilderBase):
class BuilderLinux(BuilderBase):
def __init__(self):
super().__init__()
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TP_WEB_SERVER)
self.name = 'teleport-server-linux-{}-{}'.format(ctx.bits_path, VER_TP_SERVER)
self._final_file = os.path.join(env.root_path, 'out', 'installer', '{}.tar.gz'.format(self.name))
self.dist_path = os.path.join(env.root_path, 'dist', 'server')
@ -129,7 +132,8 @@ class BuilderLinux(BuilderBase):
utils.copy_ex(out_path, bin_path, 'tp_web')
utils.copy_ex(out_path, bin_path, 'tp_core')
utils.copy_ex(out_path, bin_path, 'libtpssh.so')
utils.copy_ex(out_path, bin_path, 'libtprdp.so')
if with_rdp:
utils.copy_ex(out_path, bin_path, 'libtprdp.so')
utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt'))

View File

@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
# import codecs
# import shutil
# import time
from core import colorconsole as cc
from core import utils
from core.context import *
from core.env import env
ctx = BuildContext()
with_rdp = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp'))
with_telnet = os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet'))
class BuilderBase:
@ -52,7 +51,7 @@ class BuilderWin(BuilderBase):
utils.msvc_build(sln_file, 'tpssh', ctx.target_path, ctx.bits_path, False)
utils.ensure_file_exists(out_file)
if os.path.exists(os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2015.sln')):
if with_rdp:
cc.n('build RDP protocol ...')
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2015.sln')
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll')
@ -70,8 +69,11 @@ class BuilderLinux(BuilderBase):
cc.n('build server app (tp_core/libtpssh/tp_web)...')
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'libtpssh.so'),
os.path.join(out_path, 'tp_web')]
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')]
out_files.extend(os.path.join(out_path, 'libtpssh.so'))
if with_rdp:
out_files.extend(os.path.join(out_path, 'libtprdp.so'))
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
for f in out_files:
if os.path.exists(f):
@ -95,8 +97,11 @@ class BuilderMacOS(BuilderBase):
cc.n('build server app (tp_core/libtpssh/tp_web)...')
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'libtpssh.so'),
os.path.join(out_path, 'tp_web')]
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'tp_web')]
out_files.extend(os.path.join(out_path, 'libtpssh.so'))
if with_rdp:
out_files.extend(os.path.join(out_path, 'libtprdp.so'))
# out_files.extend(os.path.join(out_path, 'libtptelnet.so'))
for f in out_files:
if os.path.exists(f):

View File

@ -23,4 +23,7 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_subdirectory(tp_core/core)
add_subdirectory(tp_core/protocol/ssh)
#add_subdirectory(tp_core/protocol/rdp)
IF (EXISTS tp_core/protocol/rdp)
add_subdirectory(tp_core/protocol/rdp)
ENDIF (EXISTS tp_core/protocol/rdp)

View File

@ -810,7 +810,11 @@ int SshSession::_on_server_channel_data(ssh_session session, ssh_channel channel
else
auth_mode = "unknown";
#ifdef EX_OS_WIN32
int w = min(cp->win_width, 128);
#else
int w = std::min(cp->win_width, 128);
#endif
ex_astr line(w, '=');
snprintf(buf, sizeof(buf),