diff --git a/Makefile b/Makefile index 4d5336b2..eff11846 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,11 @@ all: ifeq ($(BUILD_TARGET), pve) $(MAKE) pve else ifeq ($(BUILD_TARGET), pmg) - $(MAKE) pve + $(MAKE) pmg else - @echo "Run 'make pve' or 'make pmg'" + @echo "Run one of" + @echo " - make pve" + @echo " - make pmg" endif .PHONY: pve pmg @@ -56,7 +58,7 @@ build: mkdir build echo system >build/rust-toolchain cp -a ./scripts ./build - cp -a ./common-src ./build + cp -a ./common ./build cp -a ./pve-rs ./build cp -a ./pmg-rs ./build cp -a ./Proxmox ./build @@ -67,6 +69,9 @@ build: mv ./build/Proxmox/Lib/PMG.pm ./build/pmg-rs/Proxmox/Lib/PMG.pm mv ./build/PVE ./build/pve-rs mv ./build/PMG ./build/pmg-rs + mv ./build/Proxmox ./build/common/pkg +# So the common packages end up in ./build, rather than ./build/common + mv ./build/common/pkg ./build/common-pkg pve-deb: build cd ./build/pve-rs && dpkg-buildpackage -b -uc -us @@ -76,6 +81,10 @@ pmg-deb: build cd ./build/pmg-rs && dpkg-buildpackage -b -uc -us touch $@ +common-deb: build + cd ./build/common-pkg && dpkg-buildpackage -b -uc -us + touch $@ + %-upload: %-deb cd build; \ dcmd --deb lib$*-rs-perl*.changes \ diff --git a/common/pkg/Makefile b/common/pkg/Makefile new file mode 100644 index 00000000..d5a737cd --- /dev/null +++ b/common/pkg/Makefile @@ -0,0 +1,40 @@ +include /usr/share/dpkg/default.mk + +PACKAGE=libproxmox-rs-perl + +ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) +export GITVERSION:=$(shell git rev-parse HEAD) + +PERL_INSTALLVENDORARCH != perl -MConfig -e 'print $$Config{installvendorarch};' +PERL_INSTALLVENDORLIB != perl -MConfig -e 'print $$Config{installvendorlib};' + +DEB=${PACKAGE}_${DEB_VERSION}_${ARCH}.deb + +DESTDIR= + +PM_DIRS := \ + Proxmox/Lib \ + Proxmox/RS + +PM_FILES := \ + Proxmox/Lib/Common.pm \ + Proxmox/RS/CalendarEvent.pm + +all: + true + +.PHONY: install +install: + install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB) + for i in $(PM_DIRS); do \ + install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)/$$i; \ + done + for i in $(PM_FILES); do \ + install -m644 $$i $(DESTDIR)$(PERL_INSTALLVENDORLIB)/$$i; \ + done + +.PHONY: deb +deb: $(DEB) +$(DEB): build + cd build; dpkg-buildpackage -b -us -uc --no-pre-clean + lintian $(DEBS) diff --git a/common/pkg/debian/changelog b/common/pkg/debian/changelog new file mode 100644 index 00000000..0ed05be4 --- /dev/null +++ b/common/pkg/debian/changelog @@ -0,0 +1,6 @@ +libproxmox-rs-perl (0.1.0) bullseye; urgency=medium + + * initial release + + -- Proxmox Support Team Tue, 01 Mar 2022 09:58:17 +0100 + diff --git a/common/pkg/debian/compat b/common/pkg/debian/compat new file mode 100644 index 00000000..48082f72 --- /dev/null +++ b/common/pkg/debian/compat @@ -0,0 +1 @@ +12 diff --git a/common/pkg/debian/control b/common/pkg/debian/control new file mode 100644 index 00000000..cdda8c54 --- /dev/null +++ b/common/pkg/debian/control @@ -0,0 +1,22 @@ +Source: libproxmox-rs-perl +Section: perl +Priority: optional +Build-Depends: + debhelper (>= 12), +Maintainer: Proxmox Support Team +Standards-Version: 4.5.1 +Vcs-Git: git://git.proxmox.com/git/proxmox-perl-rs.git +Vcs-Browser: https://git.proxmox.com/?p=proxmox-perl-rs.git +Homepage: https://www.proxmox.com +Rules-Requires-Root: no + +Package: libproxmox-rs-perl +Architecture: any +Depends: + ${misc:Depends}, + ${perl:Depends}, + ${shlibs:Depends}, + libpve-rs-perl (>= 0.6.0) | libpmg-rs-perl (>= 0.5.0), +Description: PVE/PMG common parts which have been ported to Rust - Perl packages + Contains the perl side of modules provided by the libraries of both libpve-rs-perl and + libpmg-rs-perl, loading whichever is available. diff --git a/common/pkg/debian/copyright b/common/pkg/debian/copyright new file mode 100644 index 00000000..d2d30fc7 --- /dev/null +++ b/common/pkg/debian/copyright @@ -0,0 +1,16 @@ +Copyright (C) 2022 Proxmox Server Solutions GmbH + +This software is written by Proxmox Server Solutions GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . diff --git a/common/pkg/debian/rules b/common/pkg/debian/rules new file mode 100755 index 00000000..0f5be05b --- /dev/null +++ b/common/pkg/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 +export BUILD_MODE=release + +%: + dh $@ diff --git a/common/pkg/debian/source/format b/common/pkg/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/common/pkg/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/common/pkg/debian/triggers b/common/pkg/debian/triggers new file mode 100644 index 00000000..59dd6885 --- /dev/null +++ b/common/pkg/debian/triggers @@ -0,0 +1 @@ +activate-noawait pve-api-updates diff --git a/pmg-rs/debian/copyright b/pmg-rs/debian/copyright index 477c3058..d29cc729 100644 --- a/pmg-rs/debian/copyright +++ b/pmg-rs/debian/copyright @@ -1,4 +1,4 @@ -Copyright (C) 2020-2021 Proxmox Server Solutions GmbH +Copyright (C) 2020-2022 Proxmox Server Solutions GmbH This software is written by Proxmox Server Solutions GmbH diff --git a/pve-rs/debian/copyright b/pve-rs/debian/copyright index 5661ef60..f2f82029 100644 --- a/pve-rs/debian/copyright +++ b/pve-rs/debian/copyright @@ -1,4 +1,4 @@ -Copyright (C) 2021 Proxmox Server Solutions GmbH +Copyright (C) 2021-2022 Proxmox Server Solutions GmbH This software is written by Proxmox Server Solutions GmbH