Jean-Baptiste Queru | 6516b99 | 2011-02-04 14:12:08 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import sys, os |
| 4 | from distutils.core import setup |
| 5 | from distutils.command.install_scripts import install_scripts |
| 6 | |
| 7 | version = '2.0.3' |
| 8 | |
| 9 | class md_install_scripts(install_scripts): |
| 10 | """ Customized install_scripts. Create markdown.bat for win32. """ |
| 11 | def run(self): |
| 12 | install_scripts.run(self) |
| 13 | |
| 14 | if sys.platform == 'win32': |
| 15 | try: |
| 16 | script_dir = os.path.join(sys.prefix, 'Scripts') |
| 17 | script_path = os.path.join(script_dir, 'markdown') |
| 18 | bat_str = '@"%s" "%s" %%*' % (sys.executable, script_path) |
| 19 | bat_path = os.path.join(self.install_dir, 'markdown.bat') |
| 20 | f = file(bat_path, 'w') |
| 21 | f.write(bat_str) |
| 22 | f.close() |
| 23 | print 'Created:', bat_path |
| 24 | except Exception, e: |
| 25 | print 'ERROR: Unable to create %s: %s' % (bat_path, e) |
| 26 | |
| 27 | data = dict( |
| 28 | name = 'Markdown', |
| 29 | version = version, |
| 30 | url = 'http://www.freewisdom.org/projects/python-markdown', |
| 31 | download_url = 'http://pypi.python.org/packages/source/M/Markdown/Markdown-%s.tar.gz' % version, |
| 32 | description = 'Python implementation of Markdown.', |
| 33 | author = 'Manfred Stienstra and Yuri takhteyev', |
| 34 | author_email = 'yuri [at] freewisdom.org', |
| 35 | maintainer = 'Waylan Limberg', |
| 36 | maintainer_email = 'waylan [at] gmail.com', |
| 37 | license = 'BSD License', |
| 38 | packages = ['markdown', 'markdown.extensions'], |
| 39 | scripts = ['bin/markdown'], |
| 40 | cmdclass = {'install_scripts': md_install_scripts}, |
| 41 | classifiers = ['Development Status :: 5 - Production/Stable', |
| 42 | 'License :: OSI Approved :: BSD License', |
| 43 | 'Operating System :: OS Independent', |
| 44 | 'Programming Language :: Python', |
| 45 | 'Programming Language :: Python :: 2', |
| 46 | 'Programming Language :: Python :: 2.3', |
| 47 | 'Programming Language :: Python :: 2.4', |
| 48 | 'Programming Language :: Python :: 2.5', |
| 49 | 'Programming Language :: Python :: 2.6', |
| 50 | 'Programming Language :: Python :: 3', |
| 51 | 'Programming Language :: Python :: 3.0', |
| 52 | 'Topic :: Communications :: Email :: Filters', |
| 53 | 'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries', |
| 54 | 'Topic :: Internet :: WWW/HTTP :: Site Management', |
| 55 | 'Topic :: Software Development :: Documentation', |
| 56 | 'Topic :: Software Development :: Libraries :: Python Modules', |
| 57 | 'Topic :: Text Processing :: Filters', |
| 58 | 'Topic :: Text Processing :: Markup :: HTML', |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | if sys.version[:3] < '2.5': |
| 63 | data['install_requires'] = ['elementtree'] |
| 64 | |
| 65 | setup(**data) |