From 1b02346293dbd21fe647ade9db92d0d47fb10d8d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 19 May 2023 16:21:48 +0200 Subject: [PATCH] separate packaging and source build system Signed-off-by: Thomas Lamprecht --- Makefile | 17 +++++------------ debian/install | 2 -- src/Makefile | 17 +++++++++++++++++ {PVE => src/PVE}/APIClient/Exception.pm | 0 {PVE => src/PVE}/APIClient/LWP.pm | 0 {examples => src/examples}/example1.pl | 0 {examples => src/examples}/example2.pl | 0 {examples => src/examples}/example3.pl | 0 {examples => src/examples}/example4.pl | 0 {examples => src/examples}/perftest1.pl | 0 10 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 debian/install create mode 100644 src/Makefile rename {PVE => src/PVE}/APIClient/Exception.pm (100%) rename {PVE => src/PVE}/APIClient/LWP.pm (100%) rename {examples => src/examples}/example1.pl (100%) rename {examples => src/examples}/example2.pl (100%) rename {examples => src/examples}/example3.pl (100%) rename {examples => src/examples}/example4.pl (100%) rename {examples => src/examples}/perftest1.pl (100%) diff --git a/Makefile b/Makefile index cb2c243..11e1c6b 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,11 @@ all: $(DEB) .PHONY: $(BUILDSRC) $(BUILDSRC): - rm -rf $(BUILDSRC) - rsync -a debian $(BUILDSRC) - make DESTDIR=./$(BUILDSRC) install - echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE + rm -rf $@ $@.tmp + cp -a src $@.tmp + cp -a debian $@.tmp/ + echo "git clone git://git.proxmox.com/git/pve-apiclient.git\\ngit checkout $(GITVERSION)" >$@.tmp/debian/SOURCE + mv $@.tmp $@ .PHONY: deb deb $(DEB): $(BUILDSRC) @@ -31,14 +32,6 @@ dsc: $(BUILDSRC) cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc lintian $(DSC) -install: PVE/APIClient/Exception.pm PVE/APIClient/LWP.pm examples/*.pl - install -D -m 0644 PVE/APIClient/LWP.pm $(PERL5DIR)/PVE/APIClient/LWP.pm - install -m 0644 PVE/APIClient/Exception.pm $(PERL5DIR)/PVE/APIClient/Exception.pm - install -d -m 755 $(DOCDIR)/examples - install -m 0755 examples/example1.pl $(DOCDIR)/examples - install -m 0755 examples/example2.pl $(DOCDIR)/examples - install -m 0755 examples/perftest1.pl $(DOCDIR)/examples - .PHONY: upload upload: $(DEB) tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pmg,pve --dist bullseye diff --git a/debian/install b/debian/install deleted file mode 100644 index aab4f0a..0000000 --- a/debian/install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/share/perl5 -/usr/share/doc/libpve-apiclient-perl \ No newline at end of file diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..bc19e9f --- /dev/null +++ b/src/Makefile @@ -0,0 +1,17 @@ +PACKAGE ?= libpve-apiclient-perl + +DESTDIR= +PERL5DIR=$(DESTDIR)/usr/share/perl5 +DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE) + +all: + +install: PVE/APIClient/Exception.pm PVE/APIClient/LWP.pm examples/*.pl + install -D -m 0644 PVE/APIClient/LWP.pm $(PERL5DIR)/PVE/APIClient/LWP.pm + install -m 0644 PVE/APIClient/Exception.pm $(PERL5DIR)/PVE/APIClient/Exception.pm + install -d -m 755 $(DOCDIR)/examples + install -m 0755 examples/example1.pl $(DOCDIR)/examples + install -m 0755 examples/example2.pl $(DOCDIR)/examples + install -m 0755 examples/perftest1.pl $(DOCDIR)/examples + +clean: diff --git a/PVE/APIClient/Exception.pm b/src/PVE/APIClient/Exception.pm similarity index 100% rename from PVE/APIClient/Exception.pm rename to src/PVE/APIClient/Exception.pm diff --git a/PVE/APIClient/LWP.pm b/src/PVE/APIClient/LWP.pm similarity index 100% rename from PVE/APIClient/LWP.pm rename to src/PVE/APIClient/LWP.pm diff --git a/examples/example1.pl b/src/examples/example1.pl similarity index 100% rename from examples/example1.pl rename to src/examples/example1.pl diff --git a/examples/example2.pl b/src/examples/example2.pl similarity index 100% rename from examples/example2.pl rename to src/examples/example2.pl diff --git a/examples/example3.pl b/src/examples/example3.pl similarity index 100% rename from examples/example3.pl rename to src/examples/example3.pl diff --git a/examples/example4.pl b/src/examples/example4.pl similarity index 100% rename from examples/example4.pl rename to src/examples/example4.pl diff --git a/examples/perftest1.pl b/src/examples/perftest1.pl similarity index 100% rename from examples/perftest1.pl rename to src/examples/perftest1.pl -- 2.39.2