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
|
#!/usr/bin/env python
from distutils.core import setup
import glob, os, commands, sys
from DistUtilsExtra.distutils_extra import build_extra, build_l10n
# Replace the leading _ that is used in the templates for translation
templates = []
if not os.path.exists("build/data/templates/"):
os.makedirs("build/data/templates")
for template in glob.glob('data/templates/*.info.in'):
source = open(template, "r")
build = open(os.path.join("build", template[:-3]), "w")
lines = source.readlines()
for line in lines:
build.write(line.lstrip("_"))
source.close()
build.close()
setup(
name = 'python-aptsources',
version = '0.0.1',
description = 'Abstratcion of the sources.list',
packages = ['AptSources'],
data_files = [('share/python-aptsources/templates',
glob.glob('build/data/templates/*.info')),
('share/python-aptsources/templates',
glob.glob('data/templates/*.mirrors'))],
license = 'GNU GPL',
platforms = 'posix',
cmdclass = { "build" : build_extra,
"build_l10n" : build_l10n }
)
|