parent
92ca7d440f
commit
c84a332838
1 changed files with 28 additions and 12 deletions
40
setup.py
40
setup.py
|
|
@ -22,22 +22,37 @@ from __future__ import with_statement
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
|
from optparse import OptionParser
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
with open('/dev/null', 'w') as devnull:
|
option_parser = OptionParser()
|
||||||
process = subprocess.Popen(['which', 'pyuic4'], stdout=devnull)
|
option_parser.add_option('--xdg', action='store_true', default=True, help='Install desktop files and icons')
|
||||||
return_code = process.wait()
|
option_parser.add_option('--no-xdg', action='store_false', dest='xdg', help='Don\'t install desktop files and icons')
|
||||||
if return_code != 0:
|
option_parser.add_option('--gui', action='store_true', default=True, help='Install GUI applications')
|
||||||
print 'pyuic4 is not installed on your system'
|
option_parser.add_option('--no-gui', action='store_false', dest='gui', help='Don\'t install GUI applications')
|
||||||
sys.exit(1)
|
options, sys.argv = option_parser.parse_args(sys.argv)
|
||||||
|
|
||||||
os.system('make -C weboob/applications/qboobmsg/ui')
|
gui_scripts = ('qboobmsg', 'qhavesex', 'qvideoob', 'weboob-config-qt')
|
||||||
os.system('make -C weboob/applications/qhavesex/ui')
|
scripts = os.listdir('scripts')
|
||||||
os.system('make -C weboob/applications/qvideoob/ui')
|
|
||||||
os.system('make -C weboob/tools/application/qt')
|
if options.gui:
|
||||||
|
with open('/dev/null', 'w') as devnull:
|
||||||
|
process = subprocess.Popen(['which', 'pyuic4'], stdout=devnull)
|
||||||
|
return_code = process.wait()
|
||||||
|
if return_code == 0:
|
||||||
|
os.system('make -C weboob/applications/qboobmsg/ui')
|
||||||
|
os.system('make -C weboob/applications/qhavesex/ui')
|
||||||
|
os.system('make -C weboob/applications/qvideoob/ui')
|
||||||
|
os.system('make -C weboob/tools/application/qt')
|
||||||
|
scripts
|
||||||
|
else:
|
||||||
|
print 'pyuic4 is not installed on your system'
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
scripts = set(scripts) - set(gui_scripts)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='weboob',
|
name='weboob',
|
||||||
|
|
@ -50,7 +65,7 @@ setup(
|
||||||
license='GPLv3',
|
license='GPLv3',
|
||||||
url='http://www.weboob.org',
|
url='http://www.weboob.org',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
scripts=[os.path.join('scripts', script) for script in os.listdir('scripts')],
|
scripts=[os.path.join('scripts', script) for script in scripts],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
# 'ClientForm', # python-clientform
|
# 'ClientForm', # python-clientform
|
||||||
# 'elementtidy', # python-elementtidy
|
# 'elementtidy', # python-elementtidy
|
||||||
|
|
@ -80,4 +95,5 @@ def install_xdg():
|
||||||
print 'Installing icon %s' % filepath
|
print 'Installing icon %s' % filepath
|
||||||
os.system('xdg-icon-resource install --size 64 --novendor %s' % filepath)
|
os.system('xdg-icon-resource install --size 64 --novendor %s' % filepath)
|
||||||
|
|
||||||
install_xdg()
|
if options.xdg:
|
||||||
|
install_xdg()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue