changeset 23:bb48b2672ff2

use _javadir in spec files
author Carl Byington <carl@five-ten-sg.com>
date Fri, 19 Apr 2013 15:03:01 -0700
parents 226946e5dca4
children 0f249d38da21
files GraphTastic-client.spec Makefile elasticsearch.spec jruby.spec logstash.Makefile logstash.manifest
diffstat 6 files changed, 56 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/GraphTastic-client.spec	Wed Apr 17 19:38:59 2013 -0700
+++ b/GraphTastic-client.spec	Fri Apr 19 15:03:01 2013 -0700
@@ -1,7 +1,6 @@
 # prevent brp repack jar files
 %define __os_install_post %{nil}
 
-%define _bindir  /usr/local/bin
 %define gtcommit   06a620d011d08bd2c1099c0d0810c053bf105400
 
 Summary:        Plot metrics sent from logstash
@@ -15,7 +14,7 @@
 #Source0:         https://github.com/NickPadilla/GraphTastic/tar.gz/%{gtcommit} >GraphTastic.tar.gz
 Source0:        GraphTastic.tar.gz
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires:  java-1.7.0-openjdk-devel
+BuildRequires:  java-devel
 
 %description
 
@@ -33,8 +32,8 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_bindir}
-install -D -p -m 644 src/main/java/graphtastic-client.jar $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT%{_javadir}
+install -D -p -m 644 src/main/java/graphtastic-client.jar $RPM_BUILD_ROOT%{_javadir}
 
 
 %clean
@@ -43,7 +42,7 @@
 
 %files
 %defattr(-,root,root,-)
-%attr(0755,root,root) %{_bindir}/*
+%attr(0755,root,root) %{_javadir}/*
 
 
 
--- a/Makefile	Wed Apr 17 19:38:59 2013 -0700
+++ b/Makefile	Fri Apr 19 15:03:01 2013 -0700
@@ -1,38 +1,46 @@
-d=el6
-f=logstash-1.1.10-monolithic.jar
+ifeq ($(dist),)
+dist=.f20
+endif
+
 gv=1.1.10
+f=logstash-$(gv)-monolithic.jar
 g=logstash-$(gv).tar.gz
-hv=0.20.2
-hv=0.20.5
+hv=0.20.6
 h=elasticsearch-$(hv).tar.gz
 i=GraphTastic.tar.gz
 icc=06a620d011d08bd2c1099c0d0810c053bf105400
-jv=1.7.1
 jv=1.7.3
 j=jruby-complete-$(jv).jar
 k=GeoLite-City-2013-01-18.dat.gz
 
 download:
-	[ -f $f ] || curl https://logstash.objects.dreamhost.com/release/$f >$f
-	[ -f $g ] || curl https://nodeload.github.com/logstash/logstash/tar.gz/v$(gv) >$g
-	[ -f $h ] || curl https://nodeload.github.com/elasticsearch/elasticsearch/tar.gz/v$(hv) >$h
-	[ -f $i ] || curl https://nodeload.github.com/NickPadilla/GraphTastic/tar.gz/$(icc) >$i
-	[ -f $j ] || curl http://repository.codehaus.org/org/jruby/jruby-complete/$(jv)/$j >$j
-	[ -f $k ] || curl http://logstash.objects.dreamhost.com/maxmind/$k >$k
+	[ -f $(f) ] || curl https://logstash.objects.dreamhost.com/release/$(f) >$(f)
+	[ -f $(g) ] || curl https://nodeload.github.com/logstash/logstash/tar.gz/v$(gv) >$(g)
+	[ -f $(h) ] || curl https://nodeload.github.com/elasticsearch/elasticsearch/tar.gz/v$(hv) >$(h)
+	[ -f $(i) ] || curl https://nodeload.github.com/NickPadilla/GraphTastic/tar.gz/$(icc) >$(i)
+	[ -f $(j) ] || curl http://repository.codehaus.org/org/jruby/jruby-complete/$(jv)/$(j) >$(j)
+	[ -f $(k) ] || curl http://logstash.objects.dreamhost.com/maxmind/$(k) >$(k)
 
 srpm: download
-	make -f logstash.Makefile manifest
-	rm -rf ~/.m2
-	rpmbuild --define "dist .$d" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs jruby.spec
-	rpmbuild --define "dist .$d" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs GraphTastic-client.spec
-	rpmbuild --define "dist .$d" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs elasticsearch.spec
-	rpmbuild --define "dist .$d" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs logstash.spec
+	# build the classpath in a manifest file
+	echo "Class-Path: /usr/share/jruby.jar /usr/share/graphtastic-client.jar " >logstash.manifest
+	for i in /usr/share/elasticsearch/{elasticsearch,jna,jts,log4j,lucene-{core,analyzers,highlighter,memory,queries},snappy-java,spatial4j}.jar; do \
+		echo "  $$i" >>logstash.manifest; \
+	done
+	# build the source rpms
+	rpmbuild --define "dist $(dist)" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs jruby.spec
+	rpmbuild --define "dist $(dist)" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs GraphTastic-client.spec
+	rpmbuild --define "dist $(dist)" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs elasticsearch.spec
+	rpmbuild --define "dist $(dist)" --define "_sourcedir $(shell pwd)" --define "_srcrpmdir $(shell pwd)" --define "_rpmdir $(shell pwd)" -bs logstash.spec
 
 rpm:
-	rpmbuild --define "dist .$d" --define "_rpmdir $(shell pwd)" --rebuild jruby-$(jv)-0.$d.src.rpm
-	rpmbuild --define "dist .$d" --define "_rpmdir $(shell pwd)" --rebuild GraphTastic-client-0.0.0-0.$d.src.rpm
-	rpmbuild --define "dist .$d" --define "_rpmdir $(shell pwd)" --rebuild elasticsearch-$(hv)-0.$d.src.rpm
-	rpmbuild --define "dist .$d" --define "_rpmdir $(shell pwd)" --rebuild logstash-$(gv)-0.$d.src.rpm
+	# kill off maven repository cache
+	rm -rf ~/.m2
+	# build binary rpms
+	rpmbuild --define "dist $(dist)" --define "_rpmdir $(shell pwd)" --rebuild jruby-$(jv)-0$(dist).src.rpm
+	rpmbuild --define "dist $(dist)" --define "_rpmdir $(shell pwd)" --rebuild GraphTastic-client-0.0.0-0$(dist).src.rpm
+	rpmbuild --define "dist $(dist)" --define "_rpmdir $(shell pwd)" --rebuild elasticsearch-$(hv)-0$(dist).src.rpm
+	rpmbuild --define "dist $(dist)" --define "_rpmdir $(shell pwd)" --rebuild logstash-$(gv)-0$(dist).src.rpm
 
 package-web:
 	tar cfz logstash.fedora.tar.gz *.src.rpm $$(hg status -c | cut -c3-)
--- a/elasticsearch.spec	Wed Apr 17 19:38:59 2013 -0700
+++ b/elasticsearch.spec	Fri Apr 19 15:03:01 2013 -0700
@@ -1,25 +1,23 @@
 # prevent brp repack jar files
 %define __os_install_post %{nil}
 
-%define _bindir  /usr/local/bin/elasticsearch
 
 Summary:        elasticsearch is a scalable full text search engine
 Name:           elasticsearch
-Version:        0.20.5
+Version:        0.20.6
 Release:        0%{?dist}
 Group:          System Environment/Daemons
 License:        Apache 2.0
 URL:            http://www.elasticsearch.org/
 BuildArch:      noarch
-#Source0:         curl https://nodeload.github.com/elasticsearch/elasticsearch/tar.gz/v%{version} >elasticsearch-%{version}.tar.gz
-Source0:        %{name}-%{version}.tar.gz
+Source0:        https://nodeload.github.com/%{name}/%{name}/tar.gz/v%{version}/%{name}-%{version}.tar.gz
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildRequires:  java-1.7.0-openjdk-devel
+BuildRequires:  java-devel
 
 %if "%{?dist}" != ".el6"
 # el6 does not have maven yet, so we assume it is manually installed
 # in /usr/local/apache-maven-3.0.5
-BuildRequires:  maven
+BuildRequires:  maven-local
 %endif
 
 %description
@@ -41,10 +39,12 @@
 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
+    install -D -p -m 644 $f $RPM_BUILD_ROOT%{_javadir}/%{name}/$b
 done
+cd $RPM_BUILD_ROOT%{_javadir}/%{name}
 for f in elasticsearch jna jts log4j lucene-core 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
+    v=$(echo $f*.jar)
+    ln --symbolic $v $f.jar
 done
 
 
@@ -54,7 +54,7 @@
 
 %files
 %defattr(-,root,root,-)
-%attr(0755,root,root) %{_bindir}
+%attr(0755,root,root) %{_javadir}/%{name}
 
 
 
--- a/jruby.spec	Wed Apr 17 19:38:59 2013 -0700
+++ b/jruby.spec	Fri Apr 19 15:03:01 2013 -0700
@@ -1,8 +1,6 @@
 # prevent brp repack jar files
 %define __os_install_post %{nil}
 
-%define _bindir  /usr/share
-
 Summary:        just enough jruby for el6 to get logstash running
 Name:           jruby
 Version:        1.7.3
@@ -26,7 +24,7 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -D -p -m 644 %SOURCE0 $RPM_BUILD_ROOT/%{_bindir}/%{name}.jar
+install -D -p -m 644 %SOURCE0 $RPM_BUILD_ROOT/%{_javadir}/%{name}.jar
 
 
 %clean
@@ -35,7 +33,7 @@
 
 %files
 %defattr(-,root,root,-)
-%attr(0755,root,root) %{_bindir}/*
+%attr(0755,root,root) %{_javadir}/*
 
 
 
--- a/logstash.Makefile	Wed Apr 17 19:38:59 2013 -0700
+++ b/logstash.Makefile	Fri Apr 19 15:03:01 2013 -0700
@@ -66,9 +66,3 @@
 		-C lib logstash/web/views					 \
 		patterns
 
-manifest:
-	# build the classpath in a manifest file
-	echo "Class-Path: /usr/share/jruby.jar /usr/local/bin/graphtastic-client.jar " >logstash.manifest
-	for i in /usr/local/bin/elasticsearch/{elasticsearch,jna,jts,log4j,lucene-{core,analyzers,highlighter,memory,queries},snappy-java,spatial4j}.jar; do \
-		echo "  $$i" >>logstash.manifest; \
-	done
--- a/logstash.manifest	Wed Apr 17 19:38:59 2013 -0700
+++ b/logstash.manifest	Fri Apr 19 15:03:01 2013 -0700
@@ -1,12 +1,12 @@
-Class-Path: /usr/share/jruby.jar /usr/local/bin/graphtastic-client.jar 
-  /usr/local/bin/elasticsearch/elasticsearch.jar
-  /usr/local/bin/elasticsearch/jna.jar
-  /usr/local/bin/elasticsearch/jts.jar
-  /usr/local/bin/elasticsearch/log4j.jar
-  /usr/local/bin/elasticsearch/lucene-core.jar
-  /usr/local/bin/elasticsearch/lucene-analyzers.jar
-  /usr/local/bin/elasticsearch/lucene-highlighter.jar
-  /usr/local/bin/elasticsearch/lucene-memory.jar
-  /usr/local/bin/elasticsearch/lucene-queries.jar
-  /usr/local/bin/elasticsearch/snappy-java.jar
-  /usr/local/bin/elasticsearch/spatial4j.jar
+Class-Path: /usr/share/jruby.jar /usr/share/graphtastic-client.jar 
+  /usr/share/elasticsearch/elasticsearch.jar
+  /usr/share/elasticsearch/jna.jar
+  /usr/share/elasticsearch/jts.jar
+  /usr/share/elasticsearch/log4j.jar
+  /usr/share/elasticsearch/lucene-core.jar
+  /usr/share/elasticsearch/lucene-analyzers.jar
+  /usr/share/elasticsearch/lucene-highlighter.jar
+  /usr/share/elasticsearch/lucene-memory.jar
+  /usr/share/elasticsearch/lucene-queries.jar
+  /usr/share/elasticsearch/snappy-java.jar
+  /usr/share/elasticsearch/spatial4j.jar