forked from dstndstn/astrometry.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
40 lines (37 loc) · 1.29 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
from __future__ import print_function
from distutils.core import setup, Extension
from setuptools.command.install import install
import subprocess
import os
import sys
from glob import glob
class MyInstall(install):
def run(self):
print('MyInstall.run: calling "make -k"')
subprocess.call(['make', '-k'])
print('MyInstall.run: calling "make -k py"')
subprocess.call(['make', '-k', 'py'])
for cmd in ['make -k pyinstall',
'make -k install']:
dirnm = self.install_base
if dirnm is not None:
cmd += ' INSTALL_DIR="%s"' % dirnm
pybase = self.install_platlib
if pybase is not None:
pybase = os.path.join(pybase, 'astrometry')
cmd += ' PY_BASE_INSTALL_DIR="%s"' % pybase
py = sys.executable
if py is not None:
cmd += ' PYTHON="%s"' % py
print('Running:', cmd)
subprocess.call(cmd, shell=True)
install.run(self)
setup(name='astrometry',
version='git',
author='Astrometry.net team',
author_email='[email protected]',
url='http://astrometry.net',
cmdclass={'install': MyInstall},
packages=['astrometry'],
package_dir={'astrometry':''},
)