3
from distutils.core import setup
4
from subprocess import *
8
#Create an array with all the locale filenames
10
for filepath in glob.glob("locale/*/LC_MESSAGES/*.mo"):
11
targetpath = os.path.dirname(os.path.join("share/", filepath))
12
I18NFILES.append((targetpath, [filepath]))
14
#Create an array with all the help documents (docbook)
16
for filepath in glob.glob("help/jokosher/*/*.xml"):
17
targetpath = os.path.dirname(os.path.join("share/gnome/", filepath))
18
HELPDOCS.append((targetpath, [filepath]))
21
#Create an array with all the help images
23
for filepath in glob.glob("help/jokosher/*/figures/*.png"):
24
targetpath = os.path.dirname(os.path.join("share/gnome/", filepath))
25
HELPIMAGES.append((targetpath, [filepath]))
27
#Check if scrollkeeper is available
31
process = Popen(args=["scrollkeeper-config", "--omfdir"], stdout=PIPE)
33
#Not available. Skip the registration.
36
#Obtain the OMF repository directory to install and register the help files
37
omfdir = os.path.join(process.stdout.read().strip(), "jokosher")
38
OMFFILES.append((omfdir, glob.glob("help/jokosher/*.omf")))
40
dist = setup(name='jokosher',
42
author='Jokosher Project',
43
author_email='jokosher-devel-list@gnome.org',
44
maintainer='Jokosher Project',
45
maintainer_email='jokosher-devel-list@gnome.org',
46
description='Multi-track non-linear audio editing.',
47
long_description='Jokosher is a simple yet powerful multi-track studio. With it you can create and record music, podcasts and more, all from an integrated simple environment.',
48
url='http://www.jokosher.org/',
49
download_url='http://www.jokosher.org/download',
52
scripts=['bin/jokosher'],
53
packages=['Jokosher', 'Jokosher/elements', 'Jokosher/ui', 'Jokosher/PlatformUtils'],
55
('share/jokosher/', glob.glob("Jokosher/*.glade")),
56
('share/jokosher/', ["Jokosher/jokosher-logo.png"]),
57
('share/jokosher/Instruments', glob.glob("Instruments/*.instr")),
58
('share/jokosher/Instruments/images', glob.glob('Instruments/images/*.png')),
59
('share/icons/hicolor/48x48/apps', ['images/jokosher.png']),
60
('share/pixmaps', ['images/jokosher.png']),
61
('share/jokosher/pixmaps', glob.glob("images/*.png")),
62
('share/applications', ['bin/jokosher.desktop']),
63
('share/mime/packages', ['bin/jokosher.xml']),
64
('share/jokosher/extensions', glob.glob("extensions/*.py") + glob.glob("extensions/*.egg"))
65
]+I18NFILES+HELPDOCS+HELPIMAGES+OMFFILES
68
#Non-documented way of getting the final directory prefix
69
installCmd = dist.get_command_obj(command="install_data")
70
installdir = installCmd.install_dir
71
installroot = installCmd.root
77
installdir = os.path.join(os.path.sep,
78
installdir.replace(installroot, ""))
80
# Update the real URL attribute inside the OMF files
81
# and register them with scrollkeeper
82
if omfdir != None and installdir != None and dist != None:
84
#Create an array with the docbook file locations
86
for filepath in glob.glob("help/jokosher/*/jokosher.xml"):
87
targeturi = os.path.join(installdir, "share/gnome/", filepath)
88
HELPURI.append(targeturi)
90
#Replace the URL placeholder inside the OMF files
91
installedOmfFiles = glob.glob(installroot + omfdir + "/*.omf")
92
for fileNum in range(0, len(installedOmfFiles)):
93
call(["scrollkeeper-preinstall", HELPURI[fileNum],
94
installedOmfFiles[fileNum], installedOmfFiles[fileNum]])
96
#Update the scrollkeeper catalog
98
print "Updating the scrollkeeper index..."
99
call(["scrollkeeper-update", "-o", installroot + omfdir])
101
# Update the mime types
102
if os.geteuid() == 0 and dist != None:
103
print "Updating the mime-types...."
105
#update the mimetypes database
107
call(["update-mime-database", "/usr/share/mime/"])
111
#update the .desktop file database
113
call(["update-desktop-database"])
117
print "\nInstallation finished! You can now run Jokosher by typing 'jokosher' or through your applications menu icon."
119
## To uninstall manually delete these files/folders:
121
## /usr/share/jokosher/
122
## /usr/share/gnome/help/jokosher/
123
## /usr/share/icons/hicolor/48x48/apps/jokosher.png
124
## /usr/share/locale/*/LC_MESSAGES/jokosher.mo
125
## /usr/share/pixmaps/jokosher.png
126
## /usr/share/applications/jokosher.desktop
127
## /usr/lib/python2.X/site-packages/Jokosher/
128
## /usr/share/omf/jokosher/*.omf