-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
84 lines (67 loc) · 2.4 KB
/
setup.py
File metadata and controls
84 lines (67 loc) · 2.4 KB
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
#!/usr/bin/env python
import os
from sys import platform
from setuptools import setup,Extension
from setuptools.command.install import install
from distutils.command.build_ext import build_ext
from subprocess import call
from multiprocessing import cpu_count
BASEPATH = os.path.dirname(os.path.abspath(__file__))
class MakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)
class ifdhBuild(build_ext):
def build_extension(self, ext):
# build ifdh
build_path = os.path.abspath(
os.path.dirname(self.get_ext_fullpath(ext.name)))
print("build_temp = %s" % build_path)
self.mkpath(self.build_temp)
bindir = self.build_lib + '/../bin'
self.mkpath(bindir)
self.mkpath(self.build_temp)
cmd = [
'make',
'DESTDIR=%s/ifdhc/' % build_path,
'PYTHON=%s' % sys.executable,
'PYMAJOR=%s' % sys.version_info.major,
'clean',
'all',
'install',
]
def compile():
call(cmd)
build_path = os.path.abspath(
os.path.dirname(self.get_ext_fullpath(ext.name)))
call(['cp', '%s/ifdhc/lib/python/ifdh.so' % build_path, '%s/ifdh.so' % build_path])
self.execute(compile, [], 'Compiling ifdhc')
# copy resulting tool to library build folder
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='ifdhc',
version='2.8.0',
description='Intensity Frontier Data Handling',
maintainer='Marc Mengel',
maintainer_email='mengel@fnal.gov',
license='BSD',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD',
'Operating System :: Unix',
'Programming Language :: C++',
'Topic :: Scientific/Engineering :: Information Analysis',
],
headers= ['ifdh/ifdh.h', 'util/WimpyConfigParser.h','util/utils.h'],
cmdclass={
'build_ext': ifdhBuild,
},
ext_modules=[MakeExtension('ifdh')],
scripts=[ 'ifdh/demo.sh', 'ifdh/ifdh_copyback.sh', 'ifdh/www_cp.sh', 'ifdh/xrdwrap.sh', 'ifdh/ifdh' ],
data_files=[
('etc',['ifdh.cfg']),
],
)