Permalink
Browse files

build okascore.so, change license, ignore derived

  • Loading branch information...
1 parent 349600b commit 9416a341a04c3f185a022d14eae2e1ad6ab3bee7 @mcdonc mcdonc committed Jun 16, 2012
Showing with 100 additions and 53 deletions.
  1. +8 −8 .gitignore
  2. +3 −1 COPYRIGHT.txt
  3. +44 −41 LICENSE.txt
  4. +1 −0 hypatia/indexes/text/.gitignore
  5. +44 −3 setup.py
View
@@ -1,17 +1,17 @@
-env26/
*.egg
*.egg-info
*.pyc
*$py.class
.coverage
dist/
*~
-.tox
+.tox/
nosetests.xml
-repoze/catalog/coverage.xml
+hypatia/coverage.xml
distribute-*.gz
-env
-.build
-bin
-include
-lib
+env*/
+.build/
+bin/
+include/
+lib/
+build/
View
@@ -1,3 +1,5 @@
-Copyright (c) 2012 Agendaless Consulting and Contributors.
+(c) 2012 Zope Foundation and Contributors
+
+Portions copyright (c) 2012 Agendaless Consulting.
(http://www.agendaless.com), All Rights Reserved
View
@@ -1,41 +1,44 @@
-License
-
- A copyright notice accompanies this license document that identifies
- the copyright holders.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
- 1. Redistributions in source code must retain the accompanying
- copyright notice, this list of conditions, and the following
- disclaimer.
-
- 2. Redistributions in binary form must reproduce the accompanying
- copyright notice, this list of conditions, and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- 3. Names of the copyright holders must not be used to endorse or
- promote products derived from this software without prior
- written permission from the copyright holders.
-
- 4. If any files are modified, you must cause the modified files to
- carry prominent notices stating that you changed the files and
- the date of any change.
-
- Disclaimer
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND
- ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
+Zope Public License (ZPL) Version 2.1
+
+A copyright notice accompanies this license document that identifies the
+copyright holders.
+
+This license has been certified as open source. It has also been designated as
+GPL compatible by the Free Software Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions in source code must retain the accompanying copyright
+notice, this list of conditions, and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying copyright
+notice, this list of conditions, and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to endorse or promote
+products derived from this software without prior written permission from the
+copyright holders.
+
+4. The right to distribute this software or to use it for any purpose does not
+give you the right to use Servicemarks (sm) or Trademarks (tm) of the
+copyright
+holders. Use of them is covered by separate agreement with the copyright
+holders.
+
+5. If any files are modified, you must cause the modified files to carry
+prominent notices stating that you changed the files and the date of any
+change.
+
+Disclaimer
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
+okascore.so
View
@@ -15,8 +15,44 @@
__version__ = '0.0'
import os
+import sys
+
+from setuptools import setup, find_packages, Extension
+from distutils.command.build_ext import build_ext
+from distutils.errors import CCompilerError
+from distutils.errors import DistutilsExecError
+from distutils.errors import DistutilsPlatformError
+
+class optional_build_ext(build_ext):
+ """This class subclasses build_ext and allows
+ the building of C extensions to fail.
+ """
+ def run(self):
+ try:
+ build_ext.run(self)
+
+ except DistutilsPlatformError, e:
+ self._unavailable(e)
+
+ def build_extension(self, ext):
+ try:
+ build_ext.build_extension(self, ext)
+
+ except (CCompilerError, DistutilsExecError), e:
+ self._unavailable(e)
+
+ def _unavailable(self, e):
+ print >> sys.stderr, '*' * 80
+ print >> sys.stderr, """WARNING:
+
+ An optional code optimization (C extension) could not be compiled.
+
+ Optimizations for this package will not be available!"""
+ print >> sys.stderr
+ print >> sys.stderr, e
+ print >> sys.stderr, '*' * 80
+
-from setuptools import setup, find_packages
try:
here = os.path.abspath(os.path.dirname(__file__))
@@ -43,10 +79,10 @@
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
],
keywords='indexing catalog search',
- author="Chris McDonough, Agendaless Consulting",
+ author="Zope Foundation and Contributors",
author_email="pylons-discuss@googlegroups.com",
url="http://pylonsproject.org",
- license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
+ license="ZPL 2.1",
packages=find_packages(),
include_package_data=True,
zip_safe=False,
@@ -57,6 +93,11 @@
'testing': testing_extras,
'docs':docs_extras,
},
+ ext_modules=[
+ Extension('hypatia.indexes.text.okascore',
+ [os.path.join('hypatia', 'indexes', 'text', 'okascore.c')]),
+ ],
+ cmdclass = {'build_ext':optional_build_ext},
test_suite="hypatia",
## entry_points = """\
## [console_scripts]

0 comments on commit 9416a34

Please sign in to comment.