separate packaging and source build system

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2023-05-24 16:20:27 +02:00
parent f5e87de606
commit a2242b41fc
213 changed files with 66 additions and 47 deletions

View File

@ -2,72 +2,30 @@ include /usr/share/dpkg/pkg-info.mk
PACKAGE=libpve-storage-perl
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
-include /usr/share/pve-doc-generator/pve-doc-generator.mk
all:
.PHONY: dinstall
dinstall: deb
dpkg -i $(DEB)
pvesm.bash-completion:
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@.tmp
mv $@.tmp $@
pvesm.zsh-completion:
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_zsh_completions();" >$@.tmp
mv $@.tmp $@
.PHONY: install
install: PVE pvesm.1 pvesm.bash-completion pvesm.zsh-completion
install -d $(DESTDIR)$(SBINDIR)
install -m 0755 pvesm $(DESTDIR)$(SBINDIR)
make -C PVE install
make -C udev-rbd install
install -d $(DESTDIR)/usr/share/man/man1
install -m 0644 pvesm.1 $(DESTDIR)/usr/share/man/man1/
gzip -9 -n $(DESTDIR)/usr/share/man/man1/pvesm.1
install -m 0644 -D pvesm.bash-completion $(DESTDIR)$(BASHCOMPLDIR)/pvesm
install -m 0644 -D pvesm.zsh-completion $(DESTDIR)$(ZSHCOMPLDIR)/_pvesm
.PHONY: deb
deb: $(DEB)
$(DEB):
rm -rf build
rsync -a * build
cp -a src build
cp -a debian build/
echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout $(GITVERSION)" >build/debian/SOURCE
cd build; dpkg-buildpackage -b -us -uc
lintian $(DEB)
.PHONY: test
test:
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
make -C test
.PHONY: clean
clean:
rm -f *.xml.tmp *.1 *.5 *.8 *(synopsis,opts).adoc docinfo.xml
rm -rf build *.deb *.buildinfo *.changes
.PHONY: distclean
.PHONY: clean distclean
distclean: clean
clean:
rm -rf build *.deb *.buildinfo *.changes
.PHONY: upload
upload: $(DEB)

23
src/Makefile Normal file
View File

@ -0,0 +1,23 @@
DESTDIR=
PREFIX=/usr
export PERLDIR=$(PREFIX)/share/perl5
all:
.PHONY: install
install: PVE bin udev-rbd
$(MAKE) -C bin install
$(MAKE) -C PVE install
$(MAKE) -C udev-rbd install
.PHONY: test
test:
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
$(MAKE) -C test
.PHONY: clean
clean:
$(MAKE) -C bin clean
$(MAKE) -C PVE clean
$(MAKE) -C udev-rbd clean

View File

@ -8,3 +8,5 @@ install:
make -C Storage install
make -C API2 install
make -C CLI install
clean:

36
src/bin/Makefile Normal file
View File

@ -0,0 +1,36 @@
DESTDIR=
PREFIX=/usr
SBINDIR=$(PREFIX)/sbin
MANDIR=$(PREFIX)/share/man
MAN1DIR=$(MANDIR)/man1/
BASHCOMPLDIR=$(PREFIX)/share/bash-completion/completions/
ZSHCOMPLDIR=$(PREFIX)/share/zsh/vendor-completions/
export PERLDIR=$(PREFIX)/share/perl5
PERL_DOC_INC_DIRS=..
-include /usr/share/pve-doc-generator/pve-doc-generator.mk
all:
pvesm.bash-completion:
perl -I.. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@.tmp
mv $@.tmp $@
pvesm.zsh-completion:
perl -I.. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_zsh_completions();" >$@.tmp
mv $@.tmp $@
.PHONY: install
install: pvesm.1 pvesm.bash-completion pvesm.zsh-completion
install -d $(DESTDIR)$(SBINDIR)
install -m 0755 pvesm $(DESTDIR)$(SBINDIR)
install -d $(DESTDIR)$(MAN1DIR)
install -m 0644 pvesm.1 $(DESTDIR)$(MAN1DIR)
gzip -9 -n $(DESTDIR)$(MAN1DIR)/pvesm.1
install -m 0644 -D pvesm.bash-completion $(DESTDIR)$(BASHCOMPLDIR)/pvesm
install -m 0644 -D pvesm.zsh-completion $(DESTDIR)$(ZSHCOMPLDIR)/_pvesm
.PHONY: clean
clean:
rm -f *.xml.tmp *.1 *.5 *.8 *{synopsis,opts}.adoc docinfo.xml

Some files were not shown because too many files have changed in this diff Show More