Skip to content

Commit

Permalink
Changed the Makefile of the mongodb cookbook to include the version n…
Browse files Browse the repository at this point in the history
…umber in the resulting tarball.
  • Loading branch information
Markus Korn committed Sep 22, 2011
1 parent 0ace030 commit a643814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DIRS = mongodb

BUILD_DIR=build

dist: clean
dist:
mkdir -p $(BUILD_DIR)
for i in $(DIRS); do make -C $$i $@; done

Expand Down
6 changes: 3 additions & 3 deletions mongodb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ COOKBOOK=mongodb
BRANCH=master

BUILD_DIR=../build
DIST=$(BUILD_DIR)/$(COOKBOOK).tar.gz
DIST_PREFIX=$(BUILD_DIR)/$(COOKBOOK)

all: metadata.json

clean:
-rm metadata.json
-rm $(DIST)

metadata.json:
-rm $@
knife cookbook metadata -o .. $(COOKBOOK)

dist: clean metadata.json
mkdir -p $(BUILD_DIR)
tar --exclude-vcs --exclude=Makefile -cvzf $(DIST) ../$(COOKBOOK)
version=`python -c "import json;c = json.load(open('metadata.json')); print c.get('version', 'UNKNOWN')"`; \
tar --exclude-vcs --exclude=Makefile -cvzf $(DIST_PREFIX)-$$version.tar.gz ../$(COOKBOOK)

0 comments on commit a643814

Please sign in to comment.