diff options
| author | 2012-12-12 20:15:48 -0300 | |
|---|---|---|
| committer | 2012-12-12 20:15:48 -0300 | |
| commit | 0f2c04e70a0ffdd0892d6970cafbcd952d221db5 (patch) | |
| tree | d36f7747c4b9cb5c5e00cae5b137d22214b1c7be /setup.py | |
| parent | ca1f5a392261a7c6b82b5ac1015427605909d8c9 (diff) | |
Imported Upstream version 5upstream/5
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 50 |
1 files changed, 44 insertions, 6 deletions
@@ -7,18 +7,23 @@ # http://www.opensource.org/licenses/mit-license.php import os +import subprocess import sys from fnmatch import fnmatchcase from distutils.util import convert_path +from distutils.command.install import install dependencies = [ - 'doit>=0.16.1', + 'doit>=0.18.1', 'pygments', 'pillow', 'docutils', 'mako>=0.6', 'unidecode', - 'lxml'] + 'lxml', + 'yapsy', + 'configparser', +] # Provided as an attribute, so you can append to these instead # of replicating them: @@ -27,6 +32,34 @@ standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info') +def install_manpages(prefix): + man_pages = [ + ('docs/man/nikola.1', 'share/man/man1/nikola.1'), + ] + join = os.path.join + normpath = os.path.normpath + for src, dst in man_pages: + path_dst = join(normpath(prefix), normpath(dst)) + try: + os.makedirs(os.path.dirname(path_dst)) + except OSError: + pass + rst2man_cmd = ['rst2man.py', 'rst2man'] + for rst2man in rst2man_cmd: + try: + subprocess.call([rst2man, src, path_dst]) + except OSError: + continue + else: + break + + +class nikola_install(install): + def run(self): + install.run(self) + install_manpages(self.prefix) + + def find_package_data( where='.', package='', exclude=standard_exclude, @@ -109,15 +142,20 @@ def find_package_data( from distutils.core import setup setup(name='Nikola', - version='4.0.3', + version='5', description='Static blog/website generator', author='Roberto Alsina and others', author_email='ralsina@netmanagers.com.ar', url='http://nikola.ralsina.com.ar/', packages=['nikola'], - scripts=['scripts/nikola', 'scripts/nikola_check', 'scripts/nikola_import_wordpress'], + scripts=['scripts/nikola'], install_requires=dependencies, package_data=find_package_data(), - data_files=['docs/manual.txt', - 'docs/theming.txt'], + cmdclass={'install': nikola_install}, + data_files=[ + ('share/doc/nikola', [ + 'docs/manual.txt', + 'docs/theming.txt', + 'docs/extending.txt']), + ], ) |
