From adca28e456bb0e807c6c2fcf2e0c6fc76b804f21 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Fri, 29 May 2015 17:19:07 -0400 Subject: [PATCH] Fixes to handle #330/#331 --- rpm/SPECS/git-lfs.spec | 13 +++++++++---- rpm/build_rpms.bsh | 27 ++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/rpm/SPECS/git-lfs.spec b/rpm/SPECS/git-lfs.spec index 07ef6d6d..9e261e7b 100644 --- a/rpm/SPECS/git-lfs.spec +++ b/rpm/SPECS/git-lfs.spec @@ -15,18 +15,23 @@ Requires: git #Umm... excuse me what? %define debug_package %{nil} #I think this is because go links with --build-id=none for linux - #Uhhh... HOW DO I FIX THAT? Using an external linker + #Uhhh... HOW DO I FIX THAT? The answer is: go -ldflags '-linkmode=external' %endif %description - +Git Large File Storage (LFS) replaces large files such as audio samples, +videos, datasets, and graphics with text pointers inside Git, while +storing the file contents on a remote server like GitHub.com or GitHub +Enterprise. %prep %setup -q -n %{name}-%{version} +mkdir -p src/github.com/github +ln -s $(pwd) src/github.com/github/%{name} %build -./script/bootstrap -./script/man +GOPATH=`pwd` ./script/bootstrap +GOPATH=`pwd` ./script/man %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT diff --git a/rpm/build_rpms.bsh b/rpm/build_rpms.bsh index 0d9bdcb6..8f2ddb2a 100755 --- a/rpm/build_rpms.bsh +++ b/rpm/build_rpms.bsh @@ -27,11 +27,28 @@ REDHAT_NAME=$(awk '{print $1}' /etc/redhat-release) mkdir -p ${CURDIR}/{BUILD,BUILDROOT,SOURCES,RPMS,SRPMS} if [ ! -e ${CURDIR}/SOURCES/v${VERSION}.tar.gz ]; then - echo "Downloading git-lfs..." >&6 - mkdir -p ${CURDIR}/SOURCES - pushd ${CURDIR}/SOURCES - curl -L -O https://github.com/github/git-lfs/archive/v${VERSION}.tar.gz - popd + if [ "${BUILD_LOCAL:=0}" == "1" ]; then + echo "Zipping up current checkout of git-lfs..." >&6 + if [[ ${REDHAT_VERSION} == 5 ]]; then + rm -rvf ${CURDIR}/tmptar + mkdir -p ${CURDIR}/tmptar/git-lfs-${VERSION} + tar -c .. --exclude rpm --exclude .git --exclude tmptar | tar -x -C tmptar/git-lfs-${VERSION}/ + pushd ${CURDIR}/tmptar + tar -zcf ${CURDIR}/SOURCES/v${VERSION}.tar.gz git-lfs-${VERSION} + popd + rm -rvf ${CURDIR}/tmptar + else + pushd ${CURDIR}/.. + tar -zcf ${CURDIR}/SOURCES/v${VERSION}.tar.gz --exclude v${VERSION}.tar.gz --exclude .git --exclude rpm . --transform "s:^:git-lfs-${VERSION}/:" + popd + fi + else + echo "Downloading git-lfs..." >&6 + mkdir -p ${CURDIR}/SOURCES + pushd ${CURDIR}/SOURCES + curl -L -O https://github.com/github/git-lfs/archive/v${VERSION}.tar.gz + popd + fi fi if ! which go; then