forked from mydeco-dev-team/xappy
/
setup.py
executable file
·123 lines (107 loc) · 4.5 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python
#
# Copyright (C) 2007 Lemur Consulting Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Setup script for xappy extension module.
"""
import sys
# Use setuptools if we're part of a larger build system which is already using
# it.
if ('setuptools' in sys.modules):
import setuptools
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
using_setuptools = True
else:
import distutils
from distutils.core import setup, Extension
from distutils import sysconfig
using_setuptools = False
# Customise compiler options.
if using_setuptools:
try:
setuptools_build_ext = build_ext.build_extension
def my_build_ext(self, ext):
"""Remove the -Wstrict-prototypes option from the compiler command.
This option isn't supported for C++, so we remove it to avoid annoying
warnings.
"""
try:
self.compiler.compiler_so.remove('-Wstrict-prototypes')
except (AttributeError, ValueError):
pass
retval = setuptools_build_ext(self, ext)
return retval
build_ext.build_extension = my_build_ext
except AttributeError:
pass
else:
distutils_customize_compiler = sysconfig.customize_compiler
def my_customize_compiler(compiler):
"""Remove the -Wstrict-prototypes option from the compiler command.
This option isn't supported for C++, so we remove it to avoid annoying
warnings.
"""
retval = distutils_customize_compiler(compiler)
try:
compiler.compiler_so.remove('-Wstrict-prototypes')
except (AttributeError, ValueError):
pass
return retval
sysconfig.customize_compiler = my_customize_compiler
# Extra arguments for setup() which we don't always want to supply.
extra_kwargs = {}
if using_setuptools:
extra_kwargs['test_suite'] = "test.make_all_suite"
long_description = """
The "xappy" python module is an easy-to-use interface to the Xapian search
engine. Xapian provides a low level interface, dealing with terms and
documents, but not really worrying about where terms come from, or how to build
searches to match the way in which data has been indexed. In contrast, "xappy"
allows you to design a field structure, specifying what kind of information is
held in particular fields, and then uses this field structure to index data
appropriately, and to build and perform searches.
Xappy is not yet stable - in particular, both the API and database format will
change in future releases. If you wish to use it, we recommend that you
subscribe to the xappy-discuss mailing list (see
http://groups.google.com/group/xappy-discuss) to keep up-to-date with changes
to Xappy.
"""
setup(name = "xappy",
version = "0.6.0", # update this in xappy/__init__.py, too. FIXME - get automatically
author = "Richard Boulton",
author_email = "richard@lemurconsulting.com",
maintainer = "Richard Boulton",
maintainer_email = "richard@lemurconsulting.com",
url = "http://code.google.com/p/xappy",
download_url = "http://xappy.googlecode.com/files/xappy-0.6.0.tar.gz",
description = "Easy-to-use interface to the Xapian search engine",
long_description = long_description,
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Programming Language :: C++',
'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
'Operating System :: MacOS',
'Operating System :: Microsoft',
'Operating System :: POSIX',
],
license = 'GPL',
platforms = 'Any',
packages = ['xappy', 'xappy.cachemanager'],
package_dir = {'xappy': 'xappy'},
**extra_kwargs)