summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabre Florian <ffabre@hybird.org>2018-02-13 15:08:45 +0100
committerFabre Florian <ffabre@hybird.org>2018-02-13 15:08:45 +0100
commite3ef92660abea2b36d41e2de04890224f23fd856 (patch)
treea00c1d21e89fa181145f443b1ff5122fa3d27abd
parent1271729001fca976346d3a22538a3713e9fbc82c (diff)
downloadlibrabbitmq-e3ef92660abea2b36d41e2de04890224f23fd856.tar.gz
Fix MANIFEST.in to exclude rabbitmq-c/ and add behaviour of make target 'rabbit-c' in setup.py for usage in source dist
-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..fe4c397 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_egg 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')