[695] | 1 | #! /usr/bin/env python |
---|
[1144] | 2 | # -*- coding: ISO-8859-15 -*- |
---|
[695] | 3 | # |
---|
| 4 | # PyKota |
---|
| 5 | # |
---|
[952] | 6 | # PyKota : Print Quotas for CUPS and LPRng |
---|
[695] | 7 | # |
---|
[2028] | 8 | # (c) 2003, 2004, 2005 Jerome Alet <alet@librelogiciel.com> |
---|
[873] | 9 | # This program is free software; you can redistribute it and/or modify |
---|
| 10 | # it under the terms of the GNU General Public License as published by |
---|
| 11 | # the Free Software Foundation; either version 2 of the License, or |
---|
| 12 | # (at your option) any later version. |
---|
[695] | 13 | # |
---|
[873] | 14 | # This program is distributed in the hope that it will be useful, |
---|
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | # GNU General Public License for more details. |
---|
| 18 | # |
---|
| 19 | # You should have received a copy of the GNU General Public License |
---|
| 20 | # along with this program; if not, write to the Free Software |
---|
[2303] | 21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
[695] | 22 | # |
---|
| 23 | # $Id$ |
---|
| 24 | # |
---|
[2028] | 25 | # |
---|
[695] | 26 | |
---|
| 27 | import sys |
---|
| 28 | import glob |
---|
| 29 | import os |
---|
[884] | 30 | import shutil |
---|
[996] | 31 | try : |
---|
| 32 | from distutils.core import setup |
---|
[997] | 33 | except ImportError, msg : |
---|
| 34 | sys.stderr.write("%s\n" % msg) |
---|
[996] | 35 | sys.stderr.write("You need the DistUtils Python module.\nunder Debian, you may have to install the python-dev package.\nOf course, YMMV.\n") |
---|
| 36 | sys.exit(-1) |
---|
[695] | 37 | |
---|
| 38 | sys.path.insert(0, "pykota") |
---|
| 39 | from pykota.version import __version__, __doc__ |
---|
| 40 | |
---|
| 41 | data_files = [] |
---|
| 42 | mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) |
---|
| 43 | for mofile in mofiles : |
---|
| 44 | lang = mofile.split(os.sep)[1] |
---|
| 45 | directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"]) |
---|
| 46 | data_files.append((directory, [ mofile ])) |
---|
[839] | 47 | |
---|
[1592] | 48 | docdir = "share/doc/pykota" |
---|
[1307] | 49 | docfiles = ["README", "FAQ", "SECURITY", "COPYING", "LICENSE", "CREDITS", "TODO", "NEWS"] |
---|
[1297] | 50 | data_files.append((docdir, docfiles)) |
---|
[1279] | 51 | |
---|
[1307] | 52 | docfiles = glob.glob(os.sep.join(["docs", "*.pdf"])) |
---|
[1658] | 53 | docfiles += glob.glob(os.sep.join(["docs", "*.sx?"])) |
---|
[1307] | 54 | data_files.append((docdir, docfiles)) |
---|
| 55 | |
---|
| 56 | docfiles = glob.glob(os.sep.join(["docs", "spanish", "*.pdf"])) |
---|
| 57 | docfiles += glob.glob(os.sep.join(["docs", "spanish", "*.sxw"])) |
---|
| 58 | data_files.append((os.path.join(docdir, "spanish"), docfiles)) |
---|
| 59 | |
---|
| 60 | docfiles = glob.glob(os.sep.join(["docs", "pykota", "*.html"])) |
---|
| 61 | data_files.append((os.path.join(docdir, "html"), docfiles)) |
---|
| 62 | |
---|
[1658] | 63 | docfiles = glob.glob(os.sep.join(["openoffice", "*.sx?"])) |
---|
[1307] | 64 | docfiles += glob.glob(os.sep.join(["openoffice", "*.png"])) |
---|
| 65 | docfiles += glob.glob(os.sep.join(["openoffice", "README"])) |
---|
| 66 | data_files.append((os.path.join(docdir, "openoffice"), docfiles)) |
---|
| 67 | |
---|
[1905] | 68 | data_files.append((os.path.join(docdir, "postgresql"), ["initscripts/postgresql/README.postgresql"])) |
---|
| 69 | data_files.append((os.path.join(docdir, "ldap"), ["initscripts/ldap/README.ldap"])) |
---|
| 70 | |
---|
[839] | 71 | directory = os.sep.join(["share", "man", "man1"]) |
---|
| 72 | manpages = glob.glob(os.sep.join(["man", "*.1"])) |
---|
| 73 | data_files.append((directory, manpages)) |
---|
[695] | 74 | |
---|
[1829] | 75 | modirs = [ os.path.split(os.path.split(mof)[0])[1] for mof in mofiles ] |
---|
| 76 | for dir in modirs : |
---|
| 77 | directory = os.sep.join(["share", "man", dir, "man1"]) |
---|
| 78 | manpages = glob.glob(os.sep.join(["man", dir, "*.1"])) |
---|
| 79 | data_files.append((directory, manpages)) |
---|
| 80 | |
---|
[1345] | 81 | directory = os.sep.join(["share", "pykota"]) |
---|
[2383] | 82 | data_files.append((directory, ["checkdeps.py", "bin/cupspykota", \ |
---|
| 83 | "bin/lprngpykota", "bin/waitprinter.sh", \ |
---|
| 84 | "bin/papwaitprinter.sh", \ |
---|
| 85 | "bin/mailandpopup.sh", \ |
---|
| 86 | "contributed/pagecount.pl", \ |
---|
| 87 | "contributed/dump_bfd.php", \ |
---|
| 88 | "untested/pjl/pagecount.pjl", \ |
---|
| 89 | "untested/pjl/status.pjl", \ |
---|
| 90 | "untested/netatalk/netatalk.sh", \ |
---|
| 91 | "untested/netatalk/pagecount.ps"])) |
---|
[1345] | 92 | |
---|
[1905] | 93 | data_files.append((os.sep.join([directory, "conf"]), ["conf/README", "conf/pykota.conf.sample", "conf/pykotadmin.conf.sample"])) |
---|
| 94 | |
---|
[2175] | 95 | data_files.append((os.sep.join([directory, "cgi-bin"]), ["cgi-bin/README", "cgi-bin/printquota.cgi", "cgi-bin/dumpykota.cgi", "cgi-bin/pykotme.cgi"])) |
---|
[1905] | 96 | |
---|
[1911] | 97 | data_files.append((os.sep.join([directory, "logos"]), glob.glob(os.sep.join(["logos", "*.jpeg"])) + glob.glob(os.sep.join(["logos", "*.png"])) + glob.glob(os.sep.join(["logos", "*.xcf"])))) |
---|
[1907] | 98 | |
---|
[1905] | 99 | pgdirectory = os.sep.join([directory, "postgresql"]) |
---|
| 100 | data_files.append((pgdirectory, ["initscripts/postgresql/README.postgresql", "initscripts/postgresql/pykota-postgresql.sql"])) |
---|
| 101 | |
---|
| 102 | ldapdirectory = os.sep.join([directory, "ldap"]) |
---|
| 103 | data_files.append((ldapdirectory, ["initscripts/ldap/README.ldap", "initscripts/ldap/pykota.schema", "initscripts/ldap/pykota-sample.ldif"])) |
---|
| 104 | |
---|
[695] | 105 | setup(name = "pykota", version = __version__, |
---|
| 106 | license = "GNU GPL", |
---|
| 107 | description = __doc__, |
---|
| 108 | author = "Jerome Alet", |
---|
| 109 | author_email = "alet@librelogiciel.com", |
---|
| 110 | url = "http://www.librelogiciel.com/software/", |
---|
[1483] | 111 | packages = [ "pykota", "pykota.storages", "pykota.loggers", "pykota.accounters", "pykota.reporters" ], |
---|
[2413] | 112 | scripts = [ "bin/pkturnkey", "bin/pkbcodes", "bin/pkmail", "bin/pkbanner", "bin/autopykota", "bin/dumpykota", "bin/pykosd", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters", "bin/pkhint" ], |
---|
[695] | 113 | data_files = data_files) |
---|