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
102
103
104
105
106
107
108
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# vim:si:ai:et:sw=4:sts=4:ts=4
#
#
# copyright nicolas bertrand (nico@inattendu.org), 2010
#
# this file is part of luciole.
#
# the free software foundation, either version 3 of the license, or
# (at your option) any later version.
#
# luciole is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose. see the
# gnu general public license for more details.
#
# you should have received a copy of the gnu general public license
# along with luciole. if not, see <http://www.gnu.org/licenses/>.
#
#
import glob, os, sys, subprocess
from distutils.core import setup
print "Execution path: %s" % os.path.abspath(__file__)
from luciole import info
# Boolean: running as root?
ROOT = os.geteuid() == 0
# For Debian packaging it could be a fakeroot so reset flag to prevent
# execution of
# system update services for Mime and Desktop registrations.
# The debian/openshot.postinst script must do those.
if not os.getenv("FAKEROOTKEY") == None:
print "NOTICE: Detected execution in a FakeRoot\
so disabling calls to system update services."
ROOT = False
os_files = [
# XDG application description
('share/applications', ['xdg/luciole.desktop']),
# XDG application icon
('share/pixmaps', ['xdg/luciole.png']),
# man-page ("man 1 openshot")
('share/man/man1',['docs/luciole.pod']),
]
# Add all the translations
locale_files = []
#for filepath in glob.glob("luciole/po/*/LC_MESSAGES/*"):
for filepath in glob.glob("luciole/po/*/LC_MESSAGES/*"):
print filepath
filepath = filepath.replace('luciole/', '')
locale_files.append(filepath)
print locale_files
# Call the main Distutils setup command
# -------------------------------------
dist = setup(
scripts= ['bin/luciole'],
packages = ['luciole',
'luciole.base',
'luciole.ctrl',
'luciole.gui',
'luciole.gui.base',
'luciole.gui.treeviews',
'luciole.gui.windows',
'luciole.media',
'luciole.media.lgst',
'luciole.media.webcam_detect',
'luciole.project',
'luciole.project.export',
],
package_data = {
'luciole' : [ 'ui/*.glade',
'data/templates/*',
'data/sounds/*',
'data/images/*',
'data/themes/*.rc',
'data/themes/Tropical/*.txt',
'data/themes/Tropical/icons/*.png',
]
+ locale_files,
},
data_files = os_files,
**info.SETUP
)
# -------------------------------------
FAILED = 'Failed to update.\n'
if ROOT and dist != None:
try:
sys.stdout.write('Updating the .desktop file database.\n')
subprocess.call(["update-desktop-database"])
except:
sys.stderr.write(FAILED)
sys.stdout.write("\n-----------------------------------------------")
sys.stdout.write("\nInstallation Finished!")
sys.stdout.write("\nRun luciole by typing 'luciole' or through the Applications menu.")
sys.stdout.write("\n-----------------------------------------------\n")
|