File: setup.py

package info (click to toggle)
gdebi 0.1.6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 880 kB
  • ctags: 128
  • sloc: python: 1,047; makefile: 72
file content (52 lines) | stat: -rwxr-xr-x 1,595 bytes parent folder | download
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
#!/usr/bin/env python

from distutils.core import setup
import glob
import os
import re

# look/set what version we have
changelog = "debian/changelog"
if os.path.exists(changelog):
    head=open(changelog).readline()
    match = re.compile(".*\((.*)\).*").match(head)
    if match:
        version = match.group(1)
        f=open("GDebi/Version.py","w")
        f.write("VERSION=\"%s\"\n" % version)
        f.close()


GETTEXT_NAME="gdebi"
I18NFILES = []
for filepath in glob.glob("po/mo/*/LC_MESSAGES/*.mo"):
    lang = filepath[len("po/mo/"):]
    targetpath = os.path.dirname(os.path.join("share/locale",lang))
    I18NFILES.append((targetpath, [filepath]))

# we should probably only run those os.system() stuff when "build" is
# the cmndline argument
os.system("intltool-merge -x po data/gdebi.xml.in"\
                       " build/gdebi.xml")
os.system("intltool-merge -d po data/gdebi.desktop.in"\
                       " build/gdebi.desktop")
# HACK: make sure that the mo files are generated and up-to-date
os.system("cd po; make update-po")
    
setup(name='gdebi',
      version=version,
      packages=['GDebi'],
      scripts=['gdebi','gdebi-gtk'],
      data_files=[('share/gdebi/',
                   ["data/gdebi.glade"]),
                  ('share/applications',
                   ["build/gdebi.desktop"]),
                  ('share/application-registry',
		   ["data/gdebi.applications"]),
                  ('share/mime/packages/',
                   ["build/gdebi.xml"]),
                  ('share/pixmaps',
                   ["data/gdebi.png"])]+I18NFILES,
      )