mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-14 21:46:18 +00:00
69 lines
1.8 KiB
Python
69 lines
1.8 KiB
Python
import os
|
|
import sys
|
|
import uwsgiconfig as uc
|
|
import shutil
|
|
|
|
from distutils.core import setup, Distribution
|
|
from distutils.command.install import install
|
|
from distutils.command.build_ext import build_ext
|
|
|
|
|
|
def is_yes(name, d):
|
|
sys.stderr.write("*** Write your answer in the next line: enable %s ? y/n [ default %s ]>\n" % (name, d))
|
|
x = raw_input()
|
|
if x is None or str(x) == "":
|
|
x = d
|
|
if x == 'y' or x == 'Y':
|
|
sys.stderr.write("%s will be enabled.\n" % name);
|
|
return True
|
|
sys.stderr.write("%s will NOT be enabled.\n" % name);
|
|
return False
|
|
|
|
class uWSGIBuilder(build_ext):
|
|
|
|
def run(self):
|
|
uc.XML = is_yes( "XML", 'y' )
|
|
uc.SNMP = is_yes( "SNMP", 'n' )
|
|
uc.SPOOLER = is_yes( "SPOOLER", 'y' )
|
|
uc.EMBEDDED = is_yes( "EMBEDDED uwsgi module", 'y' )
|
|
uc.UDP = is_yes( "UDP", 'y' )
|
|
uc.THREADING = is_yes( "THREADING", 'y' )
|
|
uc.SENDFILE = is_yes( "SENDFILE", 'y' )
|
|
uc.PROFILER = is_yes( "PROFILER", 'y' )
|
|
uc.NAGIOS = is_yes( "NAGIOS", 'y' )
|
|
uc.PROXY = is_yes( "PROXY", 'y' )
|
|
uc.ERLANG = is_yes( "ERLANG", 'n' )
|
|
uc.SCTP = is_yes( "experimental SCTP", 'n' )
|
|
sys.stderr.write(" *** Starting the uWSGI building process ... *** \n")
|
|
uc.parse_vars()
|
|
uc.build_uwsgi(sys.prefix + '/bin/' + uc.UWSGI_BIN_NAME)
|
|
|
|
|
|
class uWSGIInstall(install):
|
|
|
|
def run(self):
|
|
uc.parse_vars()
|
|
uc.build_uwsgi(sys.prefix + '/bin/' + uc.UWSGI_BIN_NAME)
|
|
|
|
class uWSGIDistribution(Distribution):
|
|
|
|
def __init__(self, *attrs):
|
|
Distribution.__init__(self, *attrs)
|
|
self.cmdclass['install'] = uWSGIInstall
|
|
self.cmdclass['build_ext'] = uWSGIBuilder
|
|
|
|
|
|
|
|
setup(name='uWSGI',
|
|
version='0.9.5',
|
|
description='The uWSGI server',
|
|
author='Unbit',
|
|
author_email='info@unbit.it',
|
|
url='http://projects.unbit.it/uwsgi/',
|
|
license='GPL2',
|
|
distclass = uWSGIDistribution,
|
|
)
|
|
|
|
|
|
|