9c8120c25851b3cf4375a683d54adcd9c270e3d5
[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 Wolne Lektury. See NOTICE for more information.
6 #
7 import os
8 import os.path
9 from setuptools import setup, find_packages
10
11
12 def whole_tree(prefix, path):
13     files = []
14     for f in (f for f in os.listdir(os.path.join(prefix, path)) if not f[0]=='.'):
15         new_path = os.path.join(path, f)
16         if os.path.isdir(os.path.join(prefix, new_path)):
17             files.extend(whole_tree(prefix, new_path))
18         else:
19             files.append(new_path)
20     return files
21
22
23 setup(
24     name='librarian',
25     version='23.07',
26     description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats',
27     author="Marek Stępniowski",
28     author_email='marek@stepniowski.com',
29     maintainer='Radek Czajka',
30     maintainer_email='radekczajka@wolnelektury.pl',
31     url='http://github.com/fnp/librarian',
32     packages=find_packages(where="src"),
33     package_dir={"": "src"},
34     package_data={'librarian': ['xslt/*.xslt', 'pdf/*', 'fb2/*', 'fonts/*'] +
35                                 whole_tree(os.path.join(os.path.dirname(__file__), 'src/librarian'), 'res') +
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,<5.0',
40         'Pillow>=9.1.0',
41         'texml',
42         'ebooklib',
43         'aeneas',
44         'mutagen',
45         'qrcode',
46         'requests',
47         'fonttools',
48     ],
49     entry_points = {
50         "console_scripts": [
51             "librarian=librarian.command_line:main"
52         ]
53     },
54     scripts=['scripts/book2html',
55              'scripts/book2txt',
56              'scripts/book2pdf',
57              'scripts/book2fb2',
58              'scripts/book2cover',
59              ],
60 )