Skip to content

Commit

Permalink
Add Homebrew formula.
Browse files Browse the repository at this point in the history
The build-setup is pinched from [gitsh]. Thanks @georgebrock and
@mike-burns.

Closes #27.

[gitsh]: https://github.com/thoughtbot/gitsh/
  • Loading branch information
teoljungberg authored and calleluks committed Feb 27, 2015
1 parent 0181c74 commit e603a64
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
core*
pick
vgcore*
homebrew-formulae

# Generated by Autotools
.deps
Expand Down
4 changes: 4 additions & 0 deletions DEVELOPING.md
Expand Up @@ -51,3 +51,7 @@ Release

6. [Announce the release on
GitHub](https://github.com/thoughtbot/pick/releases/new).

7. Release Homebrew package by running:

make release
37 changes: 37 additions & 0 deletions Makefile.am
Expand Up @@ -4,3 +4,40 @@ EXTRA_DIST=INSTALL.md INSTALL.md.in LICENSE README.md

INSTALL.md: INSTALL.md.in
sed -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' $@.in > $@

.PHONY: release \
release_build release_push release_clean \
release_build_homebrew \
release_push_homebrew \
release_clean_homebrew

edit_package = sed \
-e 's|@PACKAGE[@]|$(PACKAGE)|g' \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e 's|@DIST_ARCHIVES[@]|$(DIST_ARCHIVES)|g' \
-e 's|@DIST_SHA[@]|$(DIST_SHA)|g'

release: release_build release_push release_clean

release_build: release_build_homebrew

release_push: release_push_homebrew

release_clean: release_clean_homebrew

release_build_homebrew: DIST_SHA
git clone git@github.com:thoughtbot/homebrew-formulae.git homebrew-formulae
$(edit_package) homebrew/pick.rb.in > homebrew-formulae/Formula/pick.rb
cd homebrew-formulae &&\
git addd Formula/pick.rb &&\
git commit -am "pick: Release version $(PACKAGE_VERSION)"

release_push_homebrew:
cd homebrew-formulae &&\
git push

release_clean_homebrew:
rm -rf homebrew-formulae

DIST_SHA: Makefile distcheck
$(eval DIST_SHA := $(shell shasum $(srcdir)/$(DIST_ARCHIVES) | cut -d' ' -f1))
16 changes: 16 additions & 0 deletions homebrew/pick.rb.in
@@ -0,0 +1,16 @@
require "formula"

class Pick < Formula
homepage "http://thoughtbot.github.io/@PACKAGE@/"
url "https://github.com/thoughtbot/@PACKAGE@/releases/download/v@PACKAGE_VERSION@/@DIST_ARCHIVES@"
sha1 "@DIST_SHA@"

def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end

test do
system "#{bin}/pick", "-v"
end
end

0 comments on commit e603a64

Please sign in to comment.