PageRenderTime 27ms CodeModel.GetById 19ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/scripts/scramble/scripts/pysqlite.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 36 lines | 33 code | 2 blank | 1 comment | 3 complexity | 11ea170168d7f9315cde6f0250668e17 MD5 | raw file
 1import os, sys
 2
 3def prep_sqlite( prepped, args ):
 4    os.makedirs( 'amalgamation' )
 5    for file in ( 'sqlite3.h', 'sqlite3.c', 'sqlite3ext.h' ):
 6        os.rename( file, os.path.join( 'amalgamation', file ) )
 7
 8# change back to the build dir
 9if os.path.dirname( sys.argv[0] ) != "":
10    os.chdir( os.path.dirname( sys.argv[0] ) )
11
12# find setuptools
13sys.path.append( os.path.join( '..', '..', '..', 'lib' ) )
14from scramble_lib import *
15
16tag = get_tag() # get the tag
17
18sqlite_version = ( tag.split( "_" ) )[1].replace('.','_')
19sqlite_archive_base = os.path.join( archives, "sqlite-amalgamation-%s" % sqlite_version )
20sqlite_archive = get_archive( sqlite_archive_base )
21
22clean( ['amalgamation'] ) # clean up any existing stuff (could happen if you run scramble.py by hand)
23
24unpack_dep( sqlite_archive, None, prep_sqlite, None )
25
26# reset args for distutils
27me = sys.argv[0]
28sys.argv = [ me ]
29sys.argv.append( "build_static" )
30if tag is not None:
31    sys.argv.append( "egg_info" )
32    sys.argv.append( "--tag-build=%s" %tag )
33sys.argv.append( "bdist_egg" )
34
35# do it
36execfile( "setup.py", globals(), locals() )