2 # -*- coding: utf-8 -*-
4 # taken from straw http://www.nongnu.org/straw/index.html
5 # taken from gnomolicious http://www.nongnu.org/gnomolicious/
6 # adapted by Nicolas Évrard <nicoe@altern.org>
15 from distutils.core import setup, Command
16 from distutils.command.install_scripts import install_scripts
17 from distutils.file_util import copy_file
19 from stat import ST_MODE
23 name = 'tinyerp-server'
26 # get python short version
27 py_short_version = '%s.%s' % sys.version_info[:2]
30 'account', 'account_followup', 'account_tax_include', 'airport', 'audittrail',
31 'base','base_partner_relation', 'base_setup', 'crm', 'custom', 'delivery',
32 'edi', 'esale_ez', 'esale_joomla', 'esale_osc',
33 'hr', 'hr_evaluation', 'hr_expense', 'hr_skill', 'hr_timesheet',
34 'hr_timesheet_ical', 'hr_timesheet_invoice', 'hr_timesheet_project',
35 'letter', 'marketing', 'mrp', 'network', 'partner_ldap',
36 'product','product_electronic', 'product_expiry', 'product_extended',
37 'productivity_analysis', 'product_variant', 'profile_accounting',
38 'profile_manufacturing', 'profile_service', 'project', 'purchase',
39 'purchase_tax_include', 'report_analytic_line', 'report_crm',
41 'report_project', 'report_purchase', 'report_sale', 'sale', 'sale_crm',
42 'sale_journal', 'sale_rebate', 'sale_tax_include', 'sandwich', 'scrum',
43 'stock', 'subscription', 'travel',
44 'l10n_be', 'l10n_ca-qc', 'l10n_ch', 'l10n_ch_pcpbl_association',
45 'l10n_ch_pcpbl_independant', 'l10n_ch_pcpbl_menage',
46 'l10n_ch_pcpbl_plangen', 'l10n_ch_pcpbl_plangensimpl', 'l10n_ch_vat_brut',
47 'l10n_ch_vat_forfait', 'l10n_ch_vat_net', 'l10n_fr', 'l10n_se',
48 'l10n_simple', 'l10n_chart_at', 'l10n_chart_au', 'l10n_chart_be_frnl',
49 'l10n_chart_br', 'l10n_chart_ca_en', 'l10n_chart_ca_fr',
50 'l10n_chart_ch_german', 'l10n_chart_cn', 'l10n_chart_cn_traditional',
51 'l10n_chart_co', 'l10n_chart_cz', 'l10n_chart_da', 'l10n_chart_de_skr03',
52 'l10n_chart_hu', 'l10n_chart_id', 'l10n_chart_it', 'l10n_chart_it_cc2424',
53 'l10n_chart_la', 'l10n_chart_nl', 'l10n_chart_nl_standard', 'l10n_chart_no',
54 'l10n_chart_pa', 'l10n_chart_pl', 'l10n_chart_sp', 'l10n_chart_sw',
55 'l10n_chart_sw_church', 'l10n_chart_sw_food', 'l10n_chart_uk',
56 'l10n_chart_us_general', 'l10n_chart_us_manufacturing',
57 'l10n_chart_us_service', 'l10n_chart_us_ucoa', 'l10n_chart_us_ucoa_ez',
62 required_modules = [('psycopg', 'PostgreSQL module'),
63 ('xml', 'XML Tools for python'),
64 ('libxml2', 'libxml2 python bindings'),
65 ('libxslt', 'libxslt python bindings')]
69 for modname, desc in required_modules:
71 exec('import %s' % modname)
74 print 'Error: python module %s (%s) is required' % (modname, desc)
80 for addon in included_addons:
81 path = opj('bin', 'addons', addon)
82 for dirpath, dirnames, filenames in os.walk(path):
83 if '__init__.py' in filenames:
84 modname = dirpath.replace(os.path.sep, '.')
85 yield modname.replace('bin', 'tinyerp-server', 1)
88 '''Build list of data files to be installed'''
89 files = [(opj('share', 'man', 'man1'),
90 ['man/tinyerp-server.1']),
91 (opj('share', 'man', 'man5'),
92 ['man/terp_serverrc.5']),
93 (opj('share','doc', 'tinyerp-server-%s' % version),
94 [f for f in glob.glob('doc/*') if os.path.isfile(f)]),
95 (opj('share','doc', 'tinyerp-server-%s' % version, 'migrate', '3.3.0-3.4.0'),
96 [f for f in glob.glob('doc/migrate/3.3.0-3.4.0/*') if os.path.isfile(f)]),
97 (opj('share','doc', 'tinyerp-server-%s' % version, 'migrate', '3.4.0-4.0.0'),
98 [f for f in glob.glob('doc/migrate/3.4.0-4.0.0/*') if os.path.isfile(f)]),
99 (opj('lib','python%s' % py_short_version, 'site-packagess', 'tinyerp-server', 'i18n'),
100 glob.glob('bin/i18n/*')),
101 (opj('lib', 'python%s' % py_short_version, 'site-packages', 'tinyerp-server', 'addons', 'custom'),
102 glob.glob('bin/addons/custom/*xml') +
103 glob.glob('bin/addons/custom/*rml') +
104 glob.glob('bin/addons/custom/*xsl'))]
105 for addon in find_addons():
106 add_path = addon.replace('.', os.path.sep).replace('tinyerp-server', 'bin',
108 pathfiles = [(opj('lib', 'python%s' % py_short_version, 'site-packages',
109 add_path.replace('bin', 'tinyerp-server', 1)),
110 glob.glob(opj(add_path, '*xml')) +
111 glob.glob(opj(add_path, '*csv')) +
112 glob.glob(opj(add_path, '*sql'))),
113 (opj('lib', 'python%s' % py_short_version, 'site-packages',
114 add_path.replace('bin', 'tinyerp-server', 1), 'data'),
115 glob.glob(opj(add_path, 'data', '*xml'))),
116 (opj('lib', 'python%s' % py_short_version, 'site-packages',
117 add_path.replace('bin', 'tinyerp-server', 1), 'report'),
118 glob.glob(opj(add_path, 'report', '*xml')) +
119 glob.glob(opj(add_path, 'report', '*rml')) +
120 glob.glob(opj(add_path, 'report', '*xsl')))]
121 files.extend(pathfiles)
125 Tiny ERP is a complete ERP and CRM. The main features are accounting (analytic
126 and financial), stock management, sales and purchases management, tasks
127 automation, marketing campaigns, help desk, POS, etc. Technical features include
128 a distributed server, flexible workflows, an object database, a dynamic GUI,
129 customizable reports, and SOAP and XML-RPC interfaces.
133 Development Status :: 5 - Production/Stable
134 License :: OSI Approved :: GNU General Public License (GPL)
135 Programming Language :: Python
140 # create startup script
143 cd %s/lib/python%s/site-packages/tinyerp-server\n\
144 exec %s ./tinyerp-server.py $@" % (sys.prefix, py_short_version, sys.executable)
146 f = open('tinyerp-server', 'w')
147 f.write(start_script)
152 description = "Tiny's Enterprise Resource Planning",
153 long_description = long_desc,
154 url = 'http://tinyerp.com',
156 author_email = 'info@tiny.be',
157 classifiers = filter(None, classifiers.split("\n")),
159 data_files = data_files(),
160 packages = ['tinyerp-server', 'tinyerp-server.addons',
162 'tinyerp-server.osv',
163 'tinyerp-server.ssl',
164 'tinyerp-server.service', 'tinyerp-server.tools',
165 'tinyerp-server.pychart', 'tinyerp-server.pychart.afm',
166 'tinyerp-server.report',
167 'tinyerp-server.report.printscreen',
168 'tinyerp-server.report.render',
169 'tinyerp-server.report.render.rml2pdf',
170 'tinyerp-server.report.render.rml2html',
171 'tinyerp-server.wizard', 'tinyerp-server.workflow'] + \
173 package_dir = {'tinyerp-server': 'bin'},
174 scripts = ['tinyerp-server']
177 # vim:expandtab:tw=80