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