commit:     62f7c82bf8b0bdbec552b912e0f2e698fd23935f
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  6 19:45:18 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Aug  6 19:45:18 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/baselayout.git;a=commit;h=62f7c82b

Begin updating Makefile to work with git

Make live is used to make a tarball of the repository with all local
changes.

make release is used to make a release once it is tagged.

make snapshot is a work in progress; it is supposed to make a tarball of
the commit passed to it via GITREF=<commit>. The part that is missing is
I haven't decided how to name that tarball.

---
 Makefile | 39 ++++++++++++---------------------------
 1 file changed, 12 insertions(+), 27 deletions(-)

diff --git a/Makefile b/Makefile
index d55914f..45df6ad 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@
 
 PV = 2.3
 PKG = baselayout-$(PV)
+DISTFILE = $(PKG).tar.bz2
 
 DESTDIR =
 
@@ -86,39 +87,23 @@ layout: layout-dirs layout-$(OS)
        # FHS compatibility symlinks stuff
        ln -snf /var/tmp $(DESTDIR)/usr/tmp
 
-diststatus:
-       @if [ -z "$(PV)" ] ; then \
-               printf '\nrun: make dist PV=...\n\n'; \
-               exit 1; \
-       fi
-       if test -d .svn ; then \
-               svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
-               if test "x$$svnfiles" != "x" ; then \
-                       echo "Refusing to package tarball until svn is in 
sync:" ; \
-                       echo "$$svnfiles" ; \
-                       echo "make distforce to force packaging" ; \
-                       exit 1 ; \
-               fi \
-       fi 
-
-distlive:
+live:
        rm -rf /tmp/$(PKG)
        cp -r . /tmp/$(PKG)
-       tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.svn
+       tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.git
        rm -rf /tmp/$(PKG)
        ls -l /tmp/$(PKG).tar.bz2
 
-distsvn:
-       rm -rf $(PKG)
-       svn export -q . $(PKG)
-       echo $(PV) > $(PKG)/.pv
-       svn log . > $(PKG)/ChangeLog.svn
-       tar jcf $(PKG).tar.bz2 $(PKG)
-       rm -rf $(PKG)
-       ls -l $(PKG).tar.bz2
+release:
+       git show-ref -q --tags $(PKG)
+       git archive --prefix=$(PKG)/ $(PKG) | bzip2 > $(DISTFILE)
+       ls -l $(DISTFILE)
 
-dist: diststatus distsvn
+snapshot:
+       git show-ref -q $(GITREF)
+       git archive --prefix=$(PKG)/ $(GITREF) | bzip2 > 
$(PKG)-$(GITREF).tar.bz2
+       ls -l $(PKG)-$(GITREF).tar.bz2
 
-.PHONY: all clean install layout dist distforce diststatus
+.PHONY: all clean install layout  live release snapshot
 
 # vim: set ts=4 :

Reply via email to