10abe6e4c4b82d99baceb8c84aed371f055b8a56
[librarian.git] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 #
7 import os
8 import os.path
9 from distutils.core import setup
10
11 def whole_tree(prefix, path):
12     files = []
13     for f in (f for f in os.listdir(os.path.join(prefix, path)) if not f[0]=='.'):
14         new_path = os.path.join(path, f)
15         if os.path.isdir(os.path.join(prefix, new_path)):
16             files.extend(whole_tree(prefix, new_path))
17         else:
18             files.append(new_path)
19     return files
20
21
22 setup(
23     name='librarian',
24     version='1.6',
25     description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats',
26     author="Marek Stępniowski",
27     author_email='marek@stepniowski.com',
28     maintainer='Radek Czajka',
29     maintainer_email='radoslaw.czajka@nowoczesnapolska.org.pl',
30     url='http://github.com/fnp/librarian',
31     packages=['librarian', 'librarian.embeds'],
32     package_data={'librarian': ['xslt/*.xslt', 'epub/*', 'mobi/*', 'pdf/*', 'fb2/*', 'fonts/*'] +
33                                 whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'res') +
34                                 whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'font-optimizer')},
35     include_package_data=True,
36     install_requires=[
37         'lxml>=2.2',
38         'Pillow',
39     ],
40     scripts=['scripts/book2html',
41              'scripts/book2txt',
42              'scripts/book2epub',
43              'scripts/book2mobi',
44              'scripts/book2pdf',
45              'scripts/book2fb2',
46              'scripts/book2partner',
47              'scripts/book2cover',
48              'scripts/bookfragments',
49              'scripts/genslugs'],
50     tests_require=['nose>=0.11', 'coverage>=3.0.1'],
51 )