diff options
-rwxr-xr-x | install | 5 | ||||
-rw-r--r-- | src/Makefile | 19 | ||||
-rw-r--r-- | src/README.md | 3 |
3 files changed, 22 insertions, 5 deletions
@@ -21,8 +21,9 @@ check_binary() { symlink() { echo " - Creating symlink: bin/$1 -> bin/fzf" - rm -f "$fzf_base"/bin/fzf - ln -sf "$fzf_base"/bin/$1 "$fzf_base"/bin/fzf + (cd "$fzf_base"/bin && + rm -f fzf + ln -sf $1 fzf) } download() { diff --git a/src/Makefile b/src/Makefile index 43a7bc05..2758164f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,11 +18,24 @@ BINDIR := ../bin BINARY32 := fzf-$(GOOS)_386 BINARY64 := fzf-$(GOOS)_amd64 -RELEASE32 = fzf-$(shell fzf/$(BINARY64) --version)-$(GOOS)_386 -RELEASE64 = fzf-$(shell fzf/$(BINARY64) --version)-$(GOOS)_amd64 +VERSION = $(shell fzf/$(BINARY64) --version) +RELEASE32 = fzf-$(VERSION)-$(GOOS)_386 +RELEASE64 = fzf-$(VERSION)-$(GOOS)_amd64 +ARCHIVE64 = fzf-$(VERSION)-$(GOOS)_amd64-archive 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 cd fzf && \ cp $(BINARY32) $(RELEASE32) && tar -czf $(RELEASE32).tgz $(RELEASE32) && \ @@ -70,4 +83,4 @@ $(DISTRO): docker docker run -i -t -v $(GOPATH):/go junegunn/$(DISTRO)-sandbox \ 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) diff --git a/src/README.md b/src/README.md index c071865c..915e96ac 100644 --- a/src/README.md +++ b/src/README.md @@ -81,6 +81,9 @@ make install # Build executables and tarballs for Linux using Docker make linux + +# Build tarball for Homebrew release +make archive ``` Contribution |