Skip to content

Commit

Permalink
Change setup according new path
Browse files Browse the repository at this point in the history
Ref #20
Add chown for user
  • Loading branch information
algorys committed Oct 11, 2016
1 parent 046a77e commit 231f9e8
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@
]

# Get HOME and USER
home = os.environ['HOME']
if 'root' in home or not home:
sys.exit('Application can\'t find the user HOME or maybe you are connected as ROOT.')
if home.endswith('/'):
home = home[:-1]
home += '/bin'
from alignak_app.logs import get_home_user
home = get_home_user()
home += '/.alignak_app'

print('HOME = ' + home)

Expand All @@ -60,9 +57,9 @@
paths = {}
if 'linux' in sys.platform or 'sunos5' in sys.platform:
paths = {
'etc': "/etc/alignak_app",
'log': home + "alignak_app/logs",
'bin': home,
'etc': home,
'log': home + "/logs",
'bin': home + "/bin",
}
else:
print("Unsupported platform, sorry!")
Expand Down Expand Up @@ -106,17 +103,11 @@
(paths['etc'] + '/images', ['etc/images/service_warning.svg']),
(paths['etc'] + '/images', ['etc/images/service_unknown.svg']),
(paths['bin'], ['etc/bin/alignak-app']),
(paths['bin'] + '/alignak_app', ['etc/bin/launch.py']),
(paths['bin'], ['etc/bin/launch.py']),
],

install_requires=install_requires,

# entry_points={
# 'gui_scripts': [
# 'alignak_app = alignak_app.launch:launch',
# ],
# },

classifiers = [
'Development Status :: 4 - Beta',
'Environment :: X11 Applications :: GTK',
Expand All @@ -134,7 +125,7 @@

)

cmd = 'sudo chown -R ' + user + ':' + user + ' ~/bin'
cmd = 'sudo chown -R ' + user + ':' + user + ' ' + home
try:
subprocess.Popen(cmd,
shell=True, stdin=subprocess.PIPE,
Expand Down

0 comments on commit 231f9e8

Please sign in to comment.