#
# Copyright (c) 2020 Juniper Networks, Inc. All rights reserved.
#

from SCons.Script import GetOption

Import('VRutilsEnv')
env = VRutilsEnv.Clone()

if 'install' in COMMAND_LINE_TARGETS:
    env.Alias('install', env.Install(env['INSTALL_BIN'], 'sandump'))
    install_root = GetOption('install_root')
    env.Alias('install', env.Install(install_root + '/usr/local/share/wireshark/', 'init.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/common.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/helpers.lua'))
    env.Alias('install', env.Install(install_root + '/usr/local/lib64/wireshark/plugins/', 'sandump_wireshark_plugin/main.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_bridge_table_data.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_drop_stats.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_fc_map.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_flow.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_flow_response.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_flow_table_data.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_hugepage_config.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_info.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_interface.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_mem_stats.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_mirror.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_mpls.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_nexthop.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_pkt_drop_log.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_qos_map.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_response.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_route.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_vrf.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_vrf_assign.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_vrf_stats.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vr_vxlan.lua'))
    env.Alias('install', env.Install(install_root + '/usr/share/lua/5.1/', 'sandump_wireshark_plugin/vrouter_ops.lua'))
