-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
44 lines (37 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
#!/usr/bin/env python
from distutils.core import setup
from distutils.sysconfig import PREFIX
from distutils.command.install_data import install_data
import os
import sys
class post_install(install_data):
def run(self):
# Call parent
install_data.run(self)
if glib_compile_schemas:
# Execute commands after copying
os.system('glib-compile-schemas %s/share/glib-2.0/schemas' % self.install_dir)
# determine lib path depending on architecture
if (os.uname()[4].find('64') != -1 or os.uname()[4].find('s390x') != -1):
lib_dir = 'lib64'
else:
lib_dir = 'lib'
# optionally compile glib schemas
glib_compile_schemas = True
if "--no-glib-compile-schemas" in sys.argv:
glib_compile_schemas = False
sys.argv.remove("--no-glib-compile-schemas")
setup(name="rhythmbox-ampache",
cmdclass={"install_data": post_install},
version="0.11",
description="A Rhythmbox plugin to stream music from an Ampache server",
author="Rhythmbox Ampache plugin team",
author_email="[email protected]",
url="http://code.google.com/p/rhythmbox-ampache",
packages=[],
data_files=[
(lib_dir+"/rhythmbox/plugins/ampache", ["ampache.plugin", "ampache.py", "AmpacheBrowser.py", "AmpacheConfigDialog.py"]),
("share/rhythmbox/plugins/ampache", ["ampache-prefs.ui", "ampache.ico", "ampache.png"]),
("share/glib-2.0/schemas", ["org.gnome.rhythmbox.plugins.ampache.gschema.xml"]),
],
)