[198] | 1 | #! /usr/bin/env python |
---|
[3436] | 2 | # -*- coding: utf-8 -*- |
---|
[198] | 3 | # |
---|
| 4 | # pkpgcounter : a generic Page Description Language parser |
---|
| 5 | # |
---|
[3474] | 6 | # (c) 2003-2009 Jerome Alet <alet@librelogiciel.com> |
---|
[463] | 7 | # This program is free software: you can redistribute it and/or modify |
---|
[198] | 8 | # it under the terms of the GNU General Public License as published by |
---|
[463] | 9 | # the Free Software Foundation, either version 3 of the License, or |
---|
[198] | 10 | # (at your option) any later version. |
---|
[3436] | 11 | # |
---|
[198] | 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. |
---|
[3436] | 16 | # |
---|
[198] | 17 | # You should have received a copy of the GNU General Public License |
---|
[463] | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
[198] | 19 | # |
---|
| 20 | # $Id$ |
---|
| 21 | # |
---|
| 22 | # |
---|
| 23 | |
---|
| 24 | import sys |
---|
| 25 | import glob |
---|
| 26 | import os |
---|
| 27 | import shutil |
---|
| 28 | try : |
---|
| 29 | from distutils.core import setup |
---|
[3436] | 30 | except ImportError, msg : |
---|
[198] | 31 | sys.stderr.write("%s\n" % msg) |
---|
| 32 | sys.stderr.write("You need the DistUtils Python module.\nunder Debian, you may have to install the python-dev package.\nOf course, YMMV.\n") |
---|
| 33 | sys.exit(-1) |
---|
[3436] | 34 | |
---|
| 35 | try : |
---|
[289] | 36 | from PIL import Image |
---|
[3436] | 37 | except ImportError : |
---|
[289] | 38 | sys.stderr.write("You need the Python Imaging Library (aka PIL).\nYou can grab it from http://www.pythonware.com\n") |
---|
| 39 | sys.exit(-1) |
---|
[3436] | 40 | |
---|
[235] | 41 | sys.path.insert(0, "pkpgpdls") |
---|
| 42 | from pkpgpdls.version import __version__, __doc__ |
---|
[198] | 43 | |
---|
| 44 | data_files = [] |
---|
| 45 | mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) |
---|
| 46 | for mofile in mofiles : |
---|
| 47 | lang = mofile.split(os.sep)[1] |
---|
| 48 | directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"]) |
---|
| 49 | data_files.append((directory, [ mofile ])) |
---|
[3436] | 50 | |
---|
| 51 | docdir = "share/doc/pkpgcounter" |
---|
[3450] | 52 | docfiles = ["README", "COPYING", "BUGS", "CREDITS", "AUTHORS", "TODO"] |
---|
[198] | 53 | data_files.append((docdir, docfiles)) |
---|
| 54 | |
---|
[3450] | 55 | if os.path.exists("ChangeLog") : |
---|
| 56 | data_files.append((docdir, ["ChangeLog"])) |
---|
| 57 | |
---|
[198] | 58 | directory = os.sep.join(["share", "man", "man1"]) |
---|
[3436] | 59 | manpages = glob.glob(os.sep.join(["man", "*.1"])) |
---|
[198] | 60 | data_files.append((directory, manpages)) |
---|
| 61 | |
---|
| 62 | setup(name = "pkpgcounter", version = __version__, |
---|
| 63 | license = "GNU GPL", |
---|
| 64 | description = __doc__, |
---|
| 65 | author = "Jerome Alet", |
---|
| 66 | author_email = "alet@librelogiciel.com", |
---|
[336] | 67 | url = "http://www.pykota.com/software/pkpgcounter/", |
---|
[235] | 68 | packages = [ "pkpgpdls" ], |
---|
[198] | 69 | scripts = [ "bin/pkpgcounter" ], |
---|
| 70 | data_files = data_files) |
---|