Skip to content

Commit 01c0100

Browse files
author
Matthew Sackman
committed
merging in from default
2 parents 3e3aa9a + 0e3b435 commit 01c0100

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1744
-584
lines changed

.hgignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ syntax: regexp
1212
^src/rabbit_framing.erl$
1313
^rabbit.plt$
1414
^ebin/rabbit.app$
15+
^ebin/rabbit.rel$
16+
^ebin/rabbit.boot$
17+
^ebin/rabbit.script$
18+
^plugins/
19+
^priv/plugins/
1520

1621
^packaging/RPMS/Fedora/(BUILD|RPMS|SOURCES|SPECS|SRPMS)$
1722
^packaging/debs/Debian/rabbitmq-server_.*\.(dsc|(diff|tar)\.gz|deb|changes)$

Makefile

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ PYTHON=python
2020

2121
ifndef USE_SPECS
2222
# our type specs rely on features / bug fixes in dialyzer that are
23-
# only available in R12B-5 upwards
23+
# only available in R13B upwards (R13B is eshell 5.7.1)
2424
#
2525
# NB: the test assumes that version number will only contain single digits
26-
USE_SPECS=$(shell if [ $$(erl -noshell -eval 'io:format(erlang:system_info(version)), halt().') \> "5.6.4" ]; then echo "true"; else echo "false"; fi)
26+
USE_SPECS=$(shell if [ $$(erl -noshell -eval 'io:format(erlang:system_info(version)), halt().') \> "5.7.0" ]; then echo "true"; else echo "false"; fi)
2727
endif
2828

2929
#other args: +native +"{hipe,[o3,verbose]}" -Ddebug=true +debug_info +no_strict_record_tests
@@ -39,9 +39,6 @@ AMQP_SPEC_JSON_PATH=$(AMQP_CODEGEN_DIR)/amqp-0.8.json
3939

4040
ERL_CALL=erl_call -sname $(RABBITMQ_NODENAME) -e
4141

42-
# for the moment we don't use boot files because they introduce a
43-
# dependency on particular versions of OTP applications
44-
#all: $(EBIN_DIR)/rabbit.boot
4542
all: $(TARGETS)
4643

4744
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
@@ -101,8 +98,8 @@ run-tests: all
10198
start-background-node:
10299
$(BASIC_SCRIPT_ENVIRONMENT_SETTINGS) \
103100
RABBITMQ_NODE_ONLY=true \
104-
RABBITMQ_SERVER_START_ARGS="$(RABBITMQ_SERVER_START_ARGS)" \
105-
./scripts/rabbitmq-server -detached; sleep 1
101+
RABBITMQ_SERVER_START_ARGS="$(RABBITMQ_SERVER_START_ARGS) -detached" \
102+
./scripts/rabbitmq-server ; sleep 1
106103

107104
start-rabbit-on-node: all
108105
echo "rabbit:start()." | $(ERL_CALL)
@@ -116,8 +113,11 @@ force-snapshot: all
116113
stop-node:
117114
-$(ERL_CALL) -q
118115

116+
# code coverage will be created for subdirectory "ebin" of COVER_DIR
117+
COVER_DIR=.
118+
119119
start-cover: all
120-
echo "cover:start(), rabbit_misc:enable_cover()." | $(ERL_CALL)
120+
echo "cover:start(), rabbit_misc:enable_cover([\"$(COVER_DIR)\"])." | $(ERL_CALL)
121121

122122
stop-cover: all
123123
echo "rabbit_misc:report_cover(), cover:stop()." | $(ERL_CALL)
@@ -134,10 +134,10 @@ srcdist: distclean
134134
cp README.in $(TARGET_SRC_DIR)/README
135135
elinks -dump -no-references -no-numbering $(WEB_URL)build-server.html \
136136
>> $(TARGET_SRC_DIR)/BUILD
137-
sed -i.save 's/%%VERSION%%/$(VERSION)/' $(TARGET_SRC_DIR)/ebin/rabbit_app.in && rm -f $(TARGET_SRC_DIR)/ebin/rabbit_app.in.save
137+
sed -i.save 's/%%VSN%%/$(VERSION)/' $(TARGET_SRC_DIR)/ebin/rabbit_app.in && rm -f $(TARGET_SRC_DIR)/ebin/rabbit_app.in.save
138138

