Files
cgrates/packages/Makefile
2020-02-06 15:07:46 +01:00

33 lines
862 B
Makefile

DISTRIBUTION ?= stable
GIT_COMMIT=$(shell git log -n1 --format=format:%h)
GIT_DATE=$(shell date +%Y%m%d%H%M%S --date="@$(shell git log -n1 --format=format:%ct)")
ifeq ($(GIT_COMMIT),)
echo "Error: Failed to extract commit from git log"
exit 1
endif
ifeq ($(GIT_DATE),)
echo "Error: Failed to extract date from git log"
exit 1
endif
DEBIAN_VERSION=$(shell dpkg-parsechangelog -S Version -ldebian/changelog 2> /dev/null)
ifeq ($(DEBIAN_VERSION),)
echo "Error: Failed to extract version from debian changelog"
exit 1
endif
DEBIAN_PKG_VERSION=$(DEBIAN_VERSION)
make deb:
cd ..;\
ln -sf packages/debian debian ;\
dch -v "$(DEBIAN_PKG_VERSION)" -m "Package build for git commit $(GIT_COMMIT) ($(GIT_DATE))." -D "$(DISTRIBUTION)" --force-distribution ;\
dpkg-buildpackage -rfakeroot -tc; \
rm debian
git checkout debian/changelog
.PHONY: deb squeeze