posix_mq 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +7 -0
- data/.gitignore +14 -0
- data/.manifest +24 -0
- data/COPYING +165 -0
- data/ChangeLog +7 -0
- data/Documentation/.gitignore +5 -0
- data/Documentation/GNUmakefile +30 -0
- data/Documentation/posix-mq.rb.1.txt +153 -0
- data/GIT-VERSION-FILE +1 -0
- data/GIT-VERSION-GEN +40 -0
- data/GNUmakefile +179 -0
- data/LICENSE +16 -0
- data/NEWS +4 -0
- data/README +70 -0
- data/Rakefile +159 -0
- data/bin/posix-mq.rb +138 -0
- data/ext/posix_mq/extconf.rb +9 -0
- data/ext/posix_mq/posix_mq.c +813 -0
- data/lib/posix_mq.rb +34 -0
- data/local.mk.sample +70 -0
- data/man/man1/posix-mq.rb.1 +187 -0
- data/posix_mq.gemspec +39 -0
- data/setup.rb +1586 -0
- data/test/test_posix_mq.rb +225 -0
- metadata +88 -0
data/.document
ADDED
data/.gitignore
ADDED
data/.manifest
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
.document
|
2
|
+
.gitignore
|
3
|
+
.manifest
|
4
|
+
COPYING
|
5
|
+
ChangeLog
|
6
|
+
Documentation/.gitignore
|
7
|
+
Documentation/GNUmakefile
|
8
|
+
Documentation/posix-mq.rb.1.txt
|
9
|
+
GIT-VERSION-FILE
|
10
|
+
GIT-VERSION-GEN
|
11
|
+
GNUmakefile
|
12
|
+
LICENSE
|
13
|
+
NEWS
|
14
|
+
README
|
15
|
+
Rakefile
|
16
|
+
bin/posix-mq.rb
|
17
|
+
ext/posix_mq/extconf.rb
|
18
|
+
ext/posix_mq/posix_mq.c
|
19
|
+
lib/posix_mq.rb
|
20
|
+
local.mk.sample
|
21
|
+
man/man1/posix-mq.rb.1
|
22
|
+
posix_mq.gemspec
|
23
|
+
setup.rb
|
24
|
+
test/test_posix_mq.rb
|
data/COPYING
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/ChangeLog
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
all::
|
2
|
+
|
3
|
+
PANDOC = pandoc
|
4
|
+
PANDOC_OPTS = -f markdown --email-obfuscation=none --sanitize-html
|
5
|
+
pandoc = $(PANDOC) $(PANDOC_OPTS)
|
6
|
+
pandoc_html = $(pandoc) --toc -t html --no-wrap
|
7
|
+
|
8
|
+
man1 := $(addsuffix .1,posix-mq.rb)
|
9
|
+
html1 := $(addsuffix .html,$(man1))
|
10
|
+
|
11
|
+
all:: html man
|
12
|
+
|
13
|
+
html: $(html1)
|
14
|
+
man: $(man1)
|
15
|
+
|
16
|
+
install-html: html
|
17
|
+
mkdir -p ../doc/man1
|
18
|
+
install -m 644 $(html1) ../doc/man1
|
19
|
+
|
20
|
+
install-man: man
|
21
|
+
mkdir -p ../man/man1
|
22
|
+
install -m 644 $(man1) ../man/man1
|
23
|
+
|
24
|
+
%.1: %.1.txt
|
25
|
+
$(pandoc) -s -t man < $< > $@+ && mv $@+ $@
|
26
|
+
%.1.html: %.1.txt
|
27
|
+
$(pandoc_html) < $< > $@+ && mv $@+ $@
|
28
|
+
|
29
|
+
clean::
|
30
|
+
$(RM) $(man1) $(html1)
|
@@ -0,0 +1,153 @@
|
|
1
|
+
% posix-mq.rb(1) posix-mq.rb User Manual
|
2
|
+
% Ruby POSIX MQ hackers <ruby.posix.mq@librelist.com>
|
3
|
+
% Jan 1, 2010
|
4
|
+
|
5
|
+
# NAME
|
6
|
+
|
7
|
+
posix-mq.rb - command-line interface for POSIX message queues
|
8
|
+
|
9
|
+
# SYNOPSIS
|
10
|
+
|
11
|
+
MQUEUE=/name posix-mq.rb COMMAND [*OPTIONS*] [*ARGUMENTS*]
|
12
|
+
|
13
|
+
# DESCRIPTION
|
14
|
+
|
15
|
+
A command-line interface for manipulating POSIX message queues. It is
|
16
|
+
useful for testing and debugging applications using POSIX message
|
17
|
+
queues.
|
18
|
+
|
19
|
+
# COMMANDS
|
20
|
+
|
21
|
+
*create* - create a new message queue
|
22
|
+
|
23
|
+
*attr* - output attributes of the message queue
|
24
|
+
|
25
|
+
*send* - insert a message into the queue from stdin or the command-line
|
26
|
+
|
27
|
+
*receive* - take a message from the queue and outputs it to stdout
|
28
|
+
|
29
|
+
*wait* - sleep until a message is available in the queue
|
30
|
+
|
31
|
+
*unlink* - unlink the message queue
|
32
|
+
|
33
|
+
# CREATE USAGE
|
34
|
+
|
35
|
+
The *create* command accepts the following options:
|
36
|
+
|
37
|
+
-x, \--exclusive
|
38
|
+
: This causes queue creation to fail if the queue exists.
|
39
|
+
|
40
|
+
-m, \--mode MODE
|
41
|
+
: The MODE to open the file under, the actual mode of the queue
|
42
|
+
will be AND-ed with the current umask (like open(2)).
|
43
|
+
|
44
|
+
-c, \--maxmsg COUNT
|
45
|
+
: The maximum messages in the queue. The default and limit of this
|
46
|
+
value is system-dependent. This must be specified if \--msgsize is
|
47
|
+
also specified.
|
48
|
+
|
49
|
+
-s, \--msgsize BYTES
|
50
|
+
: The maximum size of an individual message. The default and limit of
|
51
|
+
this value is system-dependent. This must be specified if \--maxmsg
|
52
|
+
is also specified.
|
53
|
+
|
54
|
+
# ATTR USAGE
|
55
|
+
|
56
|
+
The *attr* command takes no special options nor command-line arguments.
|
57
|
+
The output format of this command is suitable for "eval" in
|
58
|
+
shell scripts. Sample output is below:
|
59
|
+
|
60
|
+
flags=0
|
61
|
+
maxmsg=10
|
62
|
+
msgsize=8192
|
63
|
+
curmsgs=3
|
64
|
+
|
65
|
+
See mq_getattr(3) for information on the meaning of the fields.
|
66
|
+
|
67
|
+
# SEND USAGE
|
68
|
+
|
69
|
+
The *send* command will read a message from standard input if no
|
70
|
+
command-line arguments are given. If command-line arguments are
|
71
|
+
given, each argument is considered its own message and will be
|
72
|
+
inserted into the queue separately.
|
73
|
+
|
74
|
+
The following command-line arguments are accepted:
|
75
|
+
|
76
|
+
-n, \--nonblock
|
77
|
+
: Exit immediately with error if the message queue is full.
|
78
|
+
Normally posix-mq.rb(1) will block until the queue is writable or
|
79
|
+
interrupted. This may not be used in conjunction with \--timeout .
|
80
|
+
-t, \--timeout SECONDS
|
81
|
+
: Timeout and exit with error after SECONDS if the message queue is full.
|
82
|
+
This may not be used in conjunction with \--nonblock.
|
83
|
+
-p, \--priority PRIORITY
|
84
|
+
: Specify an integer PRIORITY, this value should be 0 through 31
|
85
|
+
(inclusive) for portability across POSIX-compliant systems.
|
86
|
+
The default priority is 0.
|
87
|
+
|
88
|
+
# RECEIVE USAGE
|
89
|
+
|
90
|
+
The *receive* command will output message to standard output. It will
|
91
|
+
read a message from standard input if no command-line arguments are
|
92
|
+
given. If command-line arguments are given, each argument is considered
|
93
|
+
its own message and will be inserted into the queue separately.
|
94
|
+
|
95
|
+
The following command-line arguments are accepted:
|
96
|
+
|
97
|
+
-n, \--nonblock
|
98
|
+
: Exit immediately with error if the message queue is empty.
|
99
|
+
Normally posix-mq.rb(1) will block until the queue is readable or
|
100
|
+
interrupted. This may not be used in conjunction with \--timeout .
|
101
|
+
-t, \--timeout SECONDS
|
102
|
+
: Timeout and exit with error after SECONDS if the message queue is empty.
|
103
|
+
This may not be used in conjunction with \--nonblock.
|
104
|
+
-p, \--priority
|
105
|
+
: Output the priority of the received message to stderr in the following
|
106
|
+
format:
|
107
|
+
|
108
|
+
priority=3
|
109
|
+
|
110
|
+
The priority is an unsigned integer.
|
111
|
+
|
112
|
+
# WAIT USAGE
|
113
|
+
|
114
|
+
The *wait* command will cause posix-mq.rb(1) to sleep until a message is
|
115
|
+
available in the queue. Only one process may wait on an empty queue,
|
116
|
+
posix-mq.rb(1) will exit with an error if there is another waiting process.
|
117
|
+
|
118
|
+
It takes no arguments and accepts the following options:
|
119
|
+
|
120
|
+
-t, \--timeout SECONDS
|
121
|
+
: Timeout and exit with error after SECONDS if the message queue is empty.
|
122
|
+
|
123
|
+
# UNLINK USAGE
|
124
|
+
|
125
|
+
The *unlink* command prevents further opening and use of the current
|
126
|
+
queue. Existing processes with the queue open may continue to operate
|
127
|
+
on the queue indefinitely. If a new queue is created with the same
|
128
|
+
name, the created queue is a different queue from the unlinked queue.
|
129
|
+
See mq_unlink(3) for more information.
|
130
|
+
|
131
|
+
# GENERAL OPTIONS
|
132
|
+
-q
|
133
|
+
: Do not show warning/error messages, suitable for scripting.
|
134
|
+
|
135
|
+
\-h, \--help
|
136
|
+
: Show summary usage
|
137
|
+
|
138
|
+
# ENVIRONMENT
|
139
|
+
|
140
|
+
All commands rely on the MQUEUE environment variable. The value
|
141
|
+
of MQUEUE should always be prefixed with a slash ("/") for
|
142
|
+
portability.
|
143
|
+
|
144
|
+
# DIAGNOSTICS
|
145
|
+
|
146
|
+
Exit status is normally 0. Exit status is 2 if a timeout occurs, 1 for
|
147
|
+
all other errors.
|
148
|
+
|
149
|
+
# SEE ALSO
|
150
|
+
|
151
|
+
* [mq_overview(7)][1]
|
152
|
+
|
153
|
+
[1]: http://kernel.org/doc/man-pages/online/pages/man7/mq_overview.7.html
|
data/GIT-VERSION-FILE
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
GIT_VERSION = 0.1.0
|
data/GIT-VERSION-GEN
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
GVF=GIT-VERSION-FILE
|
4
|
+
DEF_VER=v0.1.0.GIT
|
5
|
+
|
6
|
+
LF='
|
7
|
+
'
|
8
|
+
|
9
|
+
# First see if there is a version file (included in release tarballs),
|
10
|
+
# then try git-describe, then default.
|
11
|
+
if test -f version
|
12
|
+
then
|
13
|
+
VN=$(cat version) || VN="$DEF_VER"
|
14
|
+
elif test -d .git -o -f .git &&
|
15
|
+
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
|
16
|
+
case "$VN" in
|
17
|
+
*$LF*) (exit 1) ;;
|
18
|
+
v[0-9]*)
|
19
|
+
git update-index -q --refresh
|
20
|
+
test -z "$(git diff-index --name-only HEAD --)" ||
|
21
|
+
VN="$VN-dirty" ;;
|
22
|
+
esac
|
23
|
+
then
|
24
|
+
VN=$(echo "$VN" | sed -e 's/-/./g');
|
25
|
+
else
|
26
|
+
VN="$DEF_VER"
|
27
|
+
fi
|
28
|
+
|
29
|
+
VN=$(expr "$VN" : v*'\(.*\)')
|
30
|
+
|
31
|
+
if test -r $GVF
|
32
|
+
then
|
33
|
+
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
|
34
|
+
else
|
35
|
+
VC=unset
|
36
|
+
fi
|
37
|
+
test "$VN" = "$VC" || {
|
38
|
+
echo >&2 "GIT_VERSION = $VN"
|
39
|
+
echo "GIT_VERSION = $VN" >$GVF
|
40
|
+
}
|
data/GNUmakefile
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
# use GNU Make to run tests in parallel, and without depending on RubyGems
|
2
|
+
all::
|
3
|
+
RUBY = ruby
|
4
|
+
RAKE = rake
|
5
|
+
GIT_URL = git://git.bogomips.org/ruby_posix_mq.git
|
6
|
+
|
7
|
+
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
8
|
+
@./GIT-VERSION-GEN
|
9
|
+
-include GIT-VERSION-FILE
|
10
|
+
-include local.mk
|
11
|
+
ifeq ($(DLEXT),) # "so" for Linux
|
12
|
+
DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts Config::CONFIG["DLEXT"]')
|
13
|
+
endif
|
14
|
+
ifeq ($(RUBY_VERSION),)
|
15
|
+
RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
|
16
|
+
endif
|
17
|
+
|
18
|
+
base_bins := posix-mq.rb
|
19
|
+
bins := $(addprefix bin/, $(base_bins))
|
20
|
+
man1_bins := $(addsuffix .1, $(base_bins))
|
21
|
+
man1_paths := $(addprefix man/man1/, $(man1_bins))
|
22
|
+
|
23
|
+
install: $(bins)
|
24
|
+
$(prep_setup_rb)
|
25
|
+
$(RM) -r .install-tmp
|
26
|
+
mkdir .install-tmp
|
27
|
+
cp -p bin/* .install-tmp
|
28
|
+
$(RUBY) setup.rb all
|
29
|
+
$(RM) $^
|
30
|
+
mv .install-tmp/* bin/
|
31
|
+
$(RM) -r .install-tmp
|
32
|
+
$(prep_setup_rb)
|
33
|
+
|
34
|
+
setup_rb_files := .config InstalledFiles
|
35
|
+
prep_setup_rb := @-$(RM) $(setup_rb_files);$(MAKE) -C $(ext) clean
|
36
|
+
|
37
|
+
clean:
|
38
|
+
-$(MAKE) -C ext/posix_mq clean
|
39
|
+
$(RM) $(setup_rb_files) ext/posix_mq/Makefile
|
40
|
+
|
41
|
+
man:
|
42
|
+
$(MAKE) -C Documentation install-man
|
43
|
+
|
44
|
+
pkg_extra := GIT-VERSION-FILE NEWS ChangeLog
|
45
|
+
manifest: $(pkg_extra) man
|
46
|
+
$(RM) .manifest
|
47
|
+
$(MAKE) .manifest
|
48
|
+
|
49
|
+
.manifest:
|
50
|
+
(git ls-files && \
|
51
|
+
for i in $@ $(pkg_extra) $(man1_paths); \
|
52
|
+
do echo $$i; done) | LC_ALL=C sort > $@+
|
53
|
+
cmp $@+ $@ || mv $@+ $@
|
54
|
+
$(RM) $@+
|
55
|
+
|
56
|
+
NEWS: GIT-VERSION-FILE
|
57
|
+
$(RAKE) -s news_rdoc > $@+
|
58
|
+
mv $@+ $@
|
59
|
+
|
60
|
+
SINCE =
|
61
|
+
ChangeLog: LOG_VERSION = \
|
62
|
+
$(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
|
63
|
+
echo $(GIT_VERSION) || git describe)
|
64
|
+
ifneq ($(SINCE),)
|
65
|
+
ChangeLog: log_range = v$(SINCE)..$(LOG_VERSION)
|
66
|
+
endif
|
67
|
+
ChangeLog: GIT-VERSION-FILE
|
68
|
+
@echo "ChangeLog from $(GIT_URL) ($(log_range))" > $@+
|
69
|
+
@echo >> $@+
|
70
|
+
git log $(log_range) | sed -e 's/^/ /' >> $@+
|
71
|
+
mv $@+ $@
|
72
|
+
|
73
|
+
news_atom := http://bogomips.org/ruby_posix_mq/NEWS.atom.xml
|
74
|
+
cgit_atom := http://git.bogomips.org/cgit/ruby_posix_mq.git/atom/?h=master
|
75
|
+
atom = <link rel="alternate" title="Atom feed" href="$(1)" \
|
76
|
+
type="application/atom+xml"/>
|
77
|
+
|
78
|
+
# using rdoc 2.4.1+
|
79
|
+
doc: .document NEWS ChangeLog
|
80
|
+
for i in $(man1_bins); do > $$i; done
|
81
|
+
rdoc -Na -t "$(shell sed -ne '1s/^= //p' README)"
|
82
|
+
install -m644 COPYING doc/COPYING
|
83
|
+
install -m644 $(shell grep '^[A-Z]' .document) doc/
|
84
|
+
$(MAKE) -C Documentation install-html install-man
|
85
|
+
install -m644 $(man1_paths) doc/
|
86
|
+
cd doc && for i in $(base_bins); do \
|
87
|
+
html=$$(echo $$i | sed 's/\.rb/_rb/')_1.html; \
|
88
|
+
sed -e '/"documentation">/r man1/'$$i'.1.html' \
|
89
|
+
< $$html > tmp && mv tmp $$html; done
|
90
|
+
$(RUBY) -i -p -e \
|
91
|
+
'$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
|
92
|
+
doc/ChangeLog.html
|
93
|
+
$(RUBY) -i -p -e \
|
94
|
+
'$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
|
95
|
+
doc/NEWS.html doc/README.html
|
96
|
+
$(RAKE) -s news_atom > doc/NEWS.atom.xml
|
97
|
+
cd doc && ln README.html tmp && mv tmp index.html
|
98
|
+
$(RM) $(man1_bins)
|
99
|
+
|
100
|
+
ifneq ($(VERSION),)
|
101
|
+
rfproject := qrp
|
102
|
+
rfpackage := posix_mq
|
103
|
+
pkggem := pkg/$(rfpackage)-$(VERSION).gem
|
104
|
+
pkgtgz := pkg/$(rfpackage)-$(VERSION).tgz
|
105
|
+
release_notes := release_notes-$(VERSION)
|
106
|
+
release_changes := release_changes-$(VERSION)
|
107
|
+
|
108
|
+
release-notes: $(release_notes)
|
109
|
+
release-changes: $(release_changes)
|
110
|
+
$(release_changes):
|
111
|
+
$(RAKE) -s release_changes > $@+
|
112
|
+
$(VISUAL) $@+ && test -s $@+ && mv $@+ $@
|
113
|
+
$(release_notes):
|
114
|
+
GIT_URL=$(GIT_URL) $(RAKE) -s release_notes > $@+
|
115
|
+
$(VISUAL) $@+ && test -s $@+ && mv $@+ $@
|
116
|
+
|
117
|
+
# ensures we're actually on the tagged $(VERSION), only used for release
|
118
|
+
verify:
|
119
|
+
test x"$(shell umask)" = x0022
|
120
|
+
git rev-parse --verify refs/tags/v$(VERSION)^{}
|
121
|
+
git diff-index --quiet HEAD^0
|
122
|
+
test `git rev-parse --verify HEAD^0` = \
|
123
|
+
`git rev-parse --verify refs/tags/v$(VERSION)^{}`
|
124
|
+
|
125
|
+
fix-perms:
|
126
|
+
-git ls-tree -r HEAD | awk '/^100644 / {print $$NF}' | xargs chmod 644
|
127
|
+
-git ls-tree -r HEAD | awk '/^100755 / {print $$NF}' | xargs chmod 755
|
128
|
+
|
129
|
+
gem: $(pkggem)
|
130
|
+
|
131
|
+
install-gem: $(pkggem)
|
132
|
+
gem install $(CURDIR)/$<
|
133
|
+
|
134
|
+
$(pkggem): manifest fix-perms
|
135
|
+
gem build $(rfpackage).gemspec
|
136
|
+
mkdir -p pkg
|
137
|
+
mv $(@F) $@
|
138
|
+
|
139
|
+
$(pkgtgz): distdir = $(basename $@)
|
140
|
+
$(pkgtgz): HEAD = v$(VERSION)
|
141
|
+
$(pkgtgz): manifest fix-perms
|
142
|
+
@test -n "$(distdir)"
|
143
|
+
$(RM) -r $(distdir)
|
144
|
+
mkdir -p $(distdir)
|
145
|
+
tar c `cat .manifest` | (cd $(distdir) && tar x)
|
146
|
+
cd pkg && tar c $(basename $(@F)) | gzip -9 > $(@F)+
|
147
|
+
mv $@+ $@
|
148
|
+
|
149
|
+
package: $(pkgtgz) $(pkggem)
|
150
|
+
|
151
|
+
test-release: verify package $(release_notes) $(release_changes)
|
152
|
+
release: verify package $(release_notes) $(release_changes)
|
153
|
+
# make tgz release on RubyForge
|
154
|
+
rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
|
155
|
+
$(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
|
156
|
+
# push gem to Gemcutter
|
157
|
+
gem push $(pkggem)
|
158
|
+
# in case of gem downloads from RubyForge releases page
|
159
|
+
-rubyforge add_file \
|
160
|
+
$(rfproject) $(rfpackage) $(VERSION) $(pkggem)
|
161
|
+
else
|
162
|
+
gem install-gem: GIT-VERSION-FILE
|
163
|
+
$(MAKE) $@ VERSION=$(GIT_VERSION)
|
164
|
+
endif
|
165
|
+
|
166
|
+
ext := ext/posix_mq/posix_mq_ext.$(DLEXT)
|
167
|
+
ext/posix_mq/Makefile: ext/posix_mq/extconf.rb
|
168
|
+
cd $(@D) && $(RUBY) extconf.rb
|
169
|
+
$(ext): $(wildcard $(addprefix ext/posix_mq/,*.c *.h)) ext/posix_mq/Makefile
|
170
|
+
$(MAKE) -C $(@D)
|
171
|
+
|
172
|
+
all:: test
|
173
|
+
|
174
|
+
build: $(ext)
|
175
|
+
test: test-unit
|
176
|
+
test-unit: build
|
177
|
+
$(RUBY) -I lib:ext/posix_mq test/test_posix_mq.rb
|
178
|
+
|
179
|
+
.PHONY: .FORCE-GIT-VERSION-FILE doc manifest man test
|
data/LICENSE
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
posix_mq is copyrighted Free Software by all contributors, see logs in
|
2
|
+
revision control for names and email addresses of all of them.
|
3
|
+
|
4
|
+
You can redistribute it and/or modify it under either the terms of the GNU
|
5
|
+
Lesser General Public License as published by the Free Software Foundation,
|
6
|
+
version 3.0 {LGPLv3}[http://www.gnu.org/licenses/lgpl-3.0.txt] (see
|
7
|
+
link:COPYING).
|
8
|
+
|
9
|
+
posix_mq is distributed in the hope that it will be useful, but WITHOUT
|
10
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
11
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
12
|
+
License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public License
|
15
|
+
along with the GNU C Library; if not, write to the Free Software
|
16
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|