openbsd-ports/net/rabbitmq/patches/patch-Makefile
sthen 0f5aa34593 update RabbitMQ to 2.7.1
- disable unnecessary use of nmap/lsof
- from maintainer Piotr Sikora with small tweaks from me
2012-01-13 20:54:25 +00:00

112 lines
4.1 KiB
Plaintext

$OpenBSD: patch-Makefile,v 1.6 2012/01/13 20:54:25 sthen Exp $
--- Makefile.orig Fri Dec 16 12:24:15 2011
+++ Makefile Tue Dec 20 18:50:37 2011
@@ -22,21 +22,10 @@ USAGES_XML=$(DOCS_DIR)/rabbitmqctl.1.xml $(DOCS_DIR)/r
USAGES_ERL=$(foreach XML, $(USAGES_XML), $(call usage_xml_to_erl, $(XML)))
QC_MODULES := rabbit_backing_queue_qc
QC_TRIALS ?= 100
+TARGET_DIR=$(PREFIX)/lib/rabbitmq
+SBIN_DIR=$(PREFIX)/sbin
+MAN_DIR=$(PREFIX)/man
-ifeq ($(shell python -c 'import simplejson' 2>/dev/null && echo yes),yes)
-PYTHON=python
-else
-ifeq ($(shell python2.6 -c 'import simplejson' 2>/dev/null && echo yes),yes)
-PYTHON=python2.6
-else
-ifeq ($(shell python2.5 -c 'import simplejson' 2>/dev/null && echo yes),yes)
-PYTHON=python2.5
-else
-# Hmm. Missing simplejson?
-PYTHON=python
-endif
-endif
-endif
BASIC_PLT=basic.plt
RABBIT_PLT=rabbit.plt
@@ -56,7 +45,7 @@ endif
#other args: +native +"{hipe,[o3,verbose]}" -Ddebug=true +debug_info +no_strict_record_tests
ERLC_OPTS=-I $(INCLUDE_DIR) -o $(EBIN_DIR) -Wall -v +debug_info $(call boolean_macro,$(USE_SPECS),use_specs) $(call boolean_macro,$(USE_PROPER_QC),use_proper_qc)
-VERSION=0.0.0
+VERSION?=0.0.0
PLUGINS_SRC_DIR?=$(shell [ -d "plugins-src" ] && echo "plugins-src" || echo )
PLUGINS_DIR=plugins
TARBALL_NAME=rabbitmq-server-$(VERSION)
@@ -71,6 +60,10 @@ ERL_CALL=erl_call -sname $(RABBITMQ_NODENAME) -e
ERL_EBIN=erl -noinput -pa $(EBIN_DIR)
+CHECK_NAME=rabbitmq-check
+CHECK_DIR=/tmp/$(CHECK_NAME)
+CHECK_CALL=HOME=$(CHECK_DIR) erl_call -sname $(CHECK_NAME) -e
+
define usage_xml_to_erl
$(subst __,_,$(patsubst $(DOCS_DIR)/rabbitmq%.1.xml, $(SOURCE_DIR)/rabbit_%_usage.erl, $(subst -,_,$(1))))
endef
@@ -85,7 +78,7 @@ endef
ifneq "$(SBIN_DIR)" ""
ifneq "$(TARGET_DIR)" ""
-SCRIPTS_REL_PATH=$(shell ./calculate-relative $(TARGET_DIR)/sbin $(SBIN_DIR))
+SCRIPTS_REL_PATH="../lib/rabbitmq/sbin"
endif
endif
@@ -161,7 +154,7 @@ clean:
rm -f $(PLUGINS_DIR)/*.ez
[ -d "$(PLUGINS_SRC_DIR)" ] && PLUGINS_SRC_DIR="" PRESERVE_CLONE_DIR=1 make -C $(PLUGINS_SRC_DIR) clean || true
rm -f $(INCLUDE_DIR)/rabbit_framing.hrl $(SOURCE_DIR)/rabbit_framing_amqp_*.erl codegen.pyc
- rm -f $(DOCS_DIR)/*.[0-9].gz $(DOCS_DIR)/*.man.xml $(DOCS_DIR)/*.erl $(USAGES_ERL)
+ rm -f $(DOCS_DIR)/*.[0-9] $(DOCS_DIR)/*.man.xml $(DOCS_DIR)/*.erl $(USAGES_ERL)
rm -f $(RABBIT_PLT)
rm -f $(DEPS_FILE)
@@ -203,6 +196,25 @@ run-tests: all
run-qc: all
$(foreach MOD,$(QC_MODULES),./quickcheck $(RABBITMQ_NODENAME) $(MOD) $(QC_TRIALS))
+regress:
+ @[ "`id -u`" != "0" ] || (echo "Don't run tests as a superuser." && false)
+ rm -rf $(CHECK_DIR)
+ mkdir -m 777 -p $(CHECK_DIR)
+ HOME=$(CHECK_DIR) \
+ RABBITMQ_NODENAME="$(CHECK_NAME)" \
+ RABBITMQ_NODE_PORT="45672" \
+ RABBITMQ_LOG_BASE="$(CHECK_DIR)/logs" \
+ RABBITMQ_MNESIA_BASE="$(CHECK_DIR)/mnesia" \
+ RABBITMQ_PLUGINS_EXPAND_DIR="$(CHECK_DIR)/plugins" \
+ RABBITMQ_ENABLED_PLUGINS_FILE="$(CHECK_DIR)/none" \
+ RABBITMQ_SERVER_START_ARGS="$(RABBITMQ_SERVER_START_ARGS) -detached" \
+ ./scripts/rabbitmq-server
+ @sleep 5
+ OUT=$$(echo "rabbit_tests:all_tests()." | $(CHECK_CALL)) ; \
+ echo $$OUT ; echo $$OUT | grep '^{ok, passed}$$' > /dev/null || \
+ ($(CHECK_CALL) -q && rm -rf $(CHECK_DIR) && false)
+ $(CHECK_CALL) -q && rm -rf $(CHECK_DIR) && echo "Passed."
+
start-background-node: all
-rm -f $(RABBITMQ_MNESIA_DIR).pid
mkdir -p $(RABBITMQ_MNESIA_DIR)
@@ -281,8 +293,7 @@ distclean: clean
%.gz: %.xml $(DOCS_DIR)/examples-to-end.xsl
xmlto --version | grep -E '^xmlto version 0\.0\.([0-9]|1[1-8])$$' >/dev/null || opt='--stringparam man.indent.verbatims=0' ; \
xsltproc --novalid $(DOCS_DIR)/examples-to-end.xsl $< > $<.tmp && \
- xmlto -o $(DOCS_DIR) $$opt man $<.tmp && \
- gzip -f $(DOCS_DIR)/`basename $< .xml`
+ xmlto -o $(DOCS_DIR) $$opt man $<.tmp
rm -f $<.tmp
# Use tmp files rather than a pipeline so that we get meaningful errors
@@ -326,7 +337,7 @@ install_bin: all install_dirs
install_docs: docs_all install_dirs
for section in 1 5; do \
mkdir -p $(MAN_DIR)/man$$section; \
- for manpage in $(DOCS_DIR)/*.$$section.gz; do \
+ for manpage in $(DOCS_DIR)/*.$$section; do \
cp $$manpage $(MAN_DIR)/man$$section; \
done; \
done