Source

JungleDisk Desktop / wscript

#! /usr/bin/env python
# encoding: utf-8
# Geany 0.18
# Erik Southworth, 2009,2010 (s6v)

import Options
import os
import platform
import shutil
import tarfile
import urllib

APPNAME = 'jungleDisk-desktop'

NAME = 'JungleDisk Desktop'
VERSION = '3.08'
BUGREPORT = 'http://bitbucket.org/superstition/jungledisk-desktop/issues/'
HOMEPAGE = 'http://bitbucket.org/superstition/jungledisk-desktop/wiki/'
RELEASE = '2009,2010'
REVISION = '18 July 2010'

PKGVER = VERSION.replace('.', '')
URL='http://downloads.jungledisk.com/jungledisk/'
PACKAGE='junglediskdesktop'+PKGVER+'.tar.gz'
PACKAGE64='junglediskdesktop64-'+PKGVER+'.tar.gz'

top = '.'
out = 'build'

def set_options(opt):
	opt.tool_options('gnu_dirs')

	opt.parser.set_defaults(prefix='/usr')
	opt.parser.set_defaults(SYSCONFDIR='/etc')

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

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

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

	if Options.options.MAINTAINER:
		conf.env.MAINTAINER = True

	conf.sub_config('desktop')
	conf.sub_config('man')

def build(bld):
	def fetch_archive(self):
		if platform.machine() == 'x86_64':
			PACKAGE = PACKAGE64

		print('=== downloading {0} ===').format(PACKAGE)
		print('{0}{1}').format(URL, PACKAGE)

		dir = bld.path.abspath(bld.env)
		dest = dir + 'junglediskdesktop.tar.gz'
		urllib.urlretrieve(URL+PACKAGE, dest)
		tar = tarfile.open(dest)
		tar.extractall(path=dir)
		tar.close()

	bld.path.ensure_dir_node_from_path(['junglediskdesktop'])

	bld.new_task_gen(
		name			= 'wget',
		target			= 'junglediskdesktop/junglediskdesktop junglediskdesktop/jungledisk junglediskdesktop/junglediskdesktop.png',
		rule			= fetch_archive,
	)
	bld.install_files('${BINDIR}', 'junglediskdesktop/junglediskdesktop', chmod=0755)
	bld.install_files('${BINDIR}', 'junglediskdesktop/jungledisk', chmod=0755)
	bld.install_files('${DATADIR}/icons/hicolor/32x32/apps',
		'junglediskdesktop/junglediskdesktop.png')

	bld.add_subdirs('desktop')
	bld.add_subdirs('man')

def dist_hook():
	# pkg man pages
	dir = os.path.join(os.pardir, out, 'default/man/')
	file = 'jungledisk.1'
	shutil.copy2(dir+file, 'man')
	file = 'junglediskdesktop.1'
	shutil.copy2(dir+file, 'man')
	os.remove('man/jungledisk.man1')
	os.remove('man/junglediskdesktop.man1')
	os.remove('man/txt2man.py')
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.