sleepy_penguin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README
3
+ TODO
4
+ NEWS
5
+ ChangeLog
6
+ lib
7
+ ext/sleepy_penguin/init.c
8
+ ext/sleepy_penguin/eventfd.c
9
+ ext/sleepy_penguin/timerfd.c
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ /local.mk
2
+ *.o
3
+ *.log
4
+ *.so
5
+ *.rbc
6
+ /.config
7
+ /InstalledFiles
8
+ /doc
9
+ /local.mk
10
+ /test/install-*
11
+ Makefile
12
+ log/
13
+ pkg/
14
+ /NEWS
15
+ /ChangeLog
16
+ /.manifest
17
+ /GIT-VERSION-FILE
18
+ /man
19
+ tags
20
+ TAGS
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/GIT-VERSION-GEN ADDED
@@ -0,0 +1,40 @@
1
+ #!/bin/sh
2
+
3
+ GVF=GIT-VERSION-FILE
4
+ DEF_VER=v1.0.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,192 @@
1
+ # use GNU Make to run tests in parallel, and without depending on RubyGems
2
+ all::
3
+ RUBY = ruby
4
+ RAKE = rake
5
+ RSYNC = rsync
6
+ GIT_URL = git://git.bogomips.org/sleepy_penguin.git
7
+
8
+ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
9
+ @./GIT-VERSION-GEN
10
+ -include GIT-VERSION-FILE
11
+ -include local.mk
12
+ ifeq ($(DLEXT),) # "so" for Linux
13
+ DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts Config::CONFIG["DLEXT"]')
14
+ endif
15
+ ifeq ($(RUBY_VERSION),)
16
+ RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
17
+ endif
18
+
19
+ install:
20
+ $(prep_setup_rb)
21
+ $(RM) -r .install-tmp
22
+ mkdir .install-tmp
23
+ $(RUBY) setup.rb all
24
+ $(RM) $^
25
+ $(RM) -r .install-tmp
26
+ $(prep_setup_rb)
27
+
28
+ setup_rb_files := .config InstalledFiles
29
+ prep_setup_rb := @-$(RM) $(setup_rb_files);$(MAKE) -C $(ext) clean
30
+
31
+ clean:
32
+ -$(MAKE) -C ext/sleepy_penguin clean
33
+ $(RM) $(setup_rb_files) ext/sleepy_penguin/Makefile
34
+
35
+ pkg_extra := GIT-VERSION-FILE NEWS ChangeLog
36
+ manifest: $(pkg_extra)
37
+ $(RM) .manifest
38
+ $(MAKE) .manifest
39
+
40
+ .manifest:
41
+ (git ls-files && \
42
+ for i in $@ $(pkg_extra); \
43
+ do echo $$i; done) | LC_ALL=C sort > $@+
44
+ cmp $@+ $@ || mv $@+ $@
45
+ $(RM) $@+
46
+
47
+ NEWS: GIT-VERSION-FILE
48
+ $(RAKE) -s news_rdoc > $@+
49
+ mv $@+ $@
50
+
51
+ latest: NEWS
52
+ @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
53
+
54
+ SINCE =
55
+ ChangeLog: LOG_VERSION = \
56
+ $(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
57
+ echo $(GIT_VERSION) || git describe)
58
+ ifneq ($(SINCE),)
59
+ ChangeLog: log_range = v$(SINCE)..$(LOG_VERSION)
60
+ endif
61
+ ChangeLog: GIT-VERSION-FILE
62
+ @echo "ChangeLog from $(GIT_URL) ($(log_range))" > $@+
63
+ @echo >> $@+
64
+ git log $(log_range) | sed -e 's/^/ /' >> $@+
65
+ mv $@+ $@
66
+
67
+ news_atom := http://bogomips.org/sleepy_penguin/NEWS.atom.xml
68
+ cgit_atom := http://git.bogomips.org/cgit/sleepy_penguin.git/atom/?h=master
69
+ atom = <link rel="alternate" title="Atom feed" href="$(1)" \
70
+ type="application/atom+xml"/>
71
+
72
+ # using rdoc 2.5.x
73
+ doc: .document NEWS ChangeLog
74
+ rdoc -t "$(shell sed -ne '1s/^= //p' README)"
75
+ install -m644 COPYING doc/COPYING
76
+ install -m644 $(shell grep '^[A-Z]' .document) doc/
77
+ $(RUBY) -i -p -e \
78
+ '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
79
+ doc/ChangeLog.html
80
+ $(RUBY) -i -p -e \
81
+ '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
82
+ doc/NEWS.html doc/README.html
83
+ $(RAKE) -s news_atom > doc/NEWS.atom.xml
84
+ cd doc && ln README.html tmp && mv tmp index.html
85
+
86
+ ifneq ($(VERSION),)
87
+ rfproject := rainbows
88
+ rfpackage := sleepy_penguin
89
+ pkggem := pkg/$(rfpackage)-$(VERSION).gem
90
+ pkgtgz := pkg/$(rfpackage)-$(VERSION).tgz
91
+ release_notes := release_notes-$(VERSION)
92
+ release_changes := release_changes-$(VERSION)
93
+
94
+ release-notes: $(release_notes)
95
+ release-changes: $(release_changes)
96
+ $(release_changes):
97
+ $(RAKE) -s release_changes > $@+
98
+ $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
99
+ $(release_notes):
100
+ GIT_URL=$(GIT_URL) $(RAKE) -s release_notes > $@+
101
+ $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
102
+
103
+ # ensures we're actually on the tagged $(VERSION), only used for release
104
+ verify:
105
+ test x"$(shell umask)" = x0022
106
+ git rev-parse --verify refs/tags/v$(VERSION)^{}
107
+ git diff-index --quiet HEAD^0
108
+ test `git rev-parse --verify HEAD^0` = \
109
+ `git rev-parse --verify refs/tags/v$(VERSION)^{}`
110
+
111
+ fix-perms:
112
+ -git ls-tree -r HEAD | awk '/^100644 / {print $$NF}' | xargs chmod 644
113
+ -git ls-tree -r HEAD | awk '/^100755 / {print $$NF}' | xargs chmod 755
114
+
115
+ gem: $(pkggem)
116
+
117
+ install-gem: $(pkggem)
118
+ gem install $(CURDIR)/$<
119
+
120
+ $(pkggem): manifest fix-perms
121
+ gem build $(rfpackage).gemspec
122
+ mkdir -p pkg
123
+ mv $(@F) $@
124
+
125
+ $(pkgtgz): distdir = $(basename $@)
126
+ $(pkgtgz): HEAD = v$(VERSION)
127
+ $(pkgtgz): manifest fix-perms
128
+ @test -n "$(distdir)"
129
+ $(RM) -r $(distdir)
130
+ mkdir -p $(distdir)
131
+ tar c `cat .manifest` | (cd $(distdir) && tar x)
132
+ cd pkg && tar c $(basename $(@F)) | gzip -9 > $(@F)+
133
+ mv $@+ $@
134
+
135
+ package: $(pkgtgz) $(pkggem)
136
+
137
+ test-release: verify package $(release_notes) $(release_changes)
138
+ release: verify package $(release_notes) $(release_changes)
139
+ # make tgz release on RubyForge
140
+ rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
141
+ $(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
142
+ # push gem to Gemcutter
143
+ gem push $(pkggem)
144
+ # in case of gem downloads from RubyForge releases page
145
+ -rubyforge add_file \
146
+ $(rfproject) $(rfpackage) $(VERSION) $(pkggem)
147
+ $(RAKE) raa_update VERSION=$(VERSION)
148
+ $(RAKE) publish_news VERSION=$(VERSION)
149
+ else
150
+ gem install-gem: GIT-VERSION-FILE
151
+ $(MAKE) $@ VERSION=$(GIT_VERSION)
152
+ endif
153
+
154
+ extdir := ext/sleepy_penguin
155
+ ext := $(extdir)/sleepy_penguin_ext.$(DLEXT)
156
+ $(extdir)/Makefile: $(extdir)/extconf.rb
157
+ cd $(@D) && $(RUBY) extconf.rb
158
+
159
+ $(ext): $(wildcard $(extdir)/*.c) $(wildcard $(extdir)/*.h) $(extdir)/Makefile
160
+ $(MAKE) -C $(@D)
161
+
162
+ all:: test
163
+
164
+ build: $(ext)
165
+ test_units := $(wildcard test/test_*.rb)
166
+ test: test-unit
167
+ test-unit: $(test_units)
168
+ $(test_units): build
169
+ $(RUBY) -I lib:$(extdir) $@
170
+
171
+ # this requires GNU coreutils variants
172
+ publish_doc:
173
+ -git set-file-times
174
+ $(RM) -r doc ChangeLog NEWS
175
+ $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
176
+ $(MAKE) -s latest > doc/LATEST
177
+ find doc/images doc/js -type f | \
178
+ TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
179
+ $(MAKE) doc_gz
180
+ chmod 644 $$(find doc -type f)
181
+ $(RSYNC) -av doc/ bogomips.org:/srv/bogomips/sleepy_penguin/
182
+ git ls-files | xargs touch
183
+
184
+ # Create gzip variants of the same timestamp as the original so nginx
185
+ # "gzip_static on" can serve the gzipped versions directly.
186
+ doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
187
+ doc_gz:
188
+ touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
189
+ for i in $(docs); do \
190
+ gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
191
+
192
+ .PHONY: .FORCE-GIT-VERSION-FILE doc manifest man test $(test_units)
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ sleepy_penguin is copyrighted Free Software by all contributors, see
2
+ logs in revision control for names and email addresses of all of them.
3
+
4
+ You can redistribute it and/or modify it under the terms of the GNU
5
+ Lesser General Public License (LGPL) as published by the Free Software
6
+ Foundation, version {2.1}[http://www.gnu.org/licenses/lgpl-2.1.txt] or
7
+ or {3}[http://www.gnu.org/licenses/lgpl-3.0.txt] (see link:COPYING).
8
+ The project leader (Eric Wong) reserves the right to relicense raindrops
9
+ under future versions of the LGPL.
10
+
11
+ sleepy_penguin is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
14
+ General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this library; if not, write to the Free Software
18
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301