#! /usr/bin/env python
# encoding: utf-8

import os

def options(opt):
	pass

def configure(conf):
	if not conf.path.find_dir('xash-extras'):
		conf.fatal('Can\'t find xash-extras submodule.')
		return

	conf.load('zip')

def build(bld):
	srcdir = bld.path.find_dir('xash-extras')

	if bld.env.DEST_OS in ['android']:
		install_path = bld.env.PREFIX
	else:
		install_path = os.path.join(bld.env.SHAREDIR, bld.env.GAMEDIR)

	bld(features='zip',
		name = 'extras.pk3',
		files = srcdir.ant_glob('**/*'),
		relative_to = srcdir,
		install_path = install_path)
