make archive for homebrew release

This commit is contained in:
Junegunn Choi 2015-01-13 12:29:12 +09:00
parent 209a6d36ad
commit b8c4b35415
3 changed files with 22 additions and 5 deletions

View File

@ -21,8 +21,9 @@ check_binary() {
symlink() { symlink() {
echo " - Creating symlink: bin/$1 -> bin/fzf" echo " - Creating symlink: bin/$1 -> bin/fzf"
rm -f "$fzf_base"/bin/fzf (cd "$fzf_base"/bin &&
ln -sf "$fzf_base"/bin/$1 "$fzf_base"/bin/fzf rm -f fzf
ln -sf $1 fzf)
} }
download() { download() {

View File

@ -18,11 +18,24 @@ BINDIR := ../bin
BINARY32 := fzf-$(GOOS)_386 BINARY32 := fzf-$(GOOS)_386
BINARY64 := fzf-$(GOOS)_amd64 BINARY64 := fzf-$(GOOS)_amd64
RELEASE32 = fzf-$(shell fzf/$(BINARY64) --version)-$(GOOS)_386 VERSION = $(shell fzf/$(BINARY64) --version)
RELEASE64 = fzf-$(shell fzf/$(BINARY64) --version)-$(GOOS)_amd64 RELEASE32 = fzf-$(VERSION)-$(GOOS)_386
RELEASE64 = fzf-$(VERSION)-$(GOOS)_amd64
ARCHIVE64 = fzf-$(VERSION)-$(GOOS)_amd64-archive
all: test release all: test release
archive: ../$(ARCHIVE64).tar.gz
../$(ARCHIVE64).tar.gz: release
cd ../ && yes | ./install && \
git archive HEAD --output=$(ARCHIVE64).tar --prefix fzf-$(VERSION)/ && \
rm -rf fzf-$(VERSION)/bin && mkdir -p fzf-$(VERSION)/bin && \
cp -a bin/* fzf-$(VERSION)/bin/ && \
tar --append --file $(ARCHIVE64).tar fzf-$(VERSION)/bin/* && \
gzip -f $(ARCHIVE64).tar && rm -rf fzf-$(VERSION) && \
openssl sha1 $(notdir $@)
release: build release: build
cd fzf && \ cd fzf && \
cp $(BINARY32) $(RELEASE32) && tar -czf $(RELEASE32).tgz $(RELEASE32) && \ cp $(BINARY32) $(RELEASE32) && tar -czf $(RELEASE32).tgz $(RELEASE32) && \
@ -70,4 +83,4 @@ $(DISTRO): docker
docker run -i -t -v $(GOPATH):/go junegunn/$(DISTRO)-sandbox \ docker run -i -t -v $(GOPATH):/go junegunn/$(DISTRO)-sandbox \
sh -c 'cd /go/src/github.com/junegunn/fzf/src; /bin/bash' sh -c 'cd /go/src/github.com/junegunn/fzf/src; /bin/bash'
.PHONY: all build release test install uninstall clean docker linux $(DISTRO) .PHONY: all archive build release test install uninstall clean docker linux $(DISTRO)

View File

@ -81,6 +81,9 @@ make install
# Build executables and tarballs for Linux using Docker # Build executables and tarballs for Linux using Docker
make linux make linux
# Build tarball for Homebrew release
make archive
``` ```
Contribution Contribution