Mercurial > logstash
annotate logstash.Makefile @ 14:0e45fe64b10d
work on building from source
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 10 Apr 2013 21:24:14 -0700 |
parents | c0150404962d |
children | c158cae7cd26 |
rev | line source |
---|---|
14
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
1 # |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
2 # fedora uses system jruby |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
3 # el6 uses minimal jruby.jar |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
4 # |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
5 VERSION=$(shell awk -F\" '/LOGSTASH_VERSION/ {print $$2}' lib/logstash/version.rb) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
6 |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
7 SYSJRUBY=$(shell which jruby 2>/dev/null) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
8 ifeq ($(SYSJRUBY),) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
9 JRUBY_CMD=java -jar /usr/local/bin/jruby.jar |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
10 else |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
11 JRUBY_CMD=jruby |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
12 endif |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
13 WITH_JRUBY=$(JRUBY_CMD) -S |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
14 JRUBYC=$(WITH_JRUBY) jrubyc |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
15 GEOIP=GeoLiteCity.dat |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
16 |
13
c0150404962d
start working on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
17 all: |
c0150404962d
start working on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
18 echo '********** in my local makefile' |
c0150404962d
start working on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
19 |
14
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
20 # make the target directory to collect all the class files that will be in the final jar |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
21 mkdir target |
13
c0150404962d
start working on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
22 |
c0150404962d
start working on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
23 # make the logstash jar |
14
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
24 # compile-grammer |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
25 touch lib/logstash/config/grammar.rl # force rebuild |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
26 make -C lib/logstash/config grammar.rb |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
27 # compile-runner |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
28 mkdir -p build/ruby |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
29 (cd lib; $(JRUBYC) -5 -t ../build/ruby logstash/runner.rb) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
30 # copy-ruby-files |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
31 find ./lib -name '*.rb' | sed -e 's,^\./lib/,,' | (cd lib; cpio -p --make-directories ../build/ruby) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
32 find ./test -name '*.rb' | sed -e 's,^\./test/,,' | (cd test; cpio -p --make-directories ../build/ruby) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
33 rsync -av ./spec build/ruby |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
34 # install-gems |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
35 mkdir -p vendor/bundle |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
36 GEM_HOME=./vendor/bundle/jruby/1.9/ GEM_PATH= $(JRUBY_CMD) --1.9 ./gembag.rb logstash.gemspec |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
37 rm -rf ./vendor/bundle/jruby/1.9/gems/riak-client-1.0.3/pkg |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
38 rm -rf ./vendor/bundle/jruby/1.9/gems/*/spec |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
39 rm -rf ./vendor/bundle/jruby/1.9/gems/*/test |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
40 # build-monolith |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
41 mkdir -p build/monolith/openssl build/monolith/jopenssl |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
42 # unpack all jars |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
43 find $$PWD/vendor/bundle -name '*.jar' | (cd build/monolith; xargs -n1 jar xf) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
44 # copy openssl/lib/shared folders/files to root of jar - need this for openssl to work with JRuby |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
45 cp -r vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/openssl/* build/monolith/openssl |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
46 cp -r vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/jopenssl/* build/monolith/jopenssl |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
47 cp -r vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/openssl.rb build/monolith/openssl.rb |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
48 # purge any extra files we don't need in META-INF (like manifests and @# signature files) |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
49 rm -f build/monolith/META-INF/*.LIST |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
50 rm -f build/monolith/META-INF/*.MF |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
51 rm -f build/monolith/META-INF/*.RSA |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
52 rm -f build/monolith/META-INF/*.SF |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
53 rm -f build/monolith/META-INF/NOTICE |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
54 rm -f build/monolith/META-INF/NOTICE.txt |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
55 rm -f build/monolith/META-INF/LICENSE |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
56 rm -f build/monolith/META-INF/LICENSE.txt |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
57 cp $(GEOIP) build/monolith/ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
58 # build-monolith-jar |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
59 jar cfe build/logstash-$(VERSION)-monolithic.jar logstash.runner \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
60 -C build/ruby . \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
61 -C build/monolith . \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
62 -C vendor/bundle/jruby/1.9 gems \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
63 -C vendor/bundle/jruby/1.9 specifications \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
64 -C lib logstash/web/public \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
65 -C lib logstash/certs \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
66 -C lib logstash/web/views \ |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
67 patterns |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
68 # see what we have |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
69 unzip -t build/logstash-$(VERSION)-monolithic.jar >/tmp/log.mono.jar.txt |
0e45fe64b10d
work on building from source
Carl Byington <carl@five-ten-sg.com>
parents:
13
diff
changeset
|
70 sort /tmp/log.mono.jar.txt >/tmp/log.mono.jar.sort.txt |