5
0
mirror of git://git.proxmox.com/git/pve-access-control.git synced 2025-01-22 22:03:46 +03:00

buildsys: split packaging and source build-systems

Much nicer to handle and work with than entangling all together in a
single spaghetti pile.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-09 19:37:47 +02:00
parent 08eb54c9dc
commit 197d1016fd
44 changed files with 60 additions and 51 deletions

View File

@ -3,29 +3,12 @@ include /usr/share/dpkg/architecture.mk
PACKAGE=libpve-access-control
BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
DESTDIR=
PREFIX=/usr
BINDIR=${PREFIX}/bin
SBINDIR=${PREFIX}/sbin
MANDIR=${PREFIX}/share/man
DOCDIR=${PREFIX}/share/doc/${PACKAGE}
MAN1DIR=${MANDIR}/man1/
BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
export PERLDIR=${PREFIX}/share/perl5
GITVERSION:=$(shell git rev-parse HEAD)
DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
# this requires package pve-doc-generator
export NOVIEW=1
include /usr/share/pve-doc-generator/pve-doc-generator.mk
BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
GITVERSION:=$(shell git rev-parse HEAD)
all:
@ -33,36 +16,10 @@ all:
dinstall: deb
dpkg -i ${DEB}
pveum.bash-completion: PVE/CLI/pveum.pm
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
mv $@.tmp $@
pveum.zsh-completion: PVE/CLI/pveum.pm
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_zsh_completions();" >$@.tmp
mv $@.tmp $@
.PHONY: install
install: pveum.1 oathkeygen pveum.bash-completion pveum.zsh-completion
install -d ${DESTDIR}${BINDIR}
install -d ${DESTDIR}${SBINDIR}
install -m 0755 pveum ${DESTDIR}${SBINDIR}
install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
make -C PVE install
install -d ${DESTDIR}/${MAN1DIR}
install -d ${DESTDIR}/${DOCDIR}
install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
install -m 0644 -D pveum.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pveum
.PHONY: test
test:
perl -I. ./pveum verifyapi
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
make -C test check
${BUILDDIR}:
rm -rf ${BUILDDIR}
rsync -a * ${BUILDDIR}
cp -a src ${BUILDDIR}
cp -a debian ${BUILDDIR}/
echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
.PHONY: deb
@ -83,9 +40,7 @@ upload: ${DEB}
.PHONY: clean
clean:
rm -rf ${BUILDDIR}
make cleanup-docgen
rm -rf *.deb *.buildinfo *.changes ${PACKAGE}*.tar.gz *.dsc
rm -rf ${BUILDDIR} *.deb *.buildinfo *.changes ${PACKAGE}*.tar.gz *.dsc
find . -name '*~' -exec rm {} ';'
.PHONY: distclean

54
src/Makefile Normal file
View File

@ -0,0 +1,54 @@
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
PACKAGE=libpve-access-control
BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
DESTDIR=
PREFIX=/usr
BINDIR=${PREFIX}/bin
SBINDIR=${PREFIX}/sbin
MANDIR=${PREFIX}/share/man
DOCDIR=${PREFIX}/share/doc/${PACKAGE}
MAN1DIR=${MANDIR}/man1/
BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
export PERLDIR=${PREFIX}/share/perl5
-include /usr/share/pve-doc-generator/pve-doc-generator.mk
all:
pveum.bash-completion: PVE/CLI/pveum.pm
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
mv $@.tmp $@
pveum.zsh-completion: PVE/CLI/pveum.pm
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_zsh_completions();" >$@.tmp
mv $@.tmp $@
.PHONY: install
install: pveum.1 oathkeygen pveum.bash-completion pveum.zsh-completion
install -d ${DESTDIR}${BINDIR}
install -d ${DESTDIR}${SBINDIR}
install -m 0755 pveum ${DESTDIR}${SBINDIR}
install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
make -C PVE install
install -d ${DESTDIR}/${MAN1DIR}
install -d ${DESTDIR}/${DOCDIR}
install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
install -m 0644 -D pveum.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pveum
.PHONY: test
test:
perl -I. ./pveum verifyapi
perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
make -C test check
.PHONY: clean distclean
distclean: clean
clean:
make cleanup-docgen
find . -name '*~' -exec rm {} ';'

View File