2
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
4
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
5
# Copyright (C) 2009 TJ, Jonathan Thomas
7
# OpenShot Video Editor is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# OpenShot Video Editor is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with OpenShot Video Editor. If not, see <http://www.gnu.org/licenses/>.
20
import glob, os, sys, subprocess
21
from distutils.core import setup
23
print "Execution path: %s" % os.path.abspath(__file__)
24
from openshot.classes import info
26
# Boolean: running as root?
27
ROOT = os.geteuid() == 0
28
# For Debian packaging it could be a fakeroot so reset flag to prevent execution of
29
# system update services for Mime and Desktop registrations.
30
# The debian/openshot.postinst script must do those.
31
if not os.getenv("FAKEROOTKEY") == None:
32
print "NOTICE: Detected execution in a FakeRoot so disabling calls to system update services."
36
# XDG application description
37
('share/applications', ['xdg/openshot.desktop']),
38
# XDG application icon
39
('share/pixmaps', ['xdg/openshot.png']),
40
# XDG desktop mime types cache
41
('share/mime/packages',['xdg/openshot.xml']),
42
# launcher (mime.types)
43
('lib/mime/packages',['xdg/openshot']),
44
# man-page ("man 1 openshot")
45
('share/man/man1',['docs/openshot.1']),
48
# Call the main Distutils setup command
50
scripts = ['bin/openshot'],
51
packages = ['openshot', 'openshot.classes', 'openshot.language', 'openshot.windows'],
53
'openshot' : ['images/*', 'locale/OpenShot/*', 'locale/README', 'profiles/*', 'themes/blue_glass1/*', 'titles/*', 'transitions/*'],
54
'openshot.windows' : ['glade/*.glade', 'glade/icons/*'],
56
data_files = os_files,
61
FAILED = 'Failed to update.\n'
63
if ROOT and dist != None:
64
#update the XDG Shared MIME-Info database cache
66
sys.stdout.write('Updating the Shared MIME-Info database cache.\n')
67
subprocess.call(["update-mime-database", os.path.join(sys.prefix, "share/mime/")])
69
sys.stderr.write(FAILED)
71
#update the mime.types database
73
sys.stdout.write('Updating the mime.types database\n')
74
subprocess.call("update-mime")
76
sys.stderr.write(FAILED)
78
# update the XDG .desktop file database
80
sys.stdout.write('Updating the .desktop file database.\n')
81
subprocess.call(["update-desktop-database"])
83
sys.stderr.write(FAILED)
84
sys.stdout.write("\n-----------------------------------------------")
85
sys.stdout.write("\nInstallation Finished!")
86
sys.stdout.write("\nRun OpenShot by typing 'openshot' or through the Applications menu.")
87
sys.stdout.write("\n-----------------------------------------------\n")