buildsys: reorganize Makefile

* build in versioned subdirectory
* add 'deb' make target
* drop fakeroot from dpkg-buildpackage invocation

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2021-06-02 16:49:54 +00:00
parent 7488acc5a2
commit b6f9e3424b

View File

@ -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: