d497bf1a7d2d2fd8f7e925828994251f7bf2ae7c
[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 setuptools import setup, find_packages
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.8.3',
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=find_packages(where="src"),
32     package_dir={"": "src"},
33     package_data={'librarian': ['xslt/*.xslt', 'xslt/*.xml', 'epub/*', 'pdf/*', 'fb2/*', 'fonts/*'] +
34                                 whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'res') +
35                                 whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'font-optimizer') +
36                                 whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'locale')},
37     include_package_data=True,
38     install_requires=[
39         'lxml>=2.2,<=4.3',
40         'Pillow',
41         'six',
42         'texml',
43         'ebooklib',
44     ],
45     entry_points = {
46         "console_scripts": [
47             "librarian=librarian.command_line:main"
48         ]
49     },
50     scripts=['scripts/book2html',
51              'scripts/book2txt',
52              'scripts/book2epub',
53              'scripts/book2mobi',
54              'scripts/book2pdf',
55              'scripts/book2fb2',
56              'scripts/book2partner',
57              'scripts/book2cover',
58              'scripts/bookfragments',
59              'scripts/genslugs'],
60 )