setup.py :  » ERP » frePPLe » frepple-0.8.0 » contrib » installer » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » ERP » frePPLe 
frePPLe » frepple 0.8.0 » contrib » installer » setup.py
#!/usr/bin/env python

#
# Copyright (C) 2007 by Johan De Taeye
#
# This library 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.
#
# This library 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
#

# file : $URL: https://frepple.svn.sourceforge.net/svnroot/frepple/tags/0.8.0/contrib/installer/setup.py $
# revision : $LastChangedRevision: 1011 $  $LastChangedBy: jdetaeye $
# date : $LastChangedDate: 2009-08-05 12:59:02 +0200 (Wed, 05 Aug 2009) $

import sys, os, os.path
sys.path.append(os.path.join(os.path.split(__file__)[0],'..','django'))
import py2exe, django, freppledb
from distutils.core import setup
from freppledb.manage import *

# Add default command lines
if len(sys.argv) == 1:
    sys.argv.append("py2exe")

# Figure out where the django and frepple directories are
djangodirectory = django.__path__[0]
freppledirectory = freppledb.__path__[0]

# Define what is to be included and excluded
packages = [# Required for django standalone deployment
            'django', 'freppledb', 'email', 'cherrypy.wsgiserver',
            # Added for MySQL
            'MySQLdb', 'MySQLdb.constants', 'MySQLdb.converters',
            # Added for PostgreSQL
            'psycopg2', 'psycopg2.extensions',
            # Added for oracle
            'cx_Oracle',
            # Required for the python initialization
            'site',
            # Added to package a more complete python library with frepple
            'ftplib', 'poplib', 'imaplib', 'telnetlib', 'xmlrpclib',
            'gzip', 'bz2','zipfile', 'tarfile', 'SimpleXMLRPCServer',
            # Added for unicode and internationalization
            'encodings',
           ]
includes = ['django.contrib.auth',
            'django.contrib.sessions',
            'django.contrib.sites',
           ]
excludes = ['pydoc','Tkinter', 'tcl', 'Tkconstants',
            ]
ignores = [# Not using docutils
           'docutils', 'docutils.core', 'docutils.nodes', 'docutils.parsers.rst.roles',
           # Not using Microsoft ADO
           'adodbapi',
           # Not using psycopg (using psycopg2 instead)
           'psycopg',
           # Not using pysqlite2 (using pysqlite3 instead)
           'pysqlite2',
           # Not using mod_python
           'mod_python', 'mod_python.util',
           # Not using email functionality
           'email.Encoders', 'email.Errors', 'email.Generator',
           'email.Iterators', 'email.MIMEBase', 'email.MIMEMultipart',
           'email.MIMEText', 'email.Message','email.MIMEMultipart',
           'email.Parser', 'email.Utils', 'email.base64MIME', 'email.Charset',
           'email.MIMEAudio', 'email.MIMEImage', 'email.MIMEMessage',
           'email.quopriMIME', 'email.Header',
           # Not using memcache
           'cmemcache', 'memcache',
           # Not using markdown tags of django
           'markdown', 'textile',
           # Not using WSCGI
           'flup', 'flup.server.fcgi', 'flup.server.fcgi_fork',
           # Not using ImageFields
           'PIL', 'ImageFile',
           # Not needing special datetime handling
           'mx',
           # Not using yaml serialization      'frepple'
           'yaml',
           # Not storing templates in python eggs
           'pkg_resources', 'resource',
           # Not using the python interactive interpreter
           'IPython',
           # Not sure where django references these...
           'crypt',
           # Not using SSL
           'OpenSSL',
           # Not needed to include frepple's python interface
           'frepple',
           ]

# Collect all static files to be included in the distribution
from distutils.command.install import INSTALL_SCHEMES
for scheme in INSTALL_SCHEMES.values(): scheme['data'] = scheme['purelib']
data_files = []
for srcdir, targetdir in [
   (os.path.join(djangodirectory,'contrib','admin','templates'), 'templates1'),
   (os.path.join(djangodirectory,'contrib','admin','media'), 'media'),
   (os.path.join(djangodirectory,'conf','locale'), os.path.join('conf','locale')),
   (os.path.join(freppledirectory,'templates'), 'templates2'),
   (os.path.join(freppledirectory,'static'), 'static'),
   (os.path.join(freppledirectory,'locale'), 'locale'),
   (os.path.join(freppledirectory,'execute'), 'execute'),
   (os.path.join(freppledirectory,'input','fixtures'), os.path.join('fixtures','input')),
   (os.path.join(freppledirectory,'common','fixtures'), os.path.join('fixtures','common')),
   ]:
   root_path_length = len(srcdir) + 1
   for dirpath, dirnames, filenames in os.walk(os.path.join(srcdir)):
     # Ignore dirnames that start with '.'
     for i, dirname in enumerate(dirnames):
       if dirname.startswith('.'): del dirnames[i]
     # Append data files for this subdirectory
     data_files.append([
       os.path.join(targetdir, dirpath[root_path_length:]),
       [os.path.join(dirpath, f) for f in filenames]
       ])

# Run the py2exe program
setup(
    # Options
    options = {"py2exe": {
          # create a compressed zip archive
          "compressed": 1,
          # optimize the bytecode
          "optimize": 2,
          # content of the packaged python
          "packages": packages,
          "excludes": excludes,
          "includes": includes,
          "ignores": ignores,
          }},
    data_files = data_files,
    # Attributes
    version = settings.FREPPLE_VERSION.split('-',1)[0].split(' ',1)[0],
    description = "frePPLe web application",
    name = "frePPLe",
    author = "www.frepple.com",
    url = "http://www.frepple.com",
    # Targets to build
    console = [ {
       "script": "manage.py",
       "icon_resources": [(1, "frepple.ico")]
       }, ],
    # Name of the zip file with the bytecode of the Python library.
    # This zip file with the name mentioned below is automatically included
    # in the Python search path (while the default output file "library.zip"
    # isn't)
    zipfile = "python%d%d.zip" % (sys.version_info[0], sys.version_info[1])
    )
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.