Mercurial > logstash
changeset 18:2b887e35b5cd
work on building from source
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 15 Apr 2013 19:33:28 -0700 |
parents | 292b6583148a |
children | 729f36e68da8 |
files | Makefile elasticsearch.spec logstash.Makefile logstash.manifest logstash.rc logstash.sysconfig |
diffstat | 6 files changed, 24 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Apr 12 15:05:23 2013 -0700 +++ b/Makefile Mon Apr 15 19:33:28 2013 -0700 @@ -33,5 +33,5 @@ rpmbuild --define "dist .$d" --define "_rpmdir $(shell pwd)" --rebuild logstash-$(gv)-0.$d.src.rpm package-web: - tar cfz logstash.fedora.tar.gz *.src.rpm $(hg status -c | cut -c3-) + tar cfz logstash.fedora.tar.gz *.src.rpm $$(hg status -c | cut -c3-)
--- a/elasticsearch.spec Fri Apr 12 15:05:23 2013 -0700 +++ b/elasticsearch.spec Mon Apr 15 19:33:28 2013 -0700 @@ -1,7 +1,7 @@ # prevent brp repack jar files %define __os_install_post %{nil} -%define _bindir /usr/local/bin +%define _bindir /usr/local/bin/elasticsearch Summary: elasticsearch is a scalable full text search engine Name: elasticsearch @@ -31,26 +31,22 @@ %build [ "%{?dist}" == ".el6" ] && export PATH=/usr/local/apache-maven-3.0.5/bin:$PATH -sed -i -e 's,guava</include>,guava</include> \ - <include>org.apache.lucene:lucene</include> \ - <include>log4j:log4j</include> \ - <include>net.java.dev.jna:jna</include> \ - <include>org.xerial.snappy:snappy-java</include> \ - <include>com.spatial4j:spatial4j</include> \ - <include>com.vividsolutions:jts</include>,g' pom.xml -sed -i -e 's,<optional>true</optional>,,g' pom.xml -sed -i -e 's,useTransitiveFiltering>true,useTransitiveFiltering>false,g' src/main/assemblies/common-bin.xml -echo '*********' pom.xml -cat pom.xml -echo '*********' src/main/assemblies/common-bin.xml -cat src/main/assemblies/common-bin.xml mvn -Dmaven.test.skip=true clean package %install rm -rf $RPM_BUILD_ROOT -install -D -p -m 644 target/elasticsearch-%{version}.jar $RPM_BUILD_ROOT%{_bindir}/elasticsearch.jar -find . -name '*.jar' +mkdir xx +cd xx +tar xfz ../target/releases/%{name}-%{version}.tar.gz +for f in %{name}-%{version}/lib/*.jar; do + b=$(basename $f) + install -D -p -m 644 $f $RPM_BUILD_ROOT%{_bindir}/$b +done +rm -f $RPM_BUILD_ROOT%{_bindir}/lucene-core*.jar +for f in elasticsearch jna jts log4j lucene-analyzers lucene-highlighter lucene-memory lucene-queries snappy-java spatial4j; do + mv $RPM_BUILD_ROOT%{_bindir}/$f*.jar $RPM_BUILD_ROOT%{_bindir}/$f.jar +done %clean @@ -59,7 +55,7 @@ %files %defattr(-,root,root,-) -%attr(0755,root,root) %{_bindir}/* +%attr(0755,root,root) %{_bindir}
--- a/logstash.Makefile Fri Apr 12 15:05:23 2013 -0700 +++ b/logstash.Makefile Mon Apr 15 19:33:28 2013 -0700 @@ -51,6 +51,9 @@ rm -f build/monolith/META-INF/LICENSE.txt rm -rf build/monolith/org/jruby/ext/openssl cp $(GEOIP) build/monolith/ + # build the classpath in a manifest file + #echo -n "Class-Path: /usr/share/jruby.jar /usr/local/bin/graphtastic-client.jar " >logstash.manifest + #echo /usr/local/bin/{elasticsearch,jna,jts,log4j,lucene-analyzers,lucene-highlighter,lucene-memory,lucene-queries,snappy-java,spatial4j}.jar >>logstash.manifest # build-logstash-jar jar cfme build/logstash.jar logstash.manifest logstash.runner \ -C build/ruby . \
--- a/logstash.manifest Fri Apr 12 15:05:23 2013 -0700 +++ b/logstash.manifest Mon Apr 15 19:33:28 2013 -0700 @@ -1,1 +1,1 @@ -Class-Path: /usr/share/jruby.jar /usr/local/bin/graphtastic-client.jar /usr/local/bin/elasticsearch.jar +Class-Path: /usr/share/jruby.jar /usr/local/bin/graphtastic-client.jar /usr/local/bin/elasticsearch.jar /usr/local/bin/jna.jar /usr/local/bin/jts.jar /usr/local/bin/log4j.jar /usr/local/bin/lucene-analyzers.jar /usr/local/bin/lucene-highlighter.jar /usr/local/bin/lucene-memory.jar /usr/local/bin/lucene-queries.jar /usr/local/bin/snappy-java.jar /usr/local/bin/spatial4j.jar
--- a/logstash.rc Fri Apr 12 15:05:23 2013 -0700 +++ b/logstash.rc Mon Apr 15 19:33:28 2013 -0700 @@ -31,7 +31,7 @@ CONFIGFILE=/etc/logstash/logstash.conf LOGFILE=/var/log/logstash/logstash.log JARNAME=/usr/local/bin/logstash.jar -ARGS="-jar $JARNAME agent --config $CONFIGFILE --log $LOGFILE $AGENTARGS -- web $WEBARGS" +ARGS="$JAVAARGS -jar $JARNAME agent --config $CONFIGFILE --log $LOGFILE $AGENTARGS -- web $WEBARGS" PIDFILE=/var/run/logstash.pid base=logstash @@ -50,7 +50,7 @@ cd $HOME pid=$( exec sudo -u logstash /bin/bash - <<EOF - $JAVA $ARGS & + $JAVA $ARGS & echo \$! EOF )
--- a/logstash.sysconfig Fri Apr 12 15:05:23 2013 -0700 +++ b/logstash.sysconfig Mon Apr 15 19:33:28 2013 -0700 @@ -3,7 +3,9 @@ # used by /etc/rc.d/init.d/logstash +# extra args for java +#JAVAARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 -verbose" # extra args for agent -AGENTARGS= +AGENTARGS=-v # args for web -WEBARGS="--backend elasticsearch://127.0.0.1/?local" \ No newline at end of file +WEBARGS="--backend elasticsearch://127.0.0.1/?local"