#!/usr/bin/env python """ setup.py for installing the gdcm-Python bindings using distutils. Created by Mathieu Malaterre, May 2004. Heavily based on setup.py.in from VTK, Prabhu Ramachandran, June 2002. """ import glob, sys, os from types import StringType from distutils.core import setup from distutils.util import change_root, convert_path from distutils.command.install_data import install_data from distutils.sysconfig import get_config_var version = "${GDCM_VERSION}", build_lib_dir = "${LIBRARY_OUTPUT_PATH}" build_bin_dir = "${EXECUTABLE_OUTPUT_PATH}" gdcmDictsDir = "${GDCM_SOURCE_DIR}" gdcmDictsDir = os.path.join( gdcmDictsDir, "Dicts" ) # You can change this to suit your needs. However you must make sure # that under *nix the libvtk*Python*.so in the specified directory. #install_lib_dir = "${CMAKE_INSTALL_PREFIX}/lib/vtk" def get_libs(): """Returns a list of libraries to be installed. """ libs = [] if os.name == 'posix': libs = glob.glob(os.path.abspath(os.path.join( build_lib_dir, '_gdcm' + get_config_var('SO')))) libs = libs + glob.glob(os.path.abspath(os.path.join( build_lib_dir, 'libvtkgdcmPython' + get_config_var('SO')))) else: d = os.path.normpath(build_lib_dir) if not os.path.isfile(os.path.join(d, 'libvtkgdcmPython.dll')): d = os.path.normpath(os.path.join(build_lib_dir, 'release')) libs = glob.glob(os.path.join(d, 'vtk*Python.dll')) return libs def get_scripts(): """Returns the appropriate gdcm.py python script that is to be installed.""" scripts = [] if os.name == 'posix': f = os.path.join(build_bin_dir, "gdcm.py") if os.path.exists(f): scripts.append(f) else: win32_bin_dir = build_bin_dir for subdir in ('Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'): win32_bin_dir = os.path.join(build_bin_dir, subdir) if os.path.exists(win32_bin_dir): break for i in ('vtkpython.exe', 'pvtkpython.exe'): f = os.path.join(os.path.normpath(win32_bin_dir), i) if os.path.exists(f): scripts.append(f) return scripts print get_libs() print get_scripts() print gdcmDictsDir """ setup(name="Distutils", version="1.0", description="Python Distribution Utilities", author="Greg Ward", author_email="gward@python.net", url="http://www.python.org/sigs/distutils-sig/", packages=['distutils', 'distutils.command'], ) """ setup(name = "gdcmPython", version = "${GDCM_VERSION}", description = "GNU DiCoM", author = "frog", author_email = "frog@creatis.insa-lyon.fr", maintainer = "GDCM Developers", maintainer_email = "dcmlib@creatis.insa-lyon.fr", license = "BSD", long_description = "Library dedicated to reading/parsing and writing Dicom files", url = "http://www.creatis.insa-lyon.fr/Public/Gdcm/", platforms = ['Any'], packages = ['gdcmPython'], #scripts = get_scripts(), #package_dir = {'gdcmPython': '.'}, #data_files = [ ('gdcmPython', 'gdcm.pth') ], ) #data_files = [('gdcmPython', get_libs()), ('gdcmPython', ['gdcm.pth'])] #data_files = [('Dicts', glob.glob(os.path.join(gdcmDictsDir,"Dicts/*"))) ]