1 | #! /usr/bin/env python |
---|
2 | # |
---|
3 | # PyKota |
---|
4 | # |
---|
5 | # PyKota : Print Quotas for CUPS |
---|
6 | # |
---|
7 | # (c) 2003 Jerome Alet <alet@librelogiciel.com> |
---|
8 | # You're welcome to redistribute this software under the |
---|
9 | # terms of the GNU General Public Licence version 2.0 |
---|
10 | # or, at your option, any higher version. |
---|
11 | # |
---|
12 | # You can read the complete GNU GPL in the file COPYING |
---|
13 | # which should come along with this software, or visit |
---|
14 | # the Free Software Foundation's WEB site http://www.fsf.org |
---|
15 | # |
---|
16 | # $Id$ |
---|
17 | # |
---|
18 | # $Log$ |
---|
19 | # Revision 1.3 2003/03/26 17:48:36 jalet |
---|
20 | # First shot at trying to detect the availability of the needed software |
---|
21 | # during the installation. |
---|
22 | # |
---|
23 | # Revision 1.2 2003/03/09 16:49:04 jalet |
---|
24 | # The installation script installs the man pages too now. |
---|
25 | # |
---|
26 | # Revision 1.1 2003/02/05 21:28:17 jalet |
---|
27 | # Initial import into CVS |
---|
28 | # |
---|
29 | # |
---|
30 | # |
---|
31 | |
---|
32 | import sys |
---|
33 | import glob |
---|
34 | import os |
---|
35 | from distutils.core import setup |
---|
36 | |
---|
37 | sys.path.insert(0, "pykota") |
---|
38 | from pykota.version import __version__, __doc__ |
---|
39 | |
---|
40 | if "install" in sys.argv : |
---|
41 | sys.stderr.write("PygreSQL availability : ") |
---|
42 | try : |
---|
43 | import pg |
---|
44 | except ImportError : |
---|
45 | sys.stderr.write("No ! Installation aborted.\n") |
---|
46 | sys.exit(-1) |
---|
47 | else : |
---|
48 | del pg |
---|
49 | sys.stderr.write("OK.\n") |
---|
50 | sys.stderr.write("snmpget availability : ") |
---|
51 | result = os.popen("type snmpget") |
---|
52 | snmpget = result.read().strip() |
---|
53 | result.close() |
---|
54 | if not snmpget : |
---|
55 | sys.stderr.write("No ! Installation aborted.\n") |
---|
56 | sys.exit(-1) |
---|
57 | else : |
---|
58 | sys.stderr.write("OK.\n") |
---|
59 | |
---|
60 | data_files = [] |
---|
61 | mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) |
---|
62 | for mofile in mofiles : |
---|
63 | lang = mofile.split(os.sep)[1] |
---|
64 | directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"]) |
---|
65 | data_files.append((directory, [ mofile ])) |
---|
66 | |
---|
67 | directory = os.sep.join(["share", "man", "man1"]) |
---|
68 | manpages = glob.glob(os.sep.join(["man", "*.1"])) |
---|
69 | data_files.append((directory, manpages)) |
---|
70 | |
---|
71 | setup(name = "pykota", version = __version__, |
---|
72 | license = "GNU GPL", |
---|
73 | description = __doc__, |
---|
74 | author = "Jerome Alet", |
---|
75 | author_email = "alet@librelogiciel.com", |
---|
76 | url = "http://www.librelogiciel.com/software/", |
---|
77 | packages = [ "pykota", "pykota.storages", "pykota.requesters", "pykota.loggers" ], |
---|
78 | scripts = [ "bin/pykota", "bin/edpykota", "bin/repykota", "bin/warnpykota" ], |
---|
79 | data_files = data_files) |
---|