Added compatibility between build-centos and build_rpms scripts

Updated INSTALL.md
Added a numch of small changes so build-centos doesn't fail after
running build_rpms, and vice versa. Made compiling rpm with nodeps
easier
This commit is contained in:
Andy Neff 2015-06-19 18:11:42 -04:00
parent f8aa369260
commit e2f770c8f5
4 changed files with 36 additions and 20 deletions

@ -39,28 +39,44 @@ work. Not ideal, but 95% of people will just run ```./build_rpms.bsh``` and have
When all is down, install (or distribute) RPMS/git-lfs.rpm
### Alternative build ###
### Alternative build 1 ###
If you want to use your own ruby/golang without using build_rpms.bsh, just make sure
If you want to use your own ruby/golang without using the version from build_rpms.bsh,
you will have to disable dependencies on the rpms. It's pretty easy, just make sure
rconn and go are in the path, and run
```
NODEPS=1 ./build_rpms.bsh
```
### Alternative build 2 ###
If you want to use your own ruby/golang without using build_rpms.bsh, it is a little
more complicated. You have to make sure rconn and go are in the path, and create the
build structure, and download/create the tar.gz file used. This is not recommended,
but is possible
```
mkdir -p {BUILD,BUILDROOT,SOURCES,RPMS,SRPMS}
#download file to SOURCES/v{version number}.tar.gz
rpmbuild --define "_topdir `pwd`" -bb SPECS/git-lfs.spec --nodeps
#(and optionally)
rpmbuild --define "_topdir `pwd`" -bs SPECS/git-lfs.spec --nodeps
```
Or course, with this it is up to you to get the SOURCES/v**{version}**.tar.gz
### Releases ###
The only thing that needs to be updated with a new version is the version number in
git-lfs.spec needs to be updated. It will download:
lfs/lfs.go needs to be updated. build_rpm.bsh will download:
https://github.com/github/git-lfs/archive/v%{version}.tar.gz
This way when a new version is archived, it will always download get downloaded. When
preparing for a release, it would be advantageous to use the currentlt checked out
version to test against. In order do that, after running ./clean.bsh to set the
This way when a new version is archived, it will always get downloaded. When
preparing for a release, it would be advantageous to use the currently checked out
version to test against. In order do that, after running ./clean.bsh, set the
environment variable BUILD_LOCAL to 1
```
@ -74,8 +90,3 @@ BUILD_LOCAL=1 ./build_rpms.bsh
**A**) For some... STUPID reason, git-lfs.spec has to be OWNED by a valid used. Just chown
git-lfs.spec to a valid user AND group. root will do
### TODO ###
- Add a "use current checkout" mode to create a tar.gz out of the current checkout instead
of downloading the archive, for release testing BEFORE release is released.

@ -1,15 +1,15 @@
Name: git-lfs
Version: 0.5.1
Release: 1%{?dist}
Release: 1%{?dist}
Summary: Git extension for versioning large files
Group: Applications/Archiving
License: MIT
URL: https://git-lfs.github.com/
Source0: https://github.com/github/git-lfs/archive/v%{version}.tar.gz
URL: https://git-lfs.github.com/
Source0: https://github.com/github/git-lfs/archive/v%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: golang, tar, which, bison, rubygem-ronn, git
Requires: git
BuildRequires: golang, tar, which, bison, rubygem-ronn, git
Requires: git
%if 0%{?rhel} == 7
#Umm... excuse me what?

@ -4,9 +4,12 @@ set -eu
CURDIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
SPEC=${CURDIR}/SPECS/git-lfs.spec
#VERSION=$(\grep "^Version:" ${SPEC} | \grep -Eo [0-9.]+)
VERSION=$(\grep '^const Version' "${CURDIR}/../lfs/lfs.go" | sed 's|const Version = "\([0-9.]*\)"|\1|')
RPMBUILD=(rpmbuild --define "_topdir ${CURDIR}")
if [[ ${NODEPS:-0} == 0 ]]; then
RPMBUILD=(rpmbuild --define "_topdir ${CURDIR}")
else
RPMBUILD=(rpmbuild --define "_topdir ${CURDIR}" --nodeps)
fi
LOG=${CURDIR}/build.log
SUDO=${SUDO=sudo}
export PATH=${PATH}:/usr/local/bin

@ -53,8 +53,10 @@ if [[ ${REDHAT_VERSION[0]} == 5 ]]; then
./run.bash | true
popd
fi
export GOROOT=`pwd`/go
export PATH=${PATH}:${GOROOT}/bin
#If go isn't in the path, then it's in the go dir, so add it to the path
if ! which gofmt > /dev/null 2>&1; then
export PATH=${PATH}:`pwd`/go/bin
fi
fi
mkdir -p src/github.com/github