Skip to content

Commit e666329

Browse files
committed
drop CR line endings.
1 parent 8fcf601 commit e666329

File tree

1 file changed

+122
-122
lines changed

1 file changed

+122
-122
lines changed

setup.py

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,122 @@
1-
#!/usr/bin/env python
2-
#
3-
# Copyright (c) 2015, SmartFile <[email protected]>
4-
# All rights reserved.
5-
#
6-
# Redistribution and use in source and binary forms, with or without
7-
# modification, are permitted provided that the following conditions are met:
8-
# * Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
10-
# * Redistributions in binary form must reproduce the above copyright
11-
# notice, this list of conditions and the following disclaimer in the
12-
# documentation and/or other materials provided with the distribution.
13-
# * Neither the name of the organization nor the
14-
# names of its contributors may be used to endorse or promote products
15-
# derived from this software without specific prior written permission.
16-
#
17-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18-
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21-
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22-
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24-
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26-
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27-
28-
from os import environ
29-
30-
try:
31-
from setuptools import setup, Extension
32-
from setuptools.command.build_ext import build_ext
33-
except ImportError:
34-
from distutils.core import setup, Extension
35-
from distutils.command.build_ext import build_ext
36-
37-
38-
39-
# Use a provided libarchive else default to hard-coded path.
40-
libarchivePrefix = environ.get('LIBARCHIVE_PREFIX')
41-
42-
if libarchivePrefix:
43-
includePath = libarchivePrefix + '/include'
44-
else:
45-
includePath = '/usr/local/include'
46-
47-
48-
49-
50-
name = 'python-libarchive'
51-
version = '4.2.0'
52-
readme = 'README.rst'
53-
repourl = 'https://github.com/smartfile/python-libarchive'
54-
long_description = open(readme).read()
55-
56-
57-
class build_ext_extra(build_ext, object):
58-
"""
59-
Extend build_ext allowing extra_compile_args and extra_link_args to be set
60-
on the command-line.
61-
"""
62-
63-
user_options = build_ext.user_options
64-
user_options.append(('extra-compile-args=', None, 'Extra arguments passed directly to the compiler'))
65-
user_options.append(('extra-link-args=', None, 'Extra arguments passed directly to the linker'))
66-
67-
def initialize_options(self):
68-
build_ext.initialize_options(self)
69-
self.extra_compile_args = None
70-
self.extra_link_args = None
71-
72-
def build_extension(self, ext):
73-
if self.extra_compile_args:
74-
ext.extra_compile_args.append(self.extra_compile_args)
75-
if self.extra_link_args:
76-
ext.extra_link_args.append(self.extra_link_args)
77-
super(build_ext_extra, self).build_extension(ext)
78-
79-
80-
if libarchivePrefix:
81-
extra_compile_args = ['-I{0}/include'.format(libarchivePrefix)]
82-
extra_link_args = ['-Wl,-rpath,{0}/lib'.format(libarchivePrefix)]
83-
environ['LDFLAGS'] = '-L{0}/lib {1}'.format(libarchivePrefix, environ.get('LDFLAGS', ''))
84-
else:
85-
extra_compile_args = []
86-
extra_link_args = ['-l:libarchive.so']
87-
88-
__libarchive = Extension(
89-
name='libarchive.__libarchive',
90-
sources=['libarchive/_libarchive_wrap.c'],
91-
libraries=['archive'],
92-
extra_compile_args=extra_compile_args,
93-
extra_link_args=extra_link_args,
94-
include_dirs=[includePath, 'libarchive'],
95-
)
96-
97-
98-
setup(
99-
name=name,
100-
version=version,
101-
description='A libarchive wrapper for Python supporting password protection.',
102-
long_description=long_description,
103-
license='BSD-style license',
104-
platforms=['any'],
105-
author='Vadim Lebedev, Ben Timby, Travis Cunningham, Ryan Johnston, SmartFile',
106-
author_email='[email protected]',
107-
url=repourl,
108-
packages=['libarchive'],
109-
classifiers=[
110-
'Development Status :: 5 - Production/Stable',
111-
'Intended Audience :: Developers',
112-
'Operating System :: OS Independent',
113-
'Programming Language :: C',
114-
'Programming Language :: Python',
115-
'Topic :: System :: Archiving :: Compression',
116-
'Topic :: Software Development :: Libraries :: Python Modules',
117-
],
118-
cmdclass={
119-
'build_ext': build_ext_extra,
120-
},
121-
ext_modules=[__libarchive],
122-
)
1+
#!/usr/bin/env python
2+
#
3+
# Copyright (c) 2015, SmartFile <[email protected]>
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
# * Redistributions of source code must retain the above copyright
9+
# notice, this list of conditions and the following disclaimer.
10+
# * Redistributions in binary form must reproduce the above copyright
11+
# notice, this list of conditions and the following disclaimer in the
12+
# documentation and/or other materials provided with the distribution.
13+
# * Neither the name of the organization nor the
14+
# names of its contributors may be used to endorse or promote products
15+
# derived from this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21+
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
from os import environ
29+
30+
try:
31+
from setuptools import setup, Extension
32+
from setuptools.command.build_ext import build_ext
33+
except ImportError:
34+
from distutils.core import setup, Extension
35+
from distutils.command.build_ext import build_ext
36+
37+
38+
39+
# Use a provided libarchive else default to hard-coded path.
40+
libarchivePrefix = environ.get('LIBARCHIVE_PREFIX')
41+
42+
if libarchivePrefix:
43+
includePath = libarchivePrefix + '/include'
44+
else:
45+
includePath = '/usr/local/include'
46+
47+
48+
49+
50+
name = 'python-libarchive'
51+
version = '4.2.0'
52+
readme = 'README.rst'
53+
repourl = 'https://github.com/smartfile/python-libarchive'
54+
long_description = open(readme).read()
55+
56+
57+
class build_ext_extra(build_ext, object):
58+
"""
59+
Extend build_ext allowing extra_compile_args and extra_link_args to be set
60+
on the command-line.
61+
"""
62+
63+
user_options = build_ext.user_options
64+
user_options.append(('extra-compile-args=', None, 'Extra arguments passed directly to the compiler'))
65+
user_options.append(('extra-link-args=', None, 'Extra arguments passed directly to the linker'))
66+
67+
def initialize_options(self):
68+
build_ext.initialize_options(self)
69+
self.extra_compile_args = None
70+
self.extra_link_args = None
71+
72+
def build_extension(self, ext):
73+
if self.extra_compile_args:
74+
ext.extra_compile_args.append(self.extra_compile_args)
75+
if self.extra_link_args:
76+
ext.extra_link_args.append(self.extra_link_args)
77+
super(build_ext_extra, self).build_extension(ext)
78+
79+
80+
if libarchivePrefix:
81+
extra_compile_args = ['-I{0}/include'.format(libarchivePrefix)]
82+
extra_link_args = ['-Wl,-rpath,{0}/lib'.format(libarchivePrefix)]
83+
environ['LDFLAGS'] = '-L{0}/lib {1}'.format(libarchivePrefix, environ.get('LDFLAGS', ''))
84+
else:
85+
extra_compile_args = []
86+
extra_link_args = ['-l:libarchive.so']
87+
88+
__libarchive = Extension(
89+
name='libarchive.__libarchive',
90+
sources=['libarchive/_libarchive_wrap.c'],
91+
libraries=['archive'],
92+
extra_compile_args=extra_compile_args,
93+
extra_link_args=extra_link_args,
94+
include_dirs=[includePath, 'libarchive'],
95+
)
96+
97+
98+
setup(
99+
name=name,
100+
version=version,
101+
description='A libarchive wrapper for Python supporting password protection.',
102+
long_description=long_description,
103+
license='BSD-style license',
104+
platforms=['any'],
105+
author='Vadim Lebedev, Ben Timby, Travis Cunningham, Ryan Johnston, SmartFile',
106+
author_email='[email protected]',
107+
url=repourl,
108+
packages=['libarchive'],
109+
classifiers=[
110+
'Development Status :: 5 - Production/Stable',
111+
'Intended Audience :: Developers',
112+
'Operating System :: OS Independent',
113+
'Programming Language :: C',
114+
'Programming Language :: Python',
115+
'Topic :: System :: Archiving :: Compression',
116+
'Topic :: Software Development :: Libraries :: Python Modules',
117+
],
118+
cmdclass={
119+
'build_ext': build_ext_extra,
120+
},
121+
ext_modules=[__libarchive],
122+
)

0 commit comments

Comments
 (0)