root / pykota / trunk / setup.py @ 2654

Revision 2638, 5.4 kB (checked in by matt, 19 years ago)

Initial MySQL support

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#! /usr/bin/env python
2# -*- coding: ISO-8859-15 -*-
3#
4# PyKota
5#
6# PyKota : Print Quotas for CUPS and LPRng
7#
8# (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com>
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.
13#
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
21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22#
23# $Id$
24#
25#
26
27import sys
28import glob
29import os
30import shutil
31try :
32    from distutils.core import setup
33except ImportError, msg :   
34    sys.stderr.write("%s\n" % msg)
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)
37
38sys.path.insert(0, "pykota")
39from pykota.version import __version__, __doc__
40
41data_files = []
42mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"]))
43for 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 ]))
47   
48docdir = "share/doc/pykota"   
49docfiles = ["README", "FAQ", "SECURITY", "COPYING", "LICENSE", "CREDITS", "TODO", "NEWS"]
50data_files.append((docdir, docfiles))
51
52docfiles = glob.glob(os.sep.join(["docs", "*.pdf"]))
53docfiles += glob.glob(os.sep.join(["docs", "*.sx?"]))
54data_files.append((docdir, docfiles))
55
56docfiles = glob.glob(os.sep.join(["docs", "spanish", "*.pdf"]))
57docfiles += glob.glob(os.sep.join(["docs", "spanish", "*.sxw"]))
58data_files.append((os.path.join(docdir, "spanish"), docfiles))
59
60docfiles = glob.glob(os.sep.join(["docs", "pykota", "*.html"]))
61data_files.append((os.path.join(docdir, "html"), docfiles))
62
63docfiles = glob.glob(os.sep.join(["openoffice", "*.sx?"]))
64docfiles += glob.glob(os.sep.join(["openoffice", "*.png"]))
65docfiles += glob.glob(os.sep.join(["openoffice", "README"]))
66data_files.append((os.path.join(docdir, "openoffice"), docfiles))
67
68data_files.append((os.path.join(docdir, "postgresql"), ["initscripts/postgresql/README.postgresql"]))
69data_files.append((os.path.join(docdir, "ldap"), ["initscripts/ldap/README.ldap"]))
70data_files.append((os.path.join(docdir, "mysql"), ["initscripts/mysql/README.mysql"]))
71
72directory = os.sep.join(["share", "man", "man1"])
73manpages = glob.glob(os.sep.join(["man", "*.1"]))   
74data_files.append((directory, manpages))
75
76modirs = [ os.path.split(os.path.split(mof)[0])[1] for mof in mofiles ]
77for dir in modirs :
78    directory = os.sep.join(["share", "man", dir, "man1"])
79    manpages = glob.glob(os.sep.join(["man", dir, "*.1"]))   
80    data_files.append((directory, manpages))
81
82directory = os.sep.join(["share", "pykota"])
83data_files.append((directory, ["checkdeps.py", "bin/cupspykota", \
84                               "bin/waitprinter.sh", \
85                               "bin/papwaitprinter.sh", \
86                               "bin/mailandpopup.sh", \
87                               "contributed/pagecount.pl", \
88                               "contributed/dump_bfd.php", \
89                               "untested/pjl/pagecount.pjl", \
90                               "untested/pjl/status.pjl", \
91                               "untested/netatalk/netatalk.sh", \
92                               "untested/netatalk/pagecount.ps"]))
93
94data_files.append((os.sep.join([directory, "conf"]), ["conf/README", "conf/pykota.conf.sample", "conf/pykotadmin.conf.sample"]))
95
96data_files.append((os.sep.join([directory, "cgi-bin"]), ["cgi-bin/README", "cgi-bin/printquota.cgi", "cgi-bin/dumpykota.cgi", "cgi-bin/pykotme.cgi"]))
97
98data_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"]))))
99
100data_files.append((os.sep.join([directory, "stylesheets"]), glob.glob(os.sep.join(["stylesheets", "*.css"])) + [ "stylesheets/README" ]))
101
102pgdirectory = os.sep.join([directory, "postgresql"])
103data_files.append((pgdirectory, ["initscripts/postgresql/README.postgresql", "initscripts/postgresql/pykota-postgresql.sql"]))
104
105ldapdirectory = os.sep.join([directory, "ldap"])
106data_files.append((ldapdirectory, ["initscripts/ldap/README.ldap", "initscripts/ldap/pykota.schema", "initscripts/ldap/pykota-sample.ldif"]))
107
108mysqldirectory = os.sep.join([directory, "mysql"])
109data_files.append((mysqldirectory, ["initscripts/mysql/README.mysql", "initscripts/mysql/pykota-mysql.sql"]))
110
111os.umask(022)
112setup(name = "pykota", version = __version__,
113      license = "GNU GPL",
114      description = __doc__,
115      author = "Jerome Alet",
116      author_email = "alet@librelogiciel.com",
117      url = "http://www.librelogiciel.com/software/",
118      packages = [ "pykota", "pykota.storages", "pykota.loggers", "pykota.accounters", "pykota.reporters" ],
119      scripts = [ "bin/pykoef", "bin/pkturnkey", "bin/pkbcodes", "bin/pkmail", "bin/pkbanner", "bin/autopykota", "bin/dumpykota", "bin/pykosd", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters" ],
120      data_files = data_files)
Note: See TracBrowser for help on using the browser.