139139
cp -r $(AMQP_CODEGEN_DIR)/* $(TARGET_SRC_DIR)/codegen/
140-
cp codegen.py Makefile generate_app $(TARGET_SRC_DIR)
140+
cp codegen.py Makefile generate_app calculate-relative $(TARGET_SRC_DIR)
141141

142142
cp -r scripts $(TARGET_SRC_DIR)
143143
cp -r docs $(TARGET_SRC_DIR)
@@ -148,7 +148,7 @@ srcdist: distclean
148148
rm -rf $(TARGET_SRC_DIR)
149149

150150
distclean: clean
151-
make -C $(AMQP_CODEGEN_DIR) distclean
151+
$(MAKE) -C $(AMQP_CODEGEN_DIR) distclean
152152
rm -rf dist
153153
find . -regex '.*\(~\|#\|\.swp\|\.dump\)' -exec rm {} \;
154154

@@ -163,7 +163,8 @@ distclean: clean
163163

164164
docs_all: $(MANPAGES)
165165

166-
install: all docs_all
166+
install: SCRIPTS_REL_PATH=$(shell ./calculate-relative $(TARGET_DIR)/sbin $(SBIN_DIR))
167+
install: all docs_all install_dirs
167168
@[ -n "$(TARGET_DIR)" ] || (echo "Please set TARGET_DIR."; false)
168169
@[ -n "$(SBIN_DIR)" ] || (echo "Please set SBIN_DIR."; false)
169170
@[ -n "$(MAN_DIR)" ] || (echo "Please set MAN_DIR."; false)
@@ -172,13 +173,17 @@ install: all docs_all
172173
cp -r ebin include LICENSE LICENSE-MPL-RabbitMQ INSTALL $(TARGET_DIR)
173174

174175
chmod 0755 scripts/*
175-
mkdir -p $(SBIN_DIR)
176-
cp scripts/rabbitmq-server $(SBIN_DIR)
177-
cp scripts/rabbitmqctl $(SBIN_DIR)
178-
cp scripts/rabbitmq-multi $(SBIN_DIR)
176+
for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-multi rabbitmq-activate-plugins; do \
177+
cp scripts/$$script $(TARGET_DIR)/sbin; \
178+
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
179+
done
179180
for section in 1 5; do \
180181
mkdir -p $(MAN_DIR)/man$$section; \
181182
for manpage in docs/*.$$section.pod; do \
182183
cp docs/`basename $$manpage .pod`.gz $(MAN_DIR)/man$$section; \
183184
done; \
184185
done
186+
187+
install_dirs:
188+
mkdir -p $(SBIN_DIR)
189+
mkdir -p $(TARGET_DIR)/sbin

calculate-relative

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
#
3+
# relpath.py
4+
# R.Barran 30/08/2004
5+
# Retrieved from http://code.activestate.com/recipes/302594/
6+
7+
import os
8+
import sys
9+
10+
def relpath(target, base=os.curdir):
11+
"""
12+
Return a relative path to the target from either the current dir or an optional base dir.
13+
Base can be a directory specified either as absolute or relative to current dir.
14+
"""
15+
16+
if not os.path.exists(target):
17+
raise OSError, 'Target does not exist: '+target
18+
19+
if not os.path.isdir(base):
20+
raise OSError, 'Base is not a directory or does not exist: '+base
21+
22+
base_list = (os.path.abspath(base)).split(os.sep)
23+
target_list = (os.path.abspath(target)).split(os.sep)
24+
25+
# On the windows platform the target may be on a completely different drive from the base.
26+
if os.name in ['nt','dos','os2'] and base_list[0] <> target_list[0]:
27+
raise OSError, 'Target is on a different drive to base. Target: '+target_list[0].upper()+', base: '+base_list[0].upper()
28+
29+
# Starting from the filepath root, work out how much of the filepath is
30+
# shared by base and target.
31+
for i in range(min(len(base_list), len(target_list))):
32+
if base_list[i] <> target_list[i]: break
33+
else:
34+
# If we broke out of the loop, i is pointing to the first differing path elements.
35+
# If we didn't break out of the loop, i is pointing to identical path elements.
36+
# Increment i so that in all cases it points to the first differing path elements.
37+
i+=1
38+
39+
rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:]
40+
if (len(rel_list) == 0):
41+
return "."
42+
return os.path.join(*rel_list)
43+
44+
if __name__ == "__main__":
45+
print(relpath(sys.argv[1], sys.argv[2]))
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
=head1 NAME
2+
3+
rabbitmq-activate-plugins - command line tool for activating plugins in a RabbitMQ broker
4+
5+
=head1 SYNOPSIS
6+
7+
rabbitmq-activate-plugins
8+
9+
=head1 DESCRIPTION
10+
11+
RabbitMQ is an implementation of AMQP, the emerging standard for high
12+
performance enterprise messaging. The RabbitMQ server is a robust and
13+
scalable implementation of an AMQP broker.
14+
15+
rabbitmq-activate-plugins is a command line tool for activating plugins installed
16+
into the broker's plugins directory.
17+
18+
=head1 EXAMPLES
19+
20+
To activate all of the installed plugins in the current RabbitMQ install,
21+
execute:
22+
23+
rabbitmq-activate-plugins
24+
25+
=head1 SEE ALSO
26+
27+
rabbitmq.conf(5), rabbitmq-multi(1), rabbitmq-server(1), rabbitmqctl(1)
28+
29+
=head1 AUTHOR
30+
31+
The RabbitMQ Team <[email protected]>
32+
33+
=head1 REFERENCES
34+
35+
RabbitMQ Web Site: http://www.rabbitmq.com

docs/rabbitmq-multi.1.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ See also rabbitmq-server(1) for configuration information.
2121

2222
start_all I<count>
2323
start count nodes with unique names, listening on all IP addresses
24-
and on sequential ports starting from 5672.
24+
and on sequential ports starting from 5672.
2525

2626
status
2727
print the status of all running RabbitMQ nodes

docs/rabbitmq-server.1.pod

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,32 @@ process or use rabbitmqctl(1).
2121
=head1 ENVIRONMENT
2222

2323
B<RABBITMQ_MNESIA_BASE>
24-
Defaults to /var/lib/rabbitmq/mnesia. Set this to the directory
25-
where Mnesia database files should be placed.
24+
Defaults to /var/lib/rabbitmq/mnesia. Set this to the directory
25+
where Mnesia database files should be placed.
2626

2727
B<RABBITMQ_LOG_BASE>
2828
Defaults to /var/log/rabbitmq. Log files generated by the server
29-
will be placed in this directory.
29+
will be placed in this directory.
3030

3131
B<RABBITMQ_NODENAME>
3232
Defaults to rabbit. This can be useful if you want to run more
33-
than one node per machine - B<RABBITMQ_NODENAME> should be unique
34-
per erlang-node-and-machine combination. See clustering on a
35-
single machine guide at
36-
http://www.rabbitmq.com/clustering.html#single-machine for
37-
details.
33+
than one node per machine - B<RABBITMQ_NODENAME> should be unique per
34+
erlang-node-and-machine combination. See clustering on a single
35+
machine guide at
36+
http://www.rabbitmq.com/clustering.html#single-machine for details.
3837

3938
B<RABBITMQ_NODE_IP_ADDRESS>
4039
Defaults to 0.0.0.0. This can be changed if you only want to bind
41-
to one network interface.
40+
to one network interface.
4241

4342
B<RABBITMQ_NODE_PORT>
4443
Defaults to 5672.
4544

4645
B<RABBITMQ_CLUSTER_CONFIG_FILE>
4746
Defaults to /etc/rabbitmq/rabbitmq_cluster.config. If this file is
48-
present it is used by the server to auto-configure a RabbitMQ
49-
cluster.
50-
See the clustering guide at http://www.rabbitmq.com/clustering.html
51-
for details.
47+
present it is used by the server to auto-configure a RabbitMQ cluster.
48+
See the clustering guide at http://www.rabbitmq.com/clustering.html
49+
for details.
5250

5351
=head1 OPTIONS
5452

docs/rabbitmq.conf.5.pod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ built-in default values. For example, for the B<RABBITMQ_NODENAME> setting,
1818

1919
B<RABBITMQ_NODENAME>
2020
from the environment is checked first. If it is absent or equal to
21-
the empty string, then
21+
the empty string, then
2222

2323
B<NODENAME>
2424
from /etc/rabbitmq/rabbitmq.conf is checked. If it is also absent
25-
or set equal to the empty string then the default value from
26-
the startup script is used.
25+
or set equal to the empty string then the default value from the
26+
startup script is used.
2727

2828
The variable names in /etc/rabbitmq/rabbitmq.conf are always equal to the
2929
environment variable names, with the B<RABBITMQ_> prefix removed:

0 commit comments

Comments
 (0)