# HG changeset patch # User Peter Sanchez # Date 1291678572 28800 # Mon Dec 06 15:36:12 2010 -0800 # Node ID a7b67455f9a14f35be5ca6da73973f16dd50e0c9 # Parent 4bd10335d97231f0ccbfc369952e527e1d583d6d Updated setup.py and added BSD-LICENSE diff --git a/BSD-LICENSE b/BSD-LICENSE new file mode 100644 --- /dev/null +++ b/BSD-LICENSE @@ -0,0 +1,32 @@ +Copyright (c) 2009, Peter Sanchez +All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the +following conditions are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + * Neither the name of Peter Sanchez nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS 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 +HOLDER OR CONTRIBUTORS 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. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -1,12 +1,36 @@ +import os from distutils.core import setup + +project_name = 'cartfreakapi' long_description = open('README').read() +# Idea from django-registration setup.py +packages, data_files = [], [] +root_dir = os.path.dirname(__file__) +if root_dir: + os.chdir(root_dir) + +for dirpath, dirnames, filenames in os.walk(project_name): + # Ignore dirnames that start with '.' + for i, dirname in enumerate(dirnames): + if dirname.startswith('.'): + del dirnames[i] + if '__init__.py' in filenames: + pkg = dirpath.replace(os.path.sep, '.') + if os.path.altsep: + pkg = pkg.replace(os.path.altsep, '.') + packages.append(pkg) + elif filenames: + prefix = dirpath[(len(project_name) + 1):] + for f in filenames: + data_files.append(os.path.join(prefix, f)) + setup( name='cartfreakapi', version="0.1", - package_dir={'cartfreakapi': 'cartfreakapi'}, - packages=['cartfreakapi',], + package_dir={project_name: project_name}, + packages=packages, description='Django CartFreak API Handler', author='Peter Sanchez', author_email='petersanchez@gmail.com', @@ -21,6 +45,6 @@ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Environment :: Any Environment', + 'Environment :: Web Environment', ], )