~artfwo/apturl/ubuntu

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Michael Vogt
  • Date: 2007-07-02 10:01:46 UTC
  • Revision ID: michael.vogt@ubuntu.com-20070702100146-p2uowzd69ytb7ft8
* add missing bits to make it build a package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
from distutils.core import setup
 
4
import glob
 
5
import os
 
6
import re
 
7
 
 
8
# look/set what version we have
 
9
changelog = "debian/changelog"
 
10
if os.path.exists(changelog):
 
11
    head=open(changelog).readline()
 
12
    match = re.compile(".*\((.*)\).*").match(head)
 
13
    if match:
 
14
        version = match.group(1)
 
15
        f=open("AptUrl/Version.py","w")
 
16
        f.write("VERSION=\"%s\"\n" % version)
 
17
        f.close()
 
18
 
 
19
 
 
20
GETTEXT_NAME="apturl"
 
21
I18NFILES = []
 
22
for filepath in glob.glob("po/mo/*/LC_MESSAGES/*.mo"):
 
23
    lang = filepath[len("po/mo/"):]
 
24
    targetpath = os.path.dirname(os.path.join("share/locale",lang))
 
25
    I18NFILES.append((targetpath, [filepath]))
 
26
 
 
27
setup(name='apturl',
 
28
      version=version,
 
29
      packages=['AptUrl'],
 
30
      scripts=['apturl'],
 
31
      data_files=[('share/apturl/',
 
32
                   ["data/apturl.glade"]),
 
33
                 ]+I18NFILES,
 
34
      )
 
35
 
 
36