-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·45 lines (41 loc) · 1.49 KB
/
setup.py
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
#!/usr/bin/env python3
from distutils.core import setup
from DistUtilsExtra.command import *
import glob
import os
import re
# look/set what version we have
changelog = "debian/changelog"
if os.path.exists(changelog):
with open(changelog, encoding='utf-8') as fp:
head = fp.readline()
match = re.compile(".*\(([0-9.]+)\+xentaos.+\).*").match(head)
if match:
version = match.group(1)
with open("AptUrl/Version.py", "w") as fp:
print('VERSION="{}"'.format(version))
GETTEXT_NAME="apturl"
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]))
setup(name='apturl',
version=version,
packages=['AptUrl',
'AptUrl.gtk'],
scripts=['apturl','apturl-gtk'],
data_files=[('share/apturl/',
["data/apturl-gtk.ui"]),
('../etc/firefox/pref/',
["data/apturl.js"]),
('share/kde4/services/',
["data/apt.protocol","data/apt+http.protocol"]),
('share/applications/',
["data/apturl.desktop"]),
]+I18NFILES,
cmdclass = { "build" : build_extra.build_extra,
"build_i18n" : build_i18n.build_i18n,
"build_help" : build_help.build_help,
"build_icons" : build_icons.build_icons }
)