@@ -28,18 +28,15 @@ compile:
2828 $(REBAR ) compile
2929
3030deps :
31- $(if $(HEAD_REVISION ) ,$(warning "Warning: you have checked out a tag ($(HEAD_REVISION ) ) and should use the locked-deps target") )
32- $(REBAR ) get-deps
31+ $(if $(HEAD_REVISION ) ,$(warning "Warning: you have checked out a tag ($(HEAD_REVISION ) ) and should use the compile target") )
32+ $(REBAR ) upgrade
3333
3434clean : testclean
3535 $(REBAR ) clean
3636
3737distclean : clean devclean relclean ballclean
3838 @rm -rf _build
3939
40- locked-deps :
41- $(REBAR ) upgrade
42-
4340# #
4441# # Test targets
4542# #
@@ -75,14 +72,15 @@ test : testclean eunit test-deps
7572# #
7673# # Release targets
7774# #
78- rel : locked-deps compile
75+ rel : compile
7976 $(REBAR ) as rel release
8077 cp -a _build/rel/rel/riak rel/
8178
82- rel-rpm : locked-deps compile
83- $(REBAR ) as rel,rpm release
79+ rel-rpm : compile
80+ $(REBAR ) as rpm release
81+ cp -a _build/rpm/rel/riak rel/
8482
85- rel-deb : locked-deps compile
83+ rel-deb : compile
8684 $(REBAR ) as deb release
8785 cp -a _build/deb/rel/riak rel/
8886
@@ -214,46 +212,6 @@ REVISION = $(shell echo $(REPO_TAG) | sed -e 's/^$(REPO)-//')
214212# Changes to 1.0.3 or 1.1.0pre1 from example above
215213MAJOR_VERSION ?= $(shell echo $(REVISION ) | sed -e 's/\([0-9.]* \) -.*/\1/')
216214
217-
218- # #
219- # # Release tarball creation
220- # # Generates a tarball that includes all the deps sources so no checkouts are necessary
221- # #
222-
223- # Use git archive make a clean copy of a repository at a current
224- # revision and copy to a new directory
225- archive_git = git archive --format=tar --prefix=$(1 ) / HEAD | (cd $(2 ) && tar xf -)
226-
227- # Alternative to git archive to remove .git directory, but not any
228- # other files outside of the source tree (used for eleveldb which
229- # brings in leveldb)
230- clean_git = cp -R ../../$(1 ) $(2 ) /deps/ && find $(2 ) /$(1 ) -name .git -type d | xargs rm -rf
231-
232- # Determines which function to call. eleveldb is treated as a special case
233- archive = if [ "$(1 ) " = "deps/eleveldb" ]; then \
234- $(call clean_git,$(1 ) ,$(2 ) ) ; \
235- else \
236- $(call archive_git,$(1 ) ,$(2 ) ) ; \
237- fi
238-
239-
240- # Checkout tag, fetch deps (so we don't have to do it multiple times) and collect
241- # the version of all the dependencies into the MANIFEST_FILE
242- CLONEDIR ?= riak-clone
243- MANIFEST_FILE ?= dependency_manifest.git
244- get_dist_deps = mkdir distdir && \
245- git clone . distdir/$(CLONEDIR ) && \
246- cd distdir/$(CLONEDIR ) && \
247- git checkout $(REPO_TAG ) && \
248- $(MAKE ) locked-deps && \
249- echo "- Dependencies and their tags at build time of $(REPO ) at $(REPO_TAG ) " > $(MANIFEST_FILE ) && \
250- for dep in deps/*; do \
251- cd $${dep} && \
252- printf "$${dep} version ` git describe --long --tags 2> /dev/null || git rev-parse HEAD ` \n" >> ../../$(MANIFEST_FILE ) && \
253- cd ../..; done && \
254- LC_ALL=POSIX && export LC_ALL && sort $(MANIFEST_FILE ) > $(MANIFEST_FILE ) .tmp && mv $(MANIFEST_FILE ) .tmp $(MANIFEST_FILE ) ;
255-
256-
257215# Name resulting directory & tar file based on current status of the git tag
258216# If it is a tagged release (PKG_VERSION == MAJOR_VERSION), use the toplevel
259217# tag as the package name, otherwise generate a unique hash of all the
@@ -263,41 +221,6 @@ get_dist_deps = mkdir distdir && \
263221NAME_HASH = $(shell git hash-object distdir/$(CLONEDIR ) /$(MANIFEST_FILE ) 2>/dev/null | cut -c 1-8)
264222PKG_ID := $(REPO_TAG )
265223
266- # To ensure a clean build, copy the CLONEDIR at a specific tag to a new directory
267- # which will be the basis of the src tar file (and packages)
268- # The vsn.git file is required by rebar to be able to build from the resulting
269- # tar file
270- build_clean_dir = cd distdir/$(CLONEDIR ) && \
271- $(call archive_git,$(PKG_ID ) ,..) && \
272- cp $(MANIFEST_FILE ) ../$(PKG_ID ) / && \
273- mkdir ../$(PKG_ID ) /deps && \
274- for dep in deps/*; do \
275- cd $${dep} && \
276- $(call archive,$${dep},../../../$(PKG_ID ) ) && \
277- mkdir -p ../../../$(PKG_ID ) /$${dep}/priv && \
278- printf "` git describe --long --tags 2> /dev/null || git rev-parse HEAD ` " > ../../../$(PKG_ID ) /$${dep}/priv/vsn.git && \
279- cd ../..; \
280- done
281-
282-
283- distdir/$(CLONEDIR ) /$(MANIFEST_FILE ) :
284- $(if $(REPO_TAG ) , $(call get_dist_deps) , $(error "You can't generate a release tarball from a non-tagged revision. Run 'git checkout <tag>', then 'make dist'") )
285-
286- distdir/$(PKG_ID ) : distdir/$(CLONEDIR ) /$(MANIFEST_FILE )
287- $(call build_clean_dir)
288-
289- distdir/$(PKG_ID ) .tar.gz : distdir/$(PKG_ID )
290- tar -C distdir -czf distdir/$(PKG_ID ) .tar.gz $(PKG_ID )
291-
292- dist : distdir/$(PKG_ID ) .tar.gz
293- cp distdir/$(PKG_ID ) .tar.gz .
294-
295- ballclean :
296- rm -rf $(PKG_ID ) .tar.gz distdir
297-
298- pkgclean : ballclean
299- rm -rf package
300-
301224# #
302225# # Packaging targets
303226# #
@@ -319,10 +242,10 @@ packageclean:
319242export PKG_VERSION PKG_ID PKG_BUILD BASE_DIR ERLANG_BIN REBAR OVERLAY_VARS RELEASE
320243
321244# Package up a devrel to save time later rebuilding it
322- pkg-devrel : locked-deps devrel
245+ pkg-devrel : devrel
323246 echo -n $(PKG_REVISION ) > VERSION
324247 tar -czf $(PKG_ID ) -devrel.tar.gz dev/ VERSION
325248 rm -rf VERSION
326249
327- pkg-rel : locked-deps rel
250+ pkg-rel : rel
328251 tar -czf $(PKG_ID ) -rel.tar.gz -C rel/ .
0 commit comments