File: setup.py

package info (click to toggle)
driconf 0.9.1-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 456 kB
  • ctags: 270
  • sloc: python: 2,804; makefile: 35
file content (75 lines) | stat: -rw-r--r-- 2,363 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from distutils.core import setup

langs = ["de", "es", "it", "ru", "nl"]
translations = []
for lang in langs:
    translations.append (("share/locale/%s/LC_MESSAGES" % lang,
                          ["%s/LC_MESSAGES/driconf.mo" % lang]))

setup(name="driconf",
      version="0.9.1",
      description="A configuration applet for DRI drivers",
      author="Felix Kuehling",
      author_email="fxkuehl@gmx.de",
      url="http://dri.freedesktop.org/wiki/DriConf",
      py_modules=["dri", "driconf", "driconf_commonui", "driconf_complexui",
                  "driconf_simpleui"],
      scripts=["driconf"],
      data_files=[("share/driconf", ["card.png", "screen.png", "screencard.png",
                                     "drilogo.jpg", "driconf-icon.png"])
                  ] + translations)

#
# Search for obsolete files.
#
# driconf_xpm is gone for good, the other two python modules were moved to
# <prefix>/lib/driconf/...
#
from os.path import isfile, isdir, join
from distutils.sysconfig import get_python_lib
obsoleteFiles = []
for prefix in [None, "/usr/local"]:
    if not prefix:
        pyLibPath = get_python_lib()
    else:
        pyLibPath = get_python_lib(prefix=prefix)
    if not isdir (pyLibPath):
        continue
    for f in ["driconf_xpm.py", "driconf_xpm.pyc", "driconf_xpm.pyo",
              "driconf.py", "driconf.pyc", "driconf.pyo",
              "dri.py", "dri.pyc", "dri.pyo"]:
        path = join (pyLibPath, f)
        if isfile (path):
            obsoleteFiles.append (path)
if obsoleteFiles:
    print "\n*** Obsolete files from previous DRIconf versions were found on " \
          "your system.\n*** Unless you tweaked setup.cfg you can probably " \
          "delete them:"
    for f in obsoleteFiles:
        print "***\t%s" % f

#
# Check if required packages are installed
#
errors = 0
try:
    import pygtk
    pygtk.require ("2.0")
    import gtk
except:
    print "\n*** Warning: importing GTK version 2 doesn't work."
    errors = 1
else:
    if gtk.check_version(2, 4, 0):
        print "\n*** Warning: DRIconf requires GTK 2.4 or newer."
        errors = 1
try:
    import xml.parsers.expat
except:
    if not errors:
        print
    print "*** Warning: importing xml.parsers.expat doesn't work."
    errors = 1

if errors:
    print "*** Warning: DRIconf will probably not work for the above reason(s)."