From b6f9e3424beb1f2996002bf6e70585e168b5bb73 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Wed, 2 Jun 2021 16:49:54 +0000 Subject: [PATCH] buildsys: reorganize Makefile * build in versioned subdirectory * add 'deb' make target * drop fakeroot from dpkg-buildpackage invocation Signed-off-by: Stoiko Ivanov --- Makefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 75ac71c..ca52529 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,28 @@ include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/architecture.mk -PACKAHE=libxdgmime +PACKAGE=libxdgmime DEB = libxdgmime-perl_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb +BUILDSRC=${PACKAGE}-${DEB_VERSION_UPSTREAM} OPKGNAME=Xdgmime UPSTREAM=xdgmime-source/src -${DEB}: ${OPKGNAME}/Xdgmime.xs - -rm -rf build - cp -a ${OPKGNAME} build - cp -a ${UPSTREAM}/xdgmime*.[ch] build/ - perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("build/ppport.h");' - cp -a debian build - cd build; dpkg-buildpackage -b -us -uc -rfakeroot +all: ${DEB} + +.PHONY: ${BUILDSRC} +${BUILDSRC}: + -rm -rf ${BUILDSRC} + cp -a ${OPKGNAME} ${BUILDSRC} + cp -a ${UPSTREAM}/xdgmime*.[ch] ${BUILDSRC}/ + perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("${BUILDSRC}/ppport.h");' + cp -a debian ${BUILDSRC} + +.PHONY: deb +deb: ${DEB} +${DEB}: ${OPKGNAME}/Xdgmime.xs ${BUILDSRC} + cd ${BUILDSRC}; dpkg-buildpackage -b -us -uc lintian ${DEB} .PHONY: upload @@ -22,7 +30,7 @@ upload: ${DEB} tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch -CLEANFILES = *~ debian/*~ *.deb build libxdgmime-perl_* +CLEANFILES = *~ debian/*~ *.deb ${BUILDSRC} libxdgmime-perl_* .PHONY: clean clean: