summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2013-03-15 02:44:19 -0400
committerAnand Avati <avati@redhat.com>2013-03-22 11:55:07 -0700
commitbf3db1f609a9eb6de4dead98f6cc6e9beedf1975 (patch)
treec598b1e8bdf88d61f97c61254568654ef86dfd7f
parentfec34ce4531d37ed6639054f1071f9123883251a (diff)
glusterfs.spec.in: sync with fedora glusterfs.spec
remove hard-coded reference to swift version and dist tarballs minor improvements for rpm builds for regression tests, including adding cache on build.gluster.org to avoid random failures due to transient network or dns failures causing curl or git to fail. BUG: 819130 Change-Id: I4f1213056ae2987dd2202f9cfbb3ed4f16ffc7cf Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/4674 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Justin Clift <jclift@redhat.com> Tested-by: Justin Clift <jclift@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--extras/LinuxRPM/Makefile.am50
1 files changed, 32 insertions, 18 deletions
diff --git a/extras/LinuxRPM/Makefile.am b/extras/LinuxRPM/Makefile.am
index 91e707b..cf8f44a 100644
--- a/extras/LinuxRPM/Makefile.am
+++ b/extras/LinuxRPM/Makefile.am
@@ -1,11 +1,11 @@
-GFS_TAR = ../../glusterfs-3git.tar.gz
-UFO_TAR = ../../gluster-swift-ufo-3git.tar.gz
+GFS_TAR = ../../glusterfs-*git.tar.gz
+UFO_TAR = ../../gluster-swift-ufo-*git.tar.gz
GFS_SPEC = ../../glusterfs.spec
.PHONY: all
-all:
+all:
@echo "To build RPMS run 'make glusterrpms'"
.PHONY: glusterrpms prep srcrpm testsrpm clean
@@ -13,7 +13,7 @@ all:
glusterrpms: prep srcrpm rpms
-rm -rf rpmbuild
-prep::
+prep::
if [ ! -e $(GFS_TAR) -a ! -e $(UFO_TAR) -a ! -e $(GFS_SPEC) ]; then \
$(MAKE) -c ../.. dist; \
fi
@@ -21,23 +21,37 @@ prep::
-mkdir -p rpmbuild/RPMS
-mkdir -p rpmbuild/SRPMS
-rm -rf rpmbuild/SOURCES
- cd rpmbuild && git clone http://pkgs.fedoraproject.org/cgit/glusterfs.git > /dev/null && mv glusterfs SOURCES
- cp ../../*.tar.gz rpmbuild/SOURCES
- cp ../../glusterfs.spec rpmbuild/SPECS
+ @if [ -d /d/cache/glusterfs -a -e /d/cache/glusterfs/sources ]; then \
+ echo "copying glusterfs rpm files from local cache..." ; \
+ mkdir -p ./rpmbuild/SOURCES; \
+ cp /d/cache/glusterfs/* ./rpmbuild/SOURCES/ ; \
+ touch /d/cache/.gluster ; \
+ elif [ -x /usr/bin/git ]; then \
+ echo "fetching glusterfs rpm files from fedora git repo..."; \
+ cd ./rpmbuild && git clone git://pkgs.fedoraproject.org/glusterfs.git > /dev/null && mv glusterfs SOURCES; \
+ else \
+ echo "glusterfs rpm files not fetched, you don't have git installed!" ; \
+ exit 1 ; \
+ fi
+ cp ../../*.tar.gz ./rpmbuild/SOURCES
+ cp ../../glusterfs.spec ./rpmbuild/SPECS
-# openstack/launchpad 'hides' source tarballs behind javascript glorp,
-# and curl will fail to fetch it using their download URL; we're forced
-# to fetch it from somewhere else.
-# maybe someone with better awk and sed skills than I have can suggest
-# something better here.
-SWIFT_URL = http://pkgs.fedoraproject.org/repo/pkgs/glusterfs/$(shell grep -v gluster rpmbuild/SOURCES/sources | cut -d ' ' -f 3)/$(shell grep -v gluster rpmbuild/SOURCES/sources | cut -d ' ' -f 1)/$(shell grep -v gluster rpmbuild/SOURCES/sources | cut -d ' ' -f 3)
+# Remember to change folsom to grizzly when we rebase to grizzly
+SWIFT_TARBALL = $(shell grep -v gluster ./rpmbuild/SOURCES/sources | cut -d ' ' -f 3)
+SWIFT_MD5SIG = $(shell grep -v gluster ./rpmbuild/SOURCES/sources | cut -d ' ' -f 1)
+SWIFT_VERS = $(shell echo $(SWIFT_TARBALL) | grep -o 1\.[0-9]\.[0-9])
+SWIFT_URL = https://launchpad.net/swift/folsom/$(SWIFT_VERS)/+download/$(SWIFT_TARBALL)
prep::
- @if [ -x /usr/bin/curl -a ! -e rpmbuild/SOURCES/swift-1.7.4.tar.gz ]; then \
- echo "fetching swift..." ; \
- cd rpmbuild/SOURCES && /usr/bin/curl -s -O $(SWIFT_URL) ; \
- elif [ ! -x /usr/bin/curl ]; then \
- echo "you don't have curl installed, swift source not fetched" ; \
+ @if [ -e /d/cache/$(SWIFT_TARBALL) -a -d ./rpmbuild/SOURCES ]; then \
+ echo "copying swift source tarball from local cache..." ; \
+ cp /d/cache/$(SWIFT_TARBALL) ./rpmbuild/SOURCES/ ; \
+ touch /d/cache/.swift ; \
+ elif [ -x /usr/bin/curl -a -d ./rpmbuild/SOURCES ]; then \
+ echo "fetching swift from launchpad.net..." ; \
+ cd ./rpmbuild/SOURCES && /usr/bin/curl -sOL $(SWIFT_URL) ; \
+ else \
+ echo "swift source not fetched, you don't have curl installed!" ; \
exit 1 ; \
fi