[pve-devel] [PATCH ha-manager] Add make dsc target
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Jan 7 14:25:47 CET 2019
On 1/7/19 1:51 PM, Rhonda D'Vine wrote:
> Pull out the build dir creation into its own target, and add the "dsc"
> target. Also get some static information from the packaging.
>
> Signed-off-by: Rhonda D'Vine <rhonda at proxmox.com>
> ---
> Makefile | 31 +++++++++++++++++++++----------
> 1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 89fa8a4..9b2b7c0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,14 +1,16 @@
> -VERSION=2.0
> -PACKAGE=pve-ha-manager
> +VERSION != dpkg-parsechangelog -Sversion | cut -d- -f1
> +PACKAGE != dpkg-parsechangelog -Ssource
> SIMPACKAGE=pve-ha-simulator
> -PKGREL=6
> +PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
1. this has nothing to do with the dsc make-target addition
2. I'd like to keep this as is for now, the mix for hardcoded (simpackage) and
computed looks a bit weird and I do not see a real advantage for simple
versioning schemas as this is (in contrary to, e.g., the pve-edk2-firmware one)
they may even get wrong if the versioning schema (for, e.g., a backport) or
package name changes.
Further, a simple "make" invocation gives me a recursive package build loop,
did you test this?
> dpkg-buildpackage: info: source package pve-ha-manager
> dpkg-buildpackage: info: source version 2.0-6
> dpkg-buildpackage: info: source distribution unstable
> dpkg-buildpackage: info: source changed by Proxmox Support Team <support at proxmox.com>
> dpkg-buildpackage: info: host architecture amd64
> dpkg-source --before-build pve-ha-manager
> debian/rules clean
> make[237]: Entering directory '/root/sources/pve/pve-ha-manager'
> make[237]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> dh clean --with=systemd
> dh_auto_clean
> make -j8 distclean
> make[238]: Entering directory '/root/sources/pve/pve-ha-manager'
> make -C src clean
> make[239]: Entering directory '/root/sources/pve/pve-ha-manager'
> make[239]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make cleanup-docgen
> make[240]: Entering directory '/root/sources/pve/pve-ha-manager/src'
> rm -f *.xml.tmp *.1 *.5 *.8 *.adoc docinfo.xml
> make[240]: Leaving directory '/root/sources/pve/pve-ha-manager/src'
> make -C test clean
> make[240]: Entering directory '/root/sources/pve/pve-ha-manager/src/test'
> rm -rf *~ test-*/log test-*/*~ test-*/status \
> fence_cfgs/*.cfg.commands fence_cfgs/*.write
> make[240]: Leaving directory '/root/sources/pve/pve-ha-manager/src/test'
> rm -rf watchdog-mux *.1.pod *.1.gz *.bash-completion *.tmp
> find . -name '*~' -exec rm {} ';'
> make[239]: Leaving directory '/root/sources/pve/pve-ha-manager/src'
> rm -rf pve-ha-manager-2.0 *.deb pve-ha-manager_*.tar.gz *.changes *.buildinfo *.dsc
> find . -name '*~' -exec rm {} ';'
> make[238]: Leaving directory '/root/sources/pve/pve-ha-manager'
> dh_clean
> make[237]: Leaving directory '/root/sources/pve/pve-ha-manager'
> debian/rules build
> make[237]: Entering directory '/root/sources/pve/pve-ha-manager'
> make[237]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[237]: 'build' is up to date.
> make[237]: Leaving directory '/root/sources/pve/pve-ha-manager'
> debian/rules binary
> make[237]: Entering directory '/root/sources/pve/pve-ha-manager'
> make[237]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> dh binary --with=systemd
> dh_update_autotools_config
> dh_autoreconf
> dh_auto_configure
> dh_auto_build
> make -j8
> make[238]: Entering directory '/root/sources/pve/pve-ha-manager'
> cd pve-ha-manager-2.0; dpkg-buildpackage -b -us -uc
> make[238]: *** No rule to make target 'pve-ha-simulator_2.0-6_all.deb', needed by 'deb'. Stop.
> make[238]: *** Waiting for unfinished jobs....
> /bin/sh: 1: cd: can't cd to pve-ha-manager-2.0
> dpkg-buildpackage: info: source package pve-ha-manager
> dpkg-buildpackage: info: source version 2.0-6
> dpkg-buildpackage: info: source distribution unstable
> dpkg-buildpackage: info: source changed by Proxmox Support Team <support at proxmox.com>
> dpkg-buildpackage: info: host architecture amd64
> dpkg-source --before-build pve-ha-manager
> ... and so forth ...
>
> GITVERSION:=$(shell git rev-parse HEAD)
>
> ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
>
> +BUILDSRC=${PACKAGE}-${VERSION}
> DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
> SIMDEB=${SIMPACKAGE}_${VERSION}-${PKGREL}_all.deb
> +DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
>
>
> all: deb
> @@ -17,22 +19,31 @@ all: deb
> dinstall: $(DEB) $(SIMDEB)
> dpkg -i ${DEB} ${SIMDEB}
>
> +.PHONY: ${BUILDSRC}
> +${BUILDSRC}:
> + rm -rf ${BUILDSRC}
> + mkdir ${BUILDSRC}
> + rsync -a src/ ${BUILDSRC}
> + rsync -a debian/ ${BUILDSRC}/debian
> + echo "git clone git://git.proxmox.com/git/pve-ha-manager.git\\ngit checkout ${GITVERSION}" > ${BUILDSRC}/debian/SOURCE
> +
> +.PHONY: dsc
> +dsc: ${DSC}
> +${DSC}: ${BUILDSRC}
> + cd ${BUILDSRC}; dpkg-buildpackage -S -us -uc -d -nc
> + lintian ${DSC}
> +
> .PHONY: deb
> deb: ${DEB} ${SIMDEB}
> ${DEB}:
> - rm -rf build
> - mkdir build
> - rsync -a src/ build
> - rsync -a debian/ build/debian
> - echo "git clone git://git.proxmox.com/git/pve-ha-manager.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
> - cd build; dpkg-buildpackage -b -us -uc
> + cd ${BUILDSRC}; dpkg-buildpackage -b -us -uc
> lintian ${DEB}
> lintian ${SIMDEB}
>
> .PHONY: clean
> clean:
> make -C src clean
> - rm -rf build *.deb ${PACKAGE}-*.tar.gz *.changes *.buildinfo
> + rm -rf ${BUILDSRC} *.deb ${PACKAGE}_*.tar.gz *.changes *.buildinfo *.dsc
> find . -name '*~' -exec rm {} ';'
>
> .PHONY: distclean
>
More information about the pve-devel
mailing list