forked from 4teamwork/collective.zopeedit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
91 lines (82 loc) · 3.18 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# ZopeEdit, client for ExternalEditor
#
##############################################################################
from setuptools import setup, find_packages
import os
import sys
import glob
opj = os.path.join
# Open the VERSION file for reading.
try:
f=open('docs/VERSION.txt', 'r')
except IOError:
# zopeedit is not properly installed : try uninstalled path
f=open('../../docs/VERSION.txt', 'r') # Open the VERSION file for reading.
# Below, "[:-1]" means we omit the last character, which is "\n".
version = f.readline()[:-1]
f.close
try:
import py2exe
except ImportError:
if sys.platform == 'win32':
raise
install_requires = ['setuptools']
if sys.platform == 'darwin':
install_requires.extend([
'pyobjc-core',
'pyobjc-framework-LaunchServices',
])
packages = find_packages(exclude=['ez_setup'])
def data_files():
'''Build list of data files to be installed'''
files = []
files.append((opj('share','man','man1',''),['collective/zopeedit/man/zopeedit.1']))
files.append((opj('share','mime','package'),['collective/zopeedit/posix/x-zope-edit-zem.xml']))
files.append((opj('share','applications'),['collective/zopeedit/posix/zopeedit.desktop']))
files.append((opj('share','icons'),['collective/zopeedit/posix/zopeedit.svg']))
files.append((opj('collective','zopeedit', 'docs'), [f for
f in glob.glob('docs/*') if os.path.isfile(f)]))
files.append((opj('collective','zopeedit','docs'),['README.txt']))
files.append((opj('collective','zopeedit'),['collective/zopeedit/win32/ZopeEdit.ini']))
return files
setup(name='collective.zopeedit',
app=[os.path.join('collective', 'zopeedit', 'zopeedit.py')],
version=version,
description="ZopeEdit : External Editor Client",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Programming Language :: Python",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Zope Public License",
],
keywords='zope plone externaleditor zopeedit edition',
author='Thierry Benita - atReal',
author_email='[email protected]',
url='http://svn.plone.org/svn/collective/collective.zopeedit/',
license='ZPL',
packages=packages,
namespace_packages=['collective'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
entry_points = {
'console_scripts': [
'zopeedit = collective.zopeedit.zopeedit:main',
]
},
data_files = data_files(),
windows=[{
'script': os.path.join('collective','zopeedit','zopeedit.py'),
'icon_resources': [(1, os.path.join('collective','zopeedit','win32','zopeedit.ico'))]
}],
options={"py2exe": {"packages": ["encodings", "Plugins", "win32com"]},
"py2app" : {'argv_emulation':True},
},
)