1 | #! /usr/bin/env python |
---|
2 | # -*- coding: ISO-8859-15 -*- |
---|
3 | # |
---|
4 | # pkpgcounter : a generic Page Description Language parser |
---|
5 | # |
---|
6 | # (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com> |
---|
7 | # This program is free software; you can redistribute it and/or modify |
---|
8 | # it under the terms of the GNU General Public License as published by |
---|
9 | # the Free Software Foundation; either version 2 of the License, or |
---|
10 | # (at your option) any later version. |
---|
11 | # |
---|
12 | # This program is distributed in the hope that it will be useful, |
---|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | # GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License |
---|
18 | # along with this program; if not, write to the Free Software |
---|
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
20 | # |
---|
21 | # $Id$ |
---|
22 | # |
---|
23 | # |
---|
24 | |
---|
25 | import sys |
---|
26 | import glob |
---|
27 | import os |
---|
28 | import shutil |
---|
29 | try : |
---|
30 | from distutils.core import setup |
---|
31 | except ImportError, msg : |
---|
32 | sys.stderr.write("%s\n" % msg) |
---|
33 | sys.stderr.write("You need the DistUtils Python module.\nunder Debian, you may have to install the python-dev package.\nOf course, YMMV.\n") |
---|
34 | sys.exit(-1) |
---|
35 | |
---|
36 | try : |
---|
37 | from PIL import Image |
---|
38 | except ImportError : |
---|
39 | sys.stderr.write("You need the Python Imaging Library (aka PIL).\nYou can grab it from http://www.pythonware.com\n") |
---|
40 | sys.exit(-1) |
---|
41 | |
---|
42 | try : |
---|
43 | import psyco |
---|
44 | except ImportError : |
---|
45 | sys.stderr.write("WARN: If you are running on a 32 Bits x86 platform, you should install the Python Psyco module if possible, this would greatly speedup parsing. NB : Psyco doesn't work on other platforms, so don't worry if you're in this case.\n") |
---|
46 | |
---|
47 | sys.path.insert(0, "pkpgpdls") |
---|
48 | from pkpgpdls.version import __version__, __doc__ |
---|
49 | |
---|
50 | data_files = [] |
---|
51 | mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) |
---|
52 | for mofile in mofiles : |
---|
53 | lang = mofile.split(os.sep)[1] |
---|
54 | directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"]) |
---|
55 | data_files.append((directory, [ mofile ])) |
---|
56 | |
---|
57 | docdir = "share/doc/pkpgcounter" |
---|
58 | docfiles = ["README", "COPYING", "BUGS", "CREDITS", "NEWS"] |
---|
59 | data_files.append((docdir, docfiles)) |
---|
60 | |
---|
61 | directory = os.sep.join(["share", "man", "man1"]) |
---|
62 | manpages = glob.glob(os.sep.join(["man", "*.1"])) |
---|
63 | data_files.append((directory, manpages)) |
---|
64 | |
---|
65 | setup(name = "pkpgcounter", version = __version__, |
---|
66 | license = "GNU GPL", |
---|
67 | description = __doc__, |
---|
68 | author = "Jerome Alet", |
---|
69 | author_email = "alet@librelogiciel.com", |
---|
70 | url = "http://www.librelogiciel.com/software/", |
---|
71 | packages = [ "pkpgpdls" ], |
---|
72 | scripts = [ "bin/pkpgcounter" ], |
---|
73 | data_files = data_files) |
---|