]> git.proxmox.com Git - libxdgmime-perl.git/commitdiff
buildsys: reorganize Makefile
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 2 Jun 2021 16:49:54 +0000 (16:49 +0000)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 7 Jun 2021 17:02:03 +0000 (17:02 +0000)
* build in versioned subdirectory
* add 'deb' make target
* drop fakeroot from dpkg-buildpackage invocation

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Makefile

index 75ac71cc59cfe53106a44c226c59fa7d38b30331..ca5252957eb1dc8bb3cc95a288d175b00d65c28f 100644 (file)
--- 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: