summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsif Saifuddin Auvi <auvipy@users.noreply.github.com>2018-02-26 22:13:51 +0600
committerGitHub <noreply@github.com>2018-02-26 22:13:51 +0600
commit3bae8df1d95b47bd10f3232c8f13d3c07069619b (patch)
tree94b3d5a83e2efe5395fa40c1c951ae7c474cc26e
parent1271729001fca976346d3a22538a3713e9fbc82c (diff)
parentdbf12e0d088a932b5e64889499ccc7cfd969c0d2 (diff)
downloadlibrabbitmq-3bae8df1d95b47bd10f3232c8f13d3c07069619b.tar.gz
Merge pull request #112 from joehybird/master
Fix setup.py and MANIFEST.in for source package generation.
-rw-r--r--MANIFEST.in12
-rw-r--r--setup.py26
2 files changed, 32 insertions, 6 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 971ccec..8dc7d92 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -9,8 +9,10 @@ include setup.cfg
recursive-include librabbitmq *
recursive-include Modules *
recursive-include tests *
-prune *.pyc
-prune *.o
-prune *.la
-prune *.so
-prune *.dylib
+prune rabbitmq-c/
+exclude *.pyc
+exclude *.o
+exclude *.la
+exclude *.so
+exclude *.dylib
+exclude Makefile
diff --git a/setup.py b/setup.py
index ec00de9..37b7e82 100644
--- a/setup.py
+++ b/setup.py
@@ -104,6 +104,8 @@ def create_builder():
here = os.path.abspath(os.getcwd())
config = sysconfig.get_config_vars()
+ make = find_make()
+
try:
vars = {'ld': config['LDFLAGS'],
'c': config['CFLAGS']}
@@ -117,8 +119,23 @@ def create_builder():
('CFLAGS', vars['c']),
('LDFLAGS', vars['ld']),
)
+
try:
+ if not os.path.isdir(os.path.join(LRMQDIST(), '.git')):
+ print('- pull submodule rabbitmq-c...')
+ if os.path.isfile('Makefile'):
+ os.system(' '.join([make, 'submodules']))
+ else:
+ os.system(' '.join(['git', 'clone', '-b', 'v0.8.0',
+ 'https://github.com/alanxz/rabbitmq-c.git',
+ 'rabbitmq-c']))
+
os.chdir(LRMQDIST())
+
+ if not os.path.isfile('configure'):
+ print('- autoreconf')
+ os.system('autoreconf -i')
+
if not os.path.isfile('config.h'):
print('- configure rabbitmq-c...')
if os.system('/bin/sh configure --disable-tools \
@@ -187,7 +204,14 @@ if 'install' in sys.argv and 'build' not in sys.argv:
sys.argv[:] = (
sys.argv[:_index] + ['build', 'install'] + sys.argv[_index + 1:]
)
-
+
+# 'bdist_wheel doesn't always call build for some reason
+if 'bdist_wheel' in sys.argv and 'build' not in sys.argv:
+ _index = sys.argv.index('bdist_wheel')
+ sys.argv[:] = (
+ sys.argv[:_index] + ['build', 'bdist_wheel'] + sys.argv[_index + 1:]
+ )
+
# 'bdist_egg doesn't always call build for some reason
if 'bdist_egg' in sys.argv and 'build' not in sys.argv:
_index = sys.argv.index('bdist_egg')