2013-05-03 08:14:14 +04:00
#!/usr/bin/env python
2015-06-11 23:05:30 +03:00
# Copyright (c) 2015 Ansible, Inc.
2013-05-22 02:20:26 +04:00
# All Rights Reserved.
2015-02-05 18:40:22 +03:00
import os
import glob
import sys
from setuptools import setup
2020-05-19 22:00:13 +03:00
from setuptools . command . egg_info import egg_info as _egg_info
2013-06-26 03:46:12 +04:00
2013-05-22 01:39:34 +04:00
2013-06-15 12:10:11 +04:00
# Paths we'll use later
2016-03-23 22:46:00 +03:00
etcpath = " /etc/tower "
2013-06-23 21:21:02 +04:00
homedir = " /var/lib/awx "
2016-03-23 22:46:00 +03:00
bindir = " /usr/bin "
2016-03-25 20:10:47 +03:00
sharedir = " /usr/share/awx "
2017-08-03 23:18:55 +03:00
docdir = " /usr/share/doc/awx "
2017-07-18 18:16:18 +03:00
2017-07-24 22:12:24 +03:00
2017-07-18 18:16:18 +03:00
def get_version ( ) :
2017-07-25 17:54:42 +03:00
current_dir = os . path . dirname ( os . path . abspath ( __file__ ) )
version_file = os . path . join ( current_dir , ' VERSION ' )
2018-09-27 02:53:35 +03:00
with open ( version_file , ' r ' ) as file :
return file . read ( ) . strip ( )
2017-07-18 18:16:18 +03:00
2018-10-04 18:52:49 +03:00
2013-06-15 12:10:11 +04:00
if os . path . exists ( " /etc/debian_version " ) :
2016-03-25 20:10:47 +03:00
sysinit = " /etc/init.d "
2016-10-07 21:41:34 +03:00
webconfig = " /etc/nginx "
siteconfig = " /etc/nginx/sites-enabled "
2014-08-14 17:17:35 +04:00
# sosreport-3.1 (and newer) look in '/usr/share/sosreport/sos/plugins'
# sosreport-3.0 looks in '/usr/lib/python2.7/dist-packages/sos/plugins'
# debian/<package>.links will create symlinks to support both versions
sosconfig = " /usr/share/sosreport/sos/plugins "
2013-06-15 12:10:11 +04:00
else :
2016-03-25 20:10:47 +03:00
sysinit = " /etc/rc.d/init.d "
2016-10-07 21:41:34 +03:00
webconfig = " /etc/nginx "
siteconfig = " /etc/nginx/sites-enabled "
2014-08-14 17:17:35 +04:00
# The .spec will create symlinks to support multiple versions of sosreport
sosconfig = " /usr/share/sosreport/sos/plugins "
2013-06-15 12:10:11 +04:00
#####################################################################
# Helper Functions
2016-11-16 04:59:39 +03:00
2013-06-15 12:10:11 +04:00
def explode_glob_path ( path ) :
""" Take a glob and hand back the full recursive expansion,
ignoring links .
"""
result = [ ]
includes = glob . glob ( path )
for item in includes :
if os . path . isdir ( item ) and not os . path . islink ( item ) :
result . extend ( explode_glob_path ( os . path . join ( item , " * " ) ) )
else :
result . append ( item )
return result
def proc_data_files ( data_files ) :
""" Because data_files doesn ' t natively support globs...
let ' s add them.
"""
result = [ ]
2013-06-23 00:27:09 +04:00
2013-06-23 00:30:17 +04:00
# If running in a virtualenv, don't return data files that would install to
2013-06-23 00:27:09 +04:00
# system paths (mainly useful for running tests via tox).
if hasattr ( sys , ' real_prefix ' ) :
return result
2014-04-15 23:41:13 +04:00
2013-06-15 12:10:11 +04:00
for dir , files in data_files :
includes = [ ]
for item in files :
includes . extend ( explode_glob_path ( item ) )
result . append ( ( dir , includes ) )
return result
2020-05-19 22:00:13 +03:00
class egg_info_dev ( _egg_info ) :
def find_sources ( self ) :
# when we generate a .egg-info for the development
# environment, it's not really critical that we
# parse the MANIFEST.in (which is actually quite expensive
# in Docker for Mac)
pass
2013-06-15 12:10:11 +04:00
#####################################################################
2016-11-16 00:32:27 +03:00
2013-05-03 08:14:14 +04:00
setup (
2017-07-26 17:58:46 +03:00
name = os . getenv ( ' NAME ' , ' awx ' ) ,
2017-07-18 18:16:18 +03:00
version = get_version ( ) ,
2014-01-29 21:30:12 +04:00
author = ' Ansible, Inc. ' ,
2016-10-13 23:41:34 +03:00
author_email = ' info@ansible.com ' ,
2017-07-26 17:58:46 +03:00
description = ' awx: API, UI and Task Engine for Ansible ' ,
long_description = ' AWX provides a web-based user interface, REST API and '
2013-06-23 21:21:02 +04:00
' task engine built on top of Ansible ' ,
2017-09-12 17:49:47 +03:00
license = ' Apache License 2.0 ' ,
2013-05-03 08:14:14 +04:00
keywords = ' ansible ' ,
2017-07-18 18:16:18 +03:00
url = ' http://github.com/ansible/awx ' ,
2013-06-23 21:21:02 +04:00
packages = [ ' awx ' ] ,
2013-05-03 08:14:14 +04:00
include_package_data = True ,
zip_safe = False ,
setup_requires = [ ] ,
classifiers = [
2013-09-25 05:40:53 +04:00
' Development Status :: 5 - Production/Stable ' ,
2013-05-03 08:14:14 +04:00
' Environment :: Web Environment ' ,
' Framework :: Django ' ,
' Intended Audience :: Developers ' ,
' Intended Audience :: Information Technology ' ,
' Intended Audience :: System Administrators '
2017-09-12 17:49:47 +03:00
' License :: Apache License 2.0 ' ,
2013-05-03 08:14:14 +04:00
' Natural Language :: English ' ,
' Operating System :: OS Independent ' ,
' Operating System :: POSIX ' ,
' Programming Language :: Python ' ,
' Topic :: System :: Installation/Setup ' ,
' Topic :: System :: Systems Administration ' ,
] ,
entry_points = {
' console_scripts ' : [
2013-06-23 21:21:02 +04:00
' awx-manage = awx:manage ' ,
2013-05-03 08:14:14 +04:00
] ,
2019-01-22 02:20:24 +03:00
' awx.credential_plugins ' : [
2019-02-28 21:10:44 +03:00
' conjur = awx.main.credential_plugins.conjur:conjur_plugin ' ,
2019-02-22 22:45:27 +03:00
' hashivault_kv = awx.main.credential_plugins.hashivault:hashivault_kv_plugin ' ,
' hashivault_ssh = awx.main.credential_plugins.hashivault:hashivault_ssh_plugin ' ,
2019-02-22 09:21:08 +03:00
' azure_kv = awx.main.credential_plugins.azure_kv:azure_keyvault_plugin ' ,
2019-03-21 17:57:46 +03:00
' aim = awx.main.credential_plugins.aim:aim_plugin '
2019-01-22 02:20:24 +03:00
]
2013-05-03 08:14:14 +04:00
} ,
2013-06-15 12:10:11 +04:00
data_files = proc_data_files ( [
2015-02-05 18:40:22 +03:00
( " %s " % homedir , [ " config/wsgi.py " ,
2017-10-06 18:57:08 +03:00
" awx/static/favicon.ico " ] ) ,
2016-10-07 21:41:34 +03:00
( " %s " % siteconfig , [ " config/awx-nginx.conf " ] ) ,
2016-11-08 17:37:07 +03:00
# ("%s" % webconfig, ["config/uwsgi_params"]),
2015-11-05 18:14:30 +03:00
( " %s " % sharedir , [ " tools/scripts/request_tower_configuration.sh " , " tools/scripts/request_tower_configuration.ps1 " ] ) ,
2015-09-18 22:38:49 +03:00
( " %s " % docdir , [ " docs/licenses/* " , ] ) ,
2016-03-23 22:46:00 +03:00
( " %s " % bindir , [ " tools/scripts/ansible-tower-service " ,
2016-11-02 19:58:58 +03:00
" tools/scripts/failure-event-handler " ,
2017-07-25 18:49:21 +03:00
" tools/scripts/awx-python " ,
2017-03-23 05:58:11 +03:00
" tools/scripts/ansible-tower-setup " ] ) ,
2015-02-05 18:40:22 +03:00
( " %s " % sosconfig , [ " tools/sosreport/tower.py " ] ) ] ) ,
2013-06-26 03:46:12 +04:00
options = {
2013-05-03 08:14:14 +04:00
' aliases ' : {
2014-10-17 17:01:45 +04:00
' dev_build ' : ' clean --all egg_info sdist ' ,
2019-03-01 21:08:26 +03:00
' release_build ' : ' clean --all egg_info -b " " sdist '
2013-05-03 08:14:14 +04:00
} ,
2016-03-23 22:46:00 +03:00
' build_scripts ' : {
2017-07-25 18:49:21 +03:00
' executable ' : ' /usr/bin/awx-python ' ,
2016-03-23 22:46:00 +03:00
} ,
2013-05-03 08:14:14 +04:00
} ,
2020-05-19 22:00:13 +03:00
cmdclass = { ' egg_info_dev ' : egg_info_dev }
2013-05-03 08:14:14 +04:00
)