view Makefile @ 85:1f5544a8870b

Add a script to import python-fastimport to our liking
author Roy Marples <roy@marples.name>
date Tue, 19 Jan 2021 22:53:29 +0000
parents 0a4367911035
children b18c5670f6c0
line wrap: on
line source

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)