-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
108 lines (90 loc) · 2.79 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python
"""
Setup script for GPyVSOP
GPyVSOP is the Gemini VSOP data reduction package.
Usage:
python setup.py install --prefix=<somewhere>
python setup.py sdist (to make the tar file)
"""
from distutils.core import setup
import sys
import os, os.path
import optparse
def parse_args(setup_args):
p = optparse.OptionParser()
p.add_option('--prefix', action='store')
return p.parse_args()
# PACKAGES
PACKAGES = ['GPyVSOP']
PACKAGE_DIRS={'GPyVSOP' : '.'}
# PACKAGE_DATA
GPYVSOP_DATA_FILES = {'GPyVSOP': ['Changes']}
PACKAGE_DATA = GPYVSOP_DATA_FILES
# DATA_DIR and DATA_FILES
#GPYVSOP_DATA_FILES = [('', ['Changes'])]
#DATA_FILES = GPYVSOP_DATA_FILES
# SCRIPTS
#GPYVSOP_SCRIPTS = [ 'gmosLS',
# 'publish',
# 'setvsop',
# 'splot' ]
#SCRIPTS = GPYVSOP_SCRIPTS
SCRIPTS = None
# SYMLINK
GPYVSOP_BIN_LINKS = [ 'gmosLS',
'publish',
'setvsop',
#'splot'
]
# links created after setup()
# EXTENSIONS
EXTENSIONS = None
setup ( name='GPyVSOP',
version='1.0.5',
description='Gemini VSOP Data Reduction Package',
author='Kathleen Labrie',
author_email='[email protected]',
url='http://www.gemini.edu',
maintainer='Kathleen Labrie',
maintainer_email='[email protected]',
packages=PACKAGES,
package_dir=PACKAGE_DIRS,
package_data=PACKAGE_DATA,
#data_files=DATA_FILES,
scripts=SCRIPTS,
ext_modules=EXTENSIONS,
provides=['GPyVSOP'],
classifiers=[
'Development Status :: QA',
'Intended Audience :: VSOP',
'Operating System :: Linux :: Fedora',
'Programming Language :: Python',
'Programming Language :: IRAF',
'Topic :: VSOP',
'Topic :: GMOS',
'Topic :: Data Reduction',
'Topic :: Longslit',
],
)
# Create links to executable scripts
# Note: eventually what I need to do is the re-write the scripts
# such that I don't need the links anymore.
(options, args) = parse_args(sys.argv[1:])
if args[0] == 'install':
if options.prefix != None:
prefix = options.prefix
else:
prefix = sys.prefix
bindir = os.path.join(prefix, 'bin')
version_info = sys.version_info
version = str(version_info[0])+'.'+str(version_info[1])
ppath = os.path.join('lib','python'+version, 'site-packages')
gpyvsoppath = os.path.join(prefix, ppath, 'GPyVSOP')
os.chdir(bindir)
for bin in GPYVSOP_BIN_LINKS:
try:
os.remove(bin)
except:
pass
os.symlink(os.path.join(gpyvsoppath, bin+'.py'), bin)
os.chmod(os.path.join(gpyvsoppath, bin+'.py'), 0755)