setup.py
author robin
Thu, 17 Oct 2013 17:39:56 +0100
branchpy33
changeset 17 b0a98a6ac6a2
parent 11 a0a1adbc7b13
child 22 d1a26617d06b
permissions -rw-r--r--
create py33 branch and working python33 pyRXPU
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
     1
#!/usr/bin/env python
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
     2
#Copyright ReportLab Europe Ltd. 2000-2012
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
     3
#see license.txt for license details
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
     4
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/rl_addons/pyRXP/setup.py
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
     5
if __name__=='__main__': #NO RUNTESTS
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
     6
	import os, sys, shutil, re
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
     7
	pkgDir=os.path.dirname(sys.argv[0])
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
     8
	if not pkgDir:
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
     9
		pkgDir=os.getcwd()
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    10
	elif not os.path.isabs(pkgDir):
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    11
		pkgDir=os.path.abspath(pkgDir)
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    12
	from distutils.core import setup, Extension
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    13
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    14
	def raiseConfigError(msg):
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    15
		import exceptions 
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    16
		class ConfigError(exceptions.Exception): 
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    17
			pass 
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    18
		raise ConfigError(msg)
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    19
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    20
	LIBS = []
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    21
	LIBRARIES=[]
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    22
	EXT_MODULES = []
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    23
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    24
	#building pyRXP
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    25
	if sys.platform=="win32":
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    26
		LIBS=['wsock32']
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    27
	elif sys.platform=="sunos5":
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    28
		LIBS=['nsl', 'socket', 'dl']
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    29
	elif sys.platform=="aix4":
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    30
		LIBS=['nsl_r', 'dl']
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    31
	else:
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    32
		LIBS=[]
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    33
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    34
	rxpFiles = ('xmlparser.c', 'url.c', 'charset.c', 'string16.c', 'ctype16.c', 
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    35
				'dtd.c', 'input.c', 'stdio16.c', 'system.c', 'hash.c', 
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    36
				'version.c', 'namespaces.c', 'http.c', 'nf16check.c', 'nf16data.c')
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    37
	pyRXPDir = os.path.join(pkgDir,'src')
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    38
	RXPLIBSOURCES=[]
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    39
	pyRXP_c = os.path.join(pyRXPDir,'pyRXP.c')
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    40
	VERSION = re.search(r'^#\s*define\s+VERSION\s*"([^"]+)"',open(pyRXP_c,'r').read(),re.MULTILINE)
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    41
	VERSION = VERSION and VERSION.group(1) or 'unknown'
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    42
	RXPDIR=os.path.join(pyRXPDir,'rxp')
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    43
	RXPLIBSOURCES= [os.path.join(RXPDIR,f) for f in rxpFiles]
17
b0a98a6ac6a2 create py33 branch and working python33 pyRXPU
robin
parents: 11
diff changeset
    44
	EXT_MODULES =	[Extension( 'pyRXPU',
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    45
								[pyRXP_c]+RXPLIBSOURCES,
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    46
								include_dirs=[RXPDIR],
17
b0a98a6ac6a2 create py33 branch and working python33 pyRXPU
robin
parents: 11
diff changeset
    47
								define_macros=[('CHAR_SIZE', 16),],
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    48
								library_dirs=[],
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    49
								# libraries to link against
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    50
								libraries=LIBS,
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    51
								),
11
a0a1adbc7b13 move towards standard filesystem layout
rptlab
parents: 2
diff changeset
    52
					]
1
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    53
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    54
	setup(	name = "pyRXP",
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    55
			version = VERSION,
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    56
			description = "Python RXP interface - fast validating XML parser",
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    57
			author = "Robin Becker",
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    58
			author_email = "robin@reportlab.com",
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    59
			url = "http://www.reportlab.com",
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    60
			packages = [],
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    61
			ext_modules = EXT_MODULES,
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    62
			#license = open(os.path.join('rxp','COPYING')).read(),
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    63
            classifiers = [
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    64
				'Development Status :: 5 - Production/Stable',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    65
				'Intended Audience :: Developers',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    66
				'License :: OSI Approved :: ReportLab BSD derived',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    67
				'Programming Language :: Python',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    68
				'Programming Language :: C',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    69
				'Operating System :: Unix',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    70
				'Operating System :: POSIX',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    71
				'Operating System :: Microsoft :: Windows',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    72
				'Topic :: Software Development :: Libraries :: Python Modules',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    73
				'Topic :: Text Processing :: Markup :: XML',
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    74
                ]
7cf042be50ba Move pyRXP into its own universe
rgbecker
parents:
diff changeset
    75
			)