Steam Boiler / wscript

#! /usr/bin/env python
# encoding: utf-8
# Geany 0.21
# Erik Southworth, 2009,2010,2011,2012 (dvs)

import Options
import os
import Scripting
import shutil

APPNAME = 'steam-boiler'

NAME = 'Steam Boiler'
VERSION = '50'
BUGREPORT = 'http://bitbucket.org/superstition/steam-boiler/issues/'
HOMEPAGE = 'http://bitbucket.org/superstition/steam-boiler/wiki/'
RELEASE = '2009,2010,2011,2012'
REVISION = '04 August 2012'

top = '.'
out = 'build'

def set_options(ctx):
	#~ opt.tool_options('gnu_dirs')

	ctx.add_option('--maintainer', action='store_true', default=False,
		help='is: maintainer build from VC sources [default: False]',
		dest='MAINTAINER')

	ctx.add_option_group('Report bugs to <'+BUGREPORT+'>')

def configure(ctx):
	ctx.check_tool(['gnu_dirs', 'misc'])

	# build requirements
	if Options.options.MAINTAINER:
		ctx.env['MAINTAINER'] = True
		ctx.check_tool('txt2man', tooldir='src')
		ctx.find_program(['uncompress', 'gzip'], var='INFLATE', mandatory=True)
		ctx.find_program('sphinx-build', var='SPHINX', mandatory=True)

	# runtime requirements
	ctx.find_program('find', var='FIND', mandatory=True)
	ctx.find_program('getopt', var='GETOPT', mandatory=True)
	ctx.find_program('install', var='INSTALL', mandatory=True)
	ctx.find_program('ln', var='LINK', mandatory=True)

	ctx.env['PKGDATADIR'] = ctx.env['DATADIR'] + '/' + APPNAME

def build(ctx):
	ctx.recurse(['hldsupdatetool', 'src', 'steamcmd'])

	# build requirements
	if ctx.env['MAINTAINER']:
		ctx.recurse(['doc'])

def dist_hook():
	# pkg steamcmd(console)
	dir = os.path.join(os.pardir, out, '../steamcmd/')
	for file in ['steamcmd.tar.gz']:
		shutil.copy2(dir+file, 'steamcmd')

	# pkg steam(hldsupdatetool)
	dir = os.path.join(os.pardir, out, 'default/hldsupdatetool/')
	for file in ['hldsupdatetool', 'LICENSE', 'README']:
		shutil.copy2(dir+file, 'hldsupdatetool')
	os.remove('hldsupdatetool/hldsupdatetool.bin')

	# pkg man pages
	dir = os.path.join(os.pardir, out, 'default/src/')
	for file in ['boiler.6', 'steam.6']:
		shutil.copy2(dir+file, 'src')
	os.remove('src/steam.man6')
	os.remove('src/txt2man.py')

	# pkg html docs
	shutil.rmtree('doc', ignore_errors=False, onerror=None)
	dir = os.path.join(os.pardir, out, 'default/doc/html')
	shutil.copytree(dir, 'doc/html')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.