[15] | 1 | import os
|
---|
[3] | 2 | from distutils.core import setup
|
---|
| 3 |
|
---|
[33] | 4 | # Yes, I'm ommiting windoze...
|
---|
| 5 | BSDs = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFlyBSD']
|
---|
| 6 | linux = ['Linux']
|
---|
| 7 | osx = ['Darwin']
|
---|
| 8 |
|
---|
[15] | 9 | def proper_etc_path():
|
---|
[33] | 10 | """
|
---|
| 11 | Try to set the proper path for configuration files, depending
|
---|
| 12 | on the operating system.
|
---|
| 13 |
|
---|
| 14 | FIXME: I'm not sure this would work fine, as this will be executed
|
---|
| 15 | when running python setup.py sdist, not when installing from the
|
---|
| 16 | source package.
|
---|
| 17 | """
|
---|
[15] | 18 | os_name = os.uname()[0]
|
---|
| 19 | if os_name in BSDs:
|
---|
| 20 | return '/usr/local/etc/'
|
---|
| 21 | if os_name in linux or os_name in osx:
|
---|
| 22 | return '/etc/'
|
---|
[33] | 23 | return ''
|
---|
| 24 |
|
---|
| 25 | def proper_rc_path():
|
---|
| 26 | """
|
---|
| 27 | Similar to proper_etc_path(), returns the path where startup scripts
|
---|
| 28 | should be placed
|
---|
| 29 | """
|
---|
| 30 | os_name = os.uname()[0]
|
---|
| 31 | etc_path = proper_etc_path()
|
---|
| 32 | if os_name in 'BSDs':
|
---|
| 33 | return etc_path+'rc.d'
|
---|
| 34 | if os_name in linux:
|
---|
| 35 | return etc_path+'init.d'
|
---|
| 36 | if os_name in osx:
|
---|
| 37 | # FIXME: not sure about where startup scripts should be placed in
|
---|
| 38 | # "stock" osx (no macports, no homebrew, etc)
|
---|
| 39 | return etc_path
|
---|
| 40 | return ''
|
---|
[15] | 41 |
|
---|
[3] | 42 | setup(
|
---|
[16] | 43 | name='mailjam',
|
---|
[33] | 44 | version='0.1.1',
|
---|
[3] | 45 | author='Francisco de Borja Lopez Rio',
|
---|
| 46 | author_email='borja@codigo23.net',
|
---|
[33] | 47 | packages=['mailjam'],
|
---|
[16] | 48 | url='https://bitbucket.org/codigo23/mailjam',
|
---|
[34] | 49 | download_url='http://pypi.python.org/pypi/mailjam#downloads',
|
---|
[30] | 50 | license='BSD licence, see LICENSE',
|
---|
[3] | 51 | description='Mailing lists management software',
|
---|
| 52 | long_description=open('README').read(),
|
---|
[23] | 53 | scripts=['bin/mailjam-server', 'bin/mailjam-mta', 'bin/mailjam-cli'],
|
---|
[30] | 54 | data_files=[(proper_etc_path()+'mailjam', ['conf/mailjam.conf',
|
---|
| 55 | 'conf/mailjam-mta.conf',
|
---|
[33] | 56 | 'conf/mailjam-cli.conf']),
|
---|
[34] | 57 | (proper_rc_path(), ['bin/rc.d/mailjam'])],
|
---|
| 58 | classifiers=[
|
---|
| 59 | 'Development Status :: 4 - Beta',
|
---|
| 60 | 'Environment :: Console',
|
---|
| 61 | 'Environment :: No Input/Output (Daemon)',
|
---|
| 62 | 'Intended Audience :: System Administrators',
|
---|
| 63 | 'License :: OSI Approved :: BSD License',
|
---|
| 64 | 'Natural Language :: English',
|
---|
| 65 | 'Operating System :: OS Independent',
|
---|
| 66 | 'Programming Language :: Python :: 2',
|
---|
| 67 | 'Topic :: Communications',
|
---|
| 68 | 'Topic :: Communications :: Email',
|
---|
| 69 | 'Topic :: Communications :: Email :: Mailing List Servers',
|
---|
| 70 | ]
|
---|
[3] | 71 | )
|
---|