annotate logstash.Makefile @ 15:c158cae7cd26

work on building from source
author Carl Byington <carl@five-ten-sg.com>
date Thu, 11 Apr 2013 10:18:06 -0700
parents 0e45fe64b10d
children aa606d801e02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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),)
15
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
9 JRUBY_CMD=java -jar /usr/share/jruby.jar
14
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:
14
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
18 # compile-grammer
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
19 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
20 make -C lib/logstash/config grammar.rb
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
21 # compile-runner
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
22 mkdir -p build/ruby
15
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
23 cd lib; $(JRUBYC) -5 -t ../build/ruby logstash/runner.rb
14
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
24 # copy-ruby-files
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
25 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
26 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
27 rsync -av ./spec build/ruby
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
28 # install-gems
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
29 mkdir -p vendor/bundle
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
30 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
31 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
32 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
33 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
34 # build-monolith
15
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
35 mkdir -p build/monolith/openssl
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
36 mkdir -p build/monolith/jopenssl
14
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
37 # unpack all jars
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
38 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
39 # 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
40 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
41 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
42 cp -r vendor/bundle/jruby/1.9/gems/jruby-openss*/lib/shared/openssl.rb build/monolith/openssl.rb
15
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
43 # purge any extra files we don't need in META-INF (like manifests and signature files)
14
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
44 rm -f build/monolith/META-INF/*.LIST
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
45 rm -f build/monolith/META-INF/*.MF
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
46 rm -f build/monolith/META-INF/*.RSA
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
47 rm -f build/monolith/META-INF/*.SF
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
48 rm -f build/monolith/META-INF/NOTICE
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
49 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
50 rm -f build/monolith/META-INF/LICENSE
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
51 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
52 cp $(GEOIP) build/monolith/
15
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
53 # build-logstash-jar
c158cae7cd26 work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 14
diff changeset
54 jar cfe build/logstash.jar logstash.runner \
14
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
55 -C build/ruby . \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
56 -C build/monolith . \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
57 -C vendor/bundle/jruby/1.9 gems \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
58 -C vendor/bundle/jruby/1.9 specifications \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
59 -C lib logstash/web/public \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
60 -C lib logstash/certs \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
61 -C lib logstash/web/views \
0e45fe64b10d work on building from source
Carl Byington <carl@five-ten-sg.com>
parents: 13
diff changeset
62 patterns