From bf3db1f609a9eb6de4dead98f6cc6e9beedf1975 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 15 Mar 2013 02:44:19 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/4674 Tested-by: Gluster Build System Reviewed-by: Justin Clift Tested-by: Justin Clift Reviewed-by: Anand Avati --- extras/LinuxRPM/Makefile.am | 50 +++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'extras') diff --git a/extras/LinuxRPM/Makefile.am b/extras/LinuxRPM/Makefile.am index 91e707bf346..cf8f44a0550 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 -- cgit