From 9bd9d7a72e1ac651c71a2c84dd83073fbe6246fa Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 3 May 2020 17:00:46 +0200 Subject: [PATCH] buildsys: move submodule to src, cleanups it's nicer as the build system is more coherent, i.e., I can do `make install` from inside src and it actually works ;) Use an atomic target for the build directory, else we can easily get bogus builds. Further use only one type of GNU make variable flavors, not both $() and ${} mixed.. Signed-off-by: Thomas Lamprecht --- .gitmodules | 2 +- Makefile | 30 +++++++++++++++--------------- src/Makefile | 2 +- acme.sh => src/acme.sh | 0 4 files changed, 17 insertions(+), 17 deletions(-) rename acme.sh => src/acme.sh (100%) diff --git a/.gitmodules b/.gitmodules index 9e2f450..0ffb408 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "acme.sh"] - path = acme.sh + path = src/acme.sh url = https://github.com/acmesh-official/acme.sh.git diff --git a/Makefile b/Makefile index 9d2655a..1d487cb 100644 --- a/Makefile +++ b/Makefile @@ -8,26 +8,26 @@ GITVERSION:=$(shell git rev-parse HEAD) DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc -DNSAPI="acme.sh/dnsapi" +ACME_SUBMODULE="src/acme.sh" all: $(DEB) .PHONY: submodule submodule: - test -d $(DNSAPI) || git submodule update --init --recursive + test -d ${ACME_SUBMODULE}/README.md || git submodule update --init --recursive -$(BUILDDIR): src debian submodule - rm -rf $(BUILDDIR) - rsync -a src/ debian $(BUILDDIR) - rsync -a $(DNSAPI) $(BUILDDIR) - # remove if repository exists - # echo "git clone git://git.proxmox.com/git/proxmox-acme\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE +${BUILDDIR}: src debian submodule + rm -rf ${BUILDDIR}.tmp + cp -a src ${BUILDDIR}.tmp + cp -a debian ${BUILDDIR}.tmp/ + echo "git clone git://git.proxmox.com/git/proxmox-acme\\ngit checkout ${GITVERSION}" > ${BUILDDIR}.tmp/debian/SOURCE + mv ${BUILDDIR}.tmp ${BUILDDIR} .PHONY: deb -deb: $(DEB) -$(DEB): $(BUILDDIR) - cd $(BUILDDIR); dpkg-buildpackage -b -us -uc - lintian $(DEB) +deb: ${DEB} +${DEB}: ${BUILDDIR} + cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc + lintian ${DEB} .PHONY: dsc dsc: ${DSC} @@ -35,12 +35,12 @@ ${DSC}: ${BUILDDIR} cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d lintian ${DSC} -dinstall: $(DEB) - dpkg -i $(DEB) +dinstall: ${DEB} + dpkg -i ${DEB} .PHONY: clean clean: - rm -rf $(BUILDDIR) *.deb *.buildinfo *.changes *.dsc *.tar.gz + rm -rf ${BUILDDIR} ${BUILDDIR}.tmp *.deb *.buildinfo *.changes *.dsc *.tar.gz .PHONY: upload upload: ${DEB} diff --git a/src/Makefile b/src/Makefile index 2725143..9bf2e70 100644 --- a/src/Makefile +++ b/src/Makefile @@ -114,7 +114,7 @@ all: .PHONY: install install: install -D -m 0744 proxmox-acme ${DESTDIR}${ACMEDIR}/proxmox-acme - for f in ${ACME_SOURCES}; do install -D -m 0644 $$f ${DESTDIR}${ACMEDIR}/$$f; done + for f in ${ACME_SOURCES}; do install -D -m 0644 acme.sh/$$f ${DESTDIR}${ACMEDIR}/$$f; done install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE/ACME for f in ${LIB_SOURCES}; do install -D -m 0644 PVE/$$f ${DESTDIR}${PERLDIR}/PVE/$$f; done diff --git a/acme.sh b/src/acme.sh similarity index 100% rename from acme.sh rename to src/acme.sh -- 2.39.2