Get PackageScript release-equivalent on Linux.

Former-commit-id: 15cfb571fbfb37281e1465a013305ff6267b7dce
This commit is contained in:
David Anderson 2014-02-08 14:29:15 -08:00
parent e57845dd50
commit 8f51d87826
2 changed files with 65 additions and 25 deletions

View File

@ -2,6 +2,7 @@
import os import os
files = [ files = [
'admin.sma',
'adminchat.sma', 'adminchat.sma',
'admincmd.sma', 'admincmd.sma',
'adminhelp.sma', 'adminhelp.sma',

View File

@ -5,7 +5,7 @@ builder.SetBuildFolder('packages')
ModPackages = { ModPackages = {
'cstrike': 'cstrike', 'cstrike': 'cstrike',
'dod': 'cstrike', 'dod': 'dod',
'esf': 'esf', 'esf': 'esf',
'ns': 'ns', 'ns': 'ns',
'tfc': 'tfc', 'tfc': 'tfc',
@ -14,35 +14,45 @@ ModPackages = {
} }
folder_list = [ folder_list = [
'core/addons/amxmodx/configs', 'base/addons/amxmodx/configs',
'core/addons/amxmodx/data', 'base/addons/amxmodx/data',
'core/addons/amxmodx/data/lang', 'base/addons/amxmodx/data/lang',
'core/addons/amxmodx/dlls', 'base/addons/amxmodx/dlls',
'core/addons/amxmodx/modules', 'base/addons/amxmodx/logs',
'core/addons/amxmodx/plugins', 'base/addons/amxmodx/modules',
'core/addons/amxmodx/scripting', 'base/addons/amxmodx/plugins',
'core/addons/amxmodx/scripting/amxmod_compat', 'base/addons/amxmodx/scripting',
'core/addons/amxmodx/scripting/include', 'base/addons/amxmodx/scripting/amxmod_compat',
'core/addons/amxmodx/scripting/include/amxmod_compat', 'base/addons/amxmodx/scripting/include',
'core/addons/amxmodx/scripting/testsuite', 'base/addons/amxmodx/scripting/include/amxmod_compat',
'base/addons/amxmodx/scripting/testsuite',
'cstrike/addons/amxmodx/configs', 'cstrike/addons/amxmodx/configs',
'cstrike/addons/amxmodx/data',
'cstrike/addons/amxmodx/plugins', 'cstrike/addons/amxmodx/plugins',
'cstrike/addons/amxmodx/modules', 'cstrike/addons/amxmodx/modules',
'cstrike/addons/amxmodx/scripting',
'dod/addons/amxmodx/configs', 'dod/addons/amxmodx/configs',
'dod/addons/amxmodx/data',
'dod/addons/amxmodx/plugins', 'dod/addons/amxmodx/plugins',
'dod/addons/amxmodx/modules', 'dod/addons/amxmodx/modules',
'dod/addons/amxmodx/scripting',
'esf/addons/amxmodx/configs', 'esf/addons/amxmodx/configs',
'esf/addons/amxmodx/plugins', 'esf/addons/amxmodx/plugins',
'esf/addons/amxmodx/modules', 'esf/addons/amxmodx/scripting',
'ns/addons/amxmodx/configs', 'ns/addons/amxmodx/configs',
'ns/addons/amxmodx/plugins', 'ns/addons/amxmodx/plugins',
'ns/addons/amxmodx/modules', 'ns/addons/amxmodx/modules',
'ns/addons/amxmodx/scripting',
'tfc/addons/amxmodx/configs', 'tfc/addons/amxmodx/configs',
'tfc/addons/amxmodx/data',
'tfc/addons/amxmodx/plugins', 'tfc/addons/amxmodx/plugins',
'tfc/addons/amxmodx/modules', 'tfc/addons/amxmodx/modules',
'tfc/addons/amxmodx/scripting',
'ts/addons/amxmodx/configs', 'ts/addons/amxmodx/configs',
'ts/addons/amxmodx/data',
'ts/addons/amxmodx/plugins', 'ts/addons/amxmodx/plugins',
'ts/addons/amxmodx/modules', 'ts/addons/amxmodx/modules',
'ts/addons/amxmodx/scripting',
] ]
def split_all(path): def split_all(path):
@ -64,7 +74,7 @@ for folder in folder_list:
# Copy core dlls. # Copy core dlls.
for dll in AMXX.binaries: for dll in AMXX.binaries:
builder.AddCopy(dll.binary, folder_map['core/addons/amxmodx/dlls']) builder.AddCopy(dll.binary, folder_map['base/addons/amxmodx/dlls'])
# Copy modules. # Copy modules.
for module in AMXX.modules: for module in AMXX.modules:
@ -72,20 +82,40 @@ for module in AMXX.modules:
if parts[1] in ModPackages: if parts[1] in ModPackages:
package = ModPackages[parts[1]] package = ModPackages[parts[1]]
else: else:
package = 'core' package = 'base'
builder.AddCopy(module.binary, folder_map[package + '/addons/amxmodx/modules']) builder.AddCopy(module.binary, folder_map[package + '/addons/amxmodx/modules'])
# Copy the compiler. # Copy the compiler.
builder.AddCopy(AMXX.amxxpc.binary, folder_map['core/addons/amxmodx/scripting']) builder.AddCopy(AMXX.amxxpc.binary, folder_map['base/addons/amxmodx/scripting'])
builder.AddCopy(AMXX.libpc300.binary, folder_map['core/addons/amxmodx/scripting']) builder.AddCopy(AMXX.libpc300.binary, folder_map['base/addons/amxmodx/scripting'])
# Copy plugins. # Copy plugins.
StatsPlugins = ['csstats.amxx']
for amxx_file in AMXX.plugins: for amxx_file in AMXX.plugins:
amxx_entry = AMXX.plugins[amxx_file] amxx_entry = AMXX.plugins[amxx_file]
package = os.path.dirname(amxx_file) package = os.path.dirname(amxx_file)
output_folder = '/addons/amxmodx/plugins'
if not len(package): if not len(package):
package = 'core' package = 'base'
builder.AddCopy(amxx_entry, folder_map[package + '/addons/amxmodx/plugins']) else:
# Ugh - statsx plugins go into a random folder.
name = os.path.basename(amxx_file)
if name == package + 'stats.amxx' or name in StatsPlugins:
output_folder = '/addons/amxmodx/data'
builder.AddCopy(amxx_entry, folder_map[package + output_folder])
# If it was in a mod package, we can cheat and copy it to scripting since
# none of them are multi-file.
if package != 'base':
base_file, _ = os.path.splitext(os.path.basename(amxx_file))
source_file = os.path.join(
builder.sourcePath,
'plugins',
package,
base_file + '.sma'
)
builder.AddCopy(source_file, folder_map[package + '/addons/amxmodx/scripting'])
# Copy configuration files for each mod. # Copy configuration files for each mod.
configs = [ configs = [
@ -98,6 +128,7 @@ configs = [
'cvars.ini', 'cvars.ini',
'hamdata.ini', 'hamdata.ini',
'maps.ini', 'maps.ini',
'miscstats.ini',
'modules.ini', 'modules.ini',
'plugins.ini', 'plugins.ini',
'speech.ini', 'speech.ini',
@ -142,7 +173,7 @@ for config in configs:
if len(cfg_folder): if len(cfg_folder):
out_folder = cfg_folder + '/addons/amxmodx/configs' out_folder = cfg_folder + '/addons/amxmodx/configs'
else: else:
out_folder = 'core/addons/amxmodx/configs' out_folder = 'base/addons/amxmodx/configs'
builder.AddCopy( builder.AddCopy(
source = os.path.join(builder.sourcePath, 'configs', config), source = os.path.join(builder.sourcePath, 'configs', config),
output_path = folder_map[out_folder] output_path = folder_map[out_folder]
@ -158,8 +189,6 @@ scripting_files = [
'adminvote.sma', 'adminvote.sma',
'antiflood.sma', 'antiflood.sma',
'cmdmenu.sma', 'cmdmenu.sma',
'compile.exe',
'compile.sh',
'imessage.sma', 'imessage.sma',
'mapchooser.sma', 'mapchooser.sma',
'mapsmenu.sma', 'mapsmenu.sma',
@ -261,7 +290,7 @@ scripting_files = [
'include/amxmod_compat/xtrafun.inc', 'include/amxmod_compat/xtrafun.inc',
] ]
for filename in scripting_files: for filename in scripting_files:
output_folder = 'core/addons/amxmodx/scripting' output_folder = 'base/addons/amxmodx/scripting'
inner_folder = os.path.dirname(filename) inner_folder = os.path.dirname(filename)
if len(inner_folder): if len(inner_folder):
output_folder += '/' + inner_folder output_folder += '/' + inner_folder
@ -272,9 +301,19 @@ for filename in scripting_files:
# Copy weird things. # Copy weird things.
weirdfiles = [ weirdfiles = [
('dlls/geoip/GeoIP.dat', 'core/addons/amxmodx/data'), ('dlls/geoip/GeoIP.dat', 'base/addons/amxmodx/data'),
('plugins/esf/ESF_mod_tutorial.txt', 'esf/addons/amxmodx/scripting'),
] ]
if builder.target_platform == 'windows':
weirdfiles += [
('plugins/compile.exe', 'base/addons/amxmodx/scripting'),
]
else:
weirdfiles += [
('plugins/compile.sh', 'base/addons/amxmodx/scripting'),
]
for source, dest in weirdfiles: for source, dest in weirdfiles:
builder.AddCopy( builder.AddCopy(
source = os.path.join(builder.sourcePath, source), source = os.path.join(builder.sourcePath, source),
@ -314,5 +353,5 @@ datafiles = [
for datafile in datafiles: for datafile in datafiles:
builder.AddCopy( builder.AddCopy(
source = os.path.join(builder.sourcePath, 'plugins', 'lang', datafile), source = os.path.join(builder.sourcePath, 'plugins', 'lang', datafile),
output_path = folder_map['core/addons/amxmodx/data/lang'] output_path = folder_map['base/addons/amxmodx/data/lang']
) )