aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py50
1 files changed, 44 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 12951eb..33beae5 100644
--- a/setup.py
+++ b/setup.py
@@ -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']),
+ ],
)