2 # -*- coding: utf-8 -*-
7 Simple configure script that creates a makefile.
9 :copyright: 2009 by Armin Ronacher.
10 :license: BSD, see LICENSE for more details.
14 from optparse import OptionParser
19 parser = OptionParser(usage='%prog')
20 parser.add_option('--prefix', dest='prefix', default='/usr/local',
21 help='install architecture-independent files in PREFIX '
23 parser.add_option('--python', dest='python', default=sys.executable,
24 help='the python version to use for the installation')
25 options, args = parser.parse_args()
28 parser.error('too many arguments')
30 f = file('Makefile.in')
32 makefile_in = f.read()
35 f = file('Makefile', 'w')
37 f.write(makefile_in % {
38 'PYTHON': options.python,
39 'PREFIX': os.path.abspath(options.prefix)
43 print 'Generated Makefile'
44 print 'type "make install" to install Zine'
47 if __name__ == '__main__':
48 os.chdir(os.path.dirname(__file__) or '.')