-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (61 loc) · 2.64 KB
/
setup.py
File metadata and controls
69 lines (61 loc) · 2.64 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
# Copyright (C) 2007-2022 Manu Garg.
# Author: Manu Garg <manugarg@gmail.com>
#
# pacparser is a library that provides methods to parse proxy auto-config
# (PAC) files. Please read README file included with this package for more
# information about this library.
#
# pacparser is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# pacparser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
"""
Wrapper script around python module Makefiles. This script take care of
identifying python setup and setting up some environment variables needed by
Makefiles.
"""
import sys
import os
from setuptools import setup
from distutils.core import Extension
def main():
pacparser_version = os.environ.get('PACPARSER_VERSION', '1.0.0')
extra_objects = ['pacparser.o', 'libjs.a']
libraries = []
extra_link_args = []
if sys.platform == 'win32':
extra_objects = ['../pacparser.o', '../spidermonkey/js.lib']
libraries = ['ws2_32']
if 'mingw32' in sys.argv or '--compiler=mingw32' in sys.argv:
extra_link_args = ['-static-libgcc']
else:
extra_objects.extend(['libgcc.a', 'legacy_stdio_definitions.lib'])
pacparser_module = Extension('_pacparser',
include_dirs = ['../spidermonkey/js/src', '..'],
sources = ['pacparser_py.c'],
libraries = libraries,
extra_link_args = extra_link_args,
extra_objects = extra_objects)
setup (name = 'pacparser',
version = pacparser_version,
description = 'Pacparser package',
author = 'Manu Garg',
author_email = 'manugarg@gmail.com',
url = 'http://github.com/pacparser/pacparser',
long_description = 'python library to parse proxy auto-config (PAC) '
'files.',
package_data = {'': ['pacparser.o', 'libjs.a']},
license = 'LGPL',
ext_package = 'pacparser',
ext_modules = [pacparser_module],
py_modules = ['pacparser.__init__'])
if __name__ == '__main__':
main()