view Makefile @ 95:3b398a887b95

Use a sqlite3 database to store the blob data if available This is much more performant than using a filesystem when we are dealing with a large number of blobs. If sqlite3 is not available, then fallback to writing to the filesystem. In both cases, the blob data is compressed before writing to save space. A new option has also been added to specify a path for persistent blob data. This is only really important for large continuous interations where the source data has no concept of export marks and thus only gets bigger. What we gain here is a reduction in the write load on the disk.
author Roy Marples <roy@marples.name>
date Thu, 21 Jan 2021 23:59:21 +0000
parents b18c5670f6c0
children
line wrap: on
line source

HG?=		hg
PYTHON?=	python

CHMOD?=		chmod
COMP?=		xz
COMP_SUFFIX?=	.xz
FIND?=		find
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
	$(FIND) . -type f -name "*.py[co]" -delete \
		-o -type d -name __pycache__ -delete

.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)