~epidermis/epidermis/debian

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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python
# 2008-2009 copyright David D Lowe
# released under the GPL v3

from distutils.core import setup
import os, sys
import glob
from subprocess import call   


def main():
    
    data_files = glob.glob("epidermis/data/*")  # data_files a list of strings
    # of the relative paths of all non-py files that should be included
    # ex: data_files is ['epidermis/data/creator.glade', 'epidermis/data/epidermis.glade', ...]
    
    if os.path.exists(os.path.join(os.path.dirname(__file__),"convenience_scripts/translate.py")):
        if "build" in sys.argv[1:2]:
            # generate the .mo files from the existing .po files
            call(["python", "convenience_scripts/translate.py", "--generate-mo", "--ignore-bzr"],cwd=os.path.join(os.path.dirname(os.path.realpath(__file__))))
    else:
        print >> sys.stderr, "could not find %s" % os.path.join(os.path.dirname(__file__), "convenience_scripts/translate.py")
        raise()
    if "clean" in sys.argv[1:2]:
        for lang in os.listdir("po"):
            if os.path.isdir(os.path.join("po",lang,"LC_MESSAGES")):
                call(["rm","-r",os.path.join("po",lang)])

    mo_files = []
    # mo_files is a list of tuples, each tuple containing one string specifying the location and a list of files
    # to be installed in that location
    # eg: [('/usr/share/locale/en_GB/LC_MESSAGES', ['po/en_GB/LC_MESSAGES/epidermis.mo'])
    for lang in os.listdir("po"):
        if os.path.isdir(os.path.join("po", lang, "LC_MESSAGES")):
            if len(glob.glob(os.path.join("po",lang,"LC_MESSAGES","*.mo"))) <= 0:
                print >> sys.stderr, "could not find %s" % os.path.join("po",lang,"LC_MESSAGES","*.mo")
                raise()
            mo_files.append((os.path.join("/usr/share/locale", lang, "LC_MESSAGES"), glob.glob(os.path.join("po", lang, "LC_MESSAGES") + "/*.mo")))
    
    
    # similar to mo_files but for docbooks   
    docbooks = []
    omfs = []
    for lang in os.listdir("help"):
        if os.path.isdir(os.path.join("help", lang)): # this includes C
            docbooks.append((os.path.join("/usr/share/gnome/help/epidermis", lang), glob.glob(os.path.join("help", lang) + "/*.xml")))
            omfs.extend(glob.glob(os.path.join("help",lang) + "/*.omf"))
            if os.path.isdir(os.path.join("help",lang,"images")):
                docbooks.append((os.path.join("/usr/share/gnome/help/epidermis",lang,"images"), glob.glob(os.path.join("help",lang,"images") + "/*")))
    if len(omfs) > 0:
        docbooks.append(('/usr/share/omf/epidermis',omfs))
    
    # Epidermis version        
    try:
        sys.path.insert(0, ".")
        import epidermis.const
        constPath = os.path.abspath(epidermis.const.__file__)
        if constPath[-4:] in (".pyc", ".pyo"):
            constPath = constPath[:-1]
        if not os.path.samefile(constPath, os.path.join(os.path.dirname(os.path.abspath(__file__)),"epidermis/const.py")):
            print >> sys.stderr, "could not import %s" % os.path.join(os.path.dirname(os.path.abspath(__file__)), "epidermis/const.py")
            raise()
    except:
        print >> sys.stderr, "Could not find version, because python couldn't import epidermis.const"
        raise
    
    # Check python version
    if sys.version < '2.5':
        class IncorrectPythonVersion():
            def __str__(self): return "Incorrect python version, need 2.5 or later"
        raise(IncorrectPythonVersion())
    
    setup( name="epidermis", # this should start with a lowercase letter 
        #so that it can be used as a debian package name later on
    version=epidermis.const.VERSION, # string, version of your program, not python version
    description="Epidermis theme manager for your GNOME desktop on Ubuntu", # short
    author="David D Lowe",
    author_email="daviddlowesemail@find-me-at-epidermis.tuxfamily.org",
    url="http://epidermis.tuxfamily.org", # home page for end-users
    license="GPL v2",
    packages=["epidermis", "epidermis.pigments"], # python packages, not debian packages
    data_files=[('share/epidermis/data/', data_files), 
        ('share/applications', ['linux/epidermis.desktop']),
        ('/usr/share/pixmaps', ['epidermis/data/epidermis.svg']),
        ('/usr/share/icons/gnome/scalable/mimetypes', ['linux/gnome-mime-application-x-pigment.svg']),
        ('/usr/share/icons/gnome/32x32/mimetypes', ['linux/gnome-mime-application-x-pigment.png']),
        ('/usr/share/gconf/schemas', ['linux/epidermis.schemas']), \
        ('share/mime/packages/', ['linux/epidermis.xml'])] \
         + mo_files \
         + docbooks, # data_files is a list of tuples
            # each tuple contaning an installation path and a list of data files
    scripts=["runner/epidermis"], # the script that should be run and installed in /usr/bin
    classifiers=["Development Status :: 5 - Production/Stable", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: POSIX :: Linux"],
        # a bunch of optional tags, a list of classifiers can be found at http://pypi.python.org/pypi?:action=list_classifiers
    long_description="""Epidermis changes the appearance of your Ubuntu GNOME desktop in all its aspects in one click. Epidermis 'skins' change the appearance of your desktop wallpaper, Metacity windows border theme, your GTK controls theme, your icon theme, your mouse cursor theme, your GRUB bootsplash screen, your GDM login screen theme and your Usplash boot splash image.
Each of these customisations are downloaded in 'pigments' which are available from an Epidermis 'repository'.
Epidermis was written in python with pygtk.
Find more information at http://epidermis.tuxfamily.org and https://launchpad.net/epidermis/""")

if __name__ == "__main__":
    main()