# HG changeset patch # User Roy Marples # Date 1611013072 0 # Node ID 0a436791103569535e0652c60067953ac60175fc # Parent fec9b2b96c5fdbf95e5114ea0180710e0363aeee Add a Makefile with some useful targets such as distinfo So I can make signed tarballs for distribution. The install-home target is taken from the evolve extension. diff -r fec9b2b96c5f -r 0a4367911035 Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Mon Jan 18 23:37:52 2021 +0000 @@ -0,0 +1,60 @@ +HG?= hg +PYTHON?= python + +CHMOD?= chmod +COMP?= xz +COMP_SUFFIX?= .xz +LS?= ls +RM?= rm +TAR?= tar +TAR_SUFFIX?= .tar + +# This isn't very portable, but I generaly make releases from NetBSD +CKSUM?= cksum -a SHA256 +PGP?= netpgp + +PACKAGE= hg-fastimport +PACKAGE_VER!= $(PYTHON) setup.py --version + +TARFILE= $(PACKAGE)-$(PACKAGE_VER)$(TAR_SUFFIX) +DISTFILE= $(TARFILE)$(COMP_SUFFIX) +DISTINFO= ${DISTFILE}.distinfo +DISTINFOSIGN= ${DISTINFO}.asc + +.PHONY: help +help: + @echo "Commonly used make targets:" + @echo " install-home - install with setup.py install --home=$$HOME ($(HOME))" + @echo " clean - removes any targets created by setup.py" + @echo " distclean - in addition to clean, removes distribution tarballs" + @echo " dist - create a distribution tarball from hg repository" + @echo " distinfo - in addition to dist, sign the distribution tarballs" + +.PHONY: all +all: help + +.PHONY: install-home +install-home: + $(PYTHON) setup.py install --home="$(HOME)" --prefix="" --force + +.PHONY: clean +clean: + $(RM) -rf build dist hg_fastimport.egg-info + +.PHONY: distclean +distclean: clean + $(RM) -f $(PACKAGE)*$(TAR_SUFFIX)* + +.PHONY: dist +dist: distclean + $(HG) archive $(TARFILE) + $(COMP) $(TARFILE) + @echo "created $(DISTFILE)" + +.PHONY: distinfo +distinfo: dist + $(RM) -f $(DISTINFO) $(DISTINFOSIGN) + $(CKSUM) $(DISTFILE) >$(DISTINFO) + ${PGP} --clearsign --output=$(DISTINFOSIGN) $(DISTINFO) + $(CHMOD) 644 $(DISTINFOSIGN) + $(LS) -l $(DISTFILE) $(DISTINFO) $(DISTINFOSIGN)