]> git.proxmox.com Git - proxmox-acme.git/commitdiff
buildsys: move submodule to src, cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 3 May 2020 15:00:46 +0000 (17:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 3 May 2020 15:00:49 +0000 (17:00 +0200)
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 <t.lamprecht@proxmox.com>
.gitmodules
Makefile
acme.sh [deleted submodule]
src/Makefile
src/acme.sh [new submodule]

index 9e2f450e3c9aeedbb0555d6abcd235636ff60db3..0ffb40892101cb40d2ab267f2380e3b9a0e186af 100644 (file)
@@ -1,3 +1,3 @@
 [submodule "acme.sh"]
 [submodule "acme.sh"]
-       path = acme.sh
+       path = src/acme.sh
        url = https://github.com/acmesh-official/acme.sh.git
        url = https://github.com/acmesh-official/acme.sh.git
index 9d2655a5e2c3793acf07ca17b94048d4931b860c..1d487cbb20b1c4d6bce2025d0e8f442b65e3a9f6 100644 (file)
--- 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
 
 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:
 
 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
 
 .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}
 
 .PHONY: dsc
 dsc: ${DSC}
@@ -35,12 +35,12 @@ ${DSC}: ${BUILDDIR}
        cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
        lintian ${DSC}
 
        cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
        lintian ${DSC}
 
-dinstall: $(DEB)
-       dpkg -i $(DEB)
+dinstall: ${DEB}
+       dpkg -i ${DEB}
 
 .PHONY: clean
 clean:
 
 .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}
 
 .PHONY: upload
 upload: ${DEB}
diff --git a/acme.sh b/acme.sh
deleted file mode 160000 (submodule)
index d437d6f..0000000
--- a/acme.sh
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit d437d6fde95dc7368d4fa76c05648a8dd4cbe69e
index 272514309d79112dcf3b4af3f8c538f19be81327..9bf2e7041895a7f59ebaf033cf1edd86e0a21929 100644 (file)
@@ -114,7 +114,7 @@ all:
 .PHONY: install
 install:
        install -D -m 0744 proxmox-acme ${DESTDIR}${ACMEDIR}/proxmox-acme
 .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
        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/src/acme.sh b/src/acme.sh
new file mode 160000 (submodule)
index 0000000..d437d6f
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d437d6fde95dc7368d4fa76c05648a8dd4cbe69e