From 8cddc92d00e0cb71412ffc4f95292fcfc44f6369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 21 Jul 2022 14:56:54 +0200 Subject: [PATCH] add packaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- Makefile | 69 +++++++++++++++++++++++++ debian/changelog | 5 ++ debian/control | 120 +++++++++++++++++++++++++++++++++++++++++++ debian/copyright | 16 ++++++ debian/debcargo.toml | 10 ++++ 5 files changed, 220 insertions(+) create mode 100644 Makefile create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/debcargo.toml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cb502a6 --- /dev/null +++ b/Makefile @@ -0,0 +1,69 @@ +include /usr/share/dpkg/pkg-info.mk +include /usr/share/dpkg/architecture.mk + +PACKAGE=proxmox-offline-mirror +BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) +BUILDDIR_TMP ?= $(BUILDDIR).tmp + +DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb +LIB_DEB=librust-$(PACKAGE)-dev_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb +DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb +DSC=rust-$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc + +ifeq ($(BUILD_MODE), release) +CARGO_BUILD_ARGS += --release +COMPILEDIR := target/release +else +COMPILEDIR := target/debug +endif + +all: cargo-build $(SUBDIRS) + +.PHONY: cargo-build +cargo-build: + cargo build $(CARGO_BUILD_ARGS) + +.PHONY: build +build: + rm -rf $(BUILDDIR) $(BUILDDIR_TMP); mkdir $(BUILDDIR_TMP) + rm -f debian/control + debcargo package \ + --config debian/debcargo.toml \ + --changelog-ready \ + --no-overlay-write-back \ + --directory $(BUILDDIR_TMP) \ + $(PACKAGE) \ + $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') + cp $(BUILDDIR_TMP)/debian/control debian/control + rm -f $(BUILDDIR_TMP)/Cargo.lock + find $(BUILDDIR_TMP)/debian -name "*.hint" -delete + mv $(BUILDDIR_TMP) $(BUILDDIR) + +.PHONY: deb +deb: $(DEB) +$(DEB): build + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc --no-pre-clean + lintian $(DEB) + +.PHONY: dsc +dsc: $(DSC) +$(DSC): build + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d -nc + lintian $(DSC) + +.PHONY: dinstall +dinstall: $(DEB) + dpkg -i $(DEB) $(DBG_DEB) $(LIB_DEB) + +.PHONY: upload +upload: $(DEB) + tar cf - $(DEB) $(DBG_DEB) $(LIB_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product devel --dist bullseye --arch $(DEB_BUILD_ARCH) + +.PHONY: distclean +distclean: clean + +.PHONY: clean +clean: + cargo clean + rm -rf *.deb *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z $(BUILDDIR) $(BUILDDIR_TMP) + find . -name '*~' -exec rm {} ';' diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..124e9a0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rust-proxmox-offline-mirror (0.1.0-1) stable; urgency=medium + + * initial release + + -- Proxmox Support Team Thu, 21 Jul 2022 14:49:12 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7f2236e --- /dev/null +++ b/debian/control @@ -0,0 +1,120 @@ +Source: rust-proxmox-offline-mirror +Section: rust +Priority: optional +Build-Depends: debhelper (>= 12), + dh-cargo (>= 25), + cargo:native, + rustc:native, + libstd-rust-dev, + librust-anyhow-1+default-dev, + librust-base64-0.13+default-dev, + librust-bzip2-0.4+default-dev, + librust-flate2-1+default-dev (>= 1.0.22-~~), + librust-hex-0.4+default-dev (>= 0.4.3-~~), + librust-hyper-0.14+default-dev, + librust-lazy-static-1+default-dev (>= 1.4-~~), + librust-nix-0.24+default-dev, + librust-openssl-0.10+default-dev, + librust-proxmox-apt-0.9+default-dev, + librust-proxmox-async-0.4+default-dev, + librust-proxmox-http-0.6+client-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+client-trait-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+default-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+proxmox-async-dev (>= 0.6.3-~~), + librust-proxmox-router-1+cli-dev (>= 1.1-~~), + librust-proxmox-router-1+default-dev (>= 1.1-~~), + librust-proxmox-schema-1+api-macro-dev (>= 1.1-~~), + librust-proxmox-schema-1+default-dev (>= 1.1-~~), + librust-proxmox-section-config-1+default-dev, + librust-proxmox-serde-0.1+default-dev, + librust-proxmox-subscription-0.2+api-types-dev, + librust-proxmox-subscription-0.2+default-dev, + librust-proxmox-sys-0.3+default-dev, + librust-proxmox-time-1+default-dev (>= 1.1.3-~~), + librust-regex-1+default-dev (>= 1.5.5-~~), + librust-sequoia-openpgp-1+default-dev (>= 1.7-~~), + librust-serde-1+default-dev, + librust-serde-1+derive-dev, + librust-serde-json-1+default-dev, + librust-ureq-2+default-dev (>= 2.4.0-~~), + librust-ureq-2+native-certs-dev (>= 2.4.0-~~), + librust-walkdir-2+default-dev (>= 2.3.1-~~), + librust-xz2-0.1+default-dev +Maintainer: Proxmox Support Team +Standards-Version: 4.5.1 +Vcs-Git: git://git.proxmox.com/git/proxmox-offline-mirror.git +Vcs-Browser: https://git.proxmox.com/?p=proxmox-offline-mirror.git +Rules-Requires-Root: no + +Package: librust-proxmox-offline-mirror-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-anyhow-1+default-dev, + librust-base64-0.13+default-dev, + librust-bzip2-0.4+default-dev, + librust-flate2-1+default-dev (>= 1.0.22-~~), + librust-hex-0.4+default-dev (>= 0.4.3-~~), + librust-hyper-0.14+default-dev, + librust-lazy-static-1+default-dev (>= 1.4-~~), + librust-nix-0.24+default-dev, + librust-openssl-0.10+default-dev, + librust-proxmox-apt-0.9+default-dev, + librust-proxmox-async-0.4+default-dev, + librust-proxmox-http-0.6+client-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+client-trait-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+default-dev (>= 0.6.3-~~), + librust-proxmox-http-0.6+proxmox-async-dev (>= 0.6.3-~~), + librust-proxmox-router-1+cli-dev (>= 1.1-~~), + librust-proxmox-router-1+default-dev (>= 1.1-~~), + librust-proxmox-schema-1+api-macro-dev (>= 1.1-~~), + librust-proxmox-schema-1+default-dev (>= 1.1-~~), + librust-proxmox-section-config-1+default-dev, + librust-proxmox-serde-0.1+default-dev, + librust-proxmox-subscription-0.2+api-types-dev, + librust-proxmox-subscription-0.2+default-dev, + librust-proxmox-sys-0.3+default-dev, + librust-proxmox-time-1+default-dev (>= 1.1.3-~~), + librust-regex-1+default-dev (>= 1.5.5-~~), + librust-sequoia-openpgp-1+default-dev (>= 1.7-~~), + librust-serde-1+default-dev, + librust-serde-1+derive-dev, + librust-serde-json-1+default-dev, + librust-ureq-2+default-dev (>= 2.4.0-~~), + librust-ureq-2+native-certs-dev (>= 2.4.0-~~), + librust-walkdir-2+default-dev (>= 2.3.1-~~), + librust-xz2-0.1+default-dev +Provides: + librust-proxmox-offline-mirror+default-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0+default-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0.1-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0.1+default-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0.1.0-dev (= ${binary:Version}), + librust-proxmox-offline-mirror-0.1.0+default-dev (= ${binary:Version}) +Description: Proxmox offline repository mirror and subscription key manager - Rust source code + This package contains the source for the Rust proxmox-offline-mirror crate, + packaged by debcargo for use with cargo and dh-cargo. + +Package: proxmox-offline-mirror +Architecture: any +Multi-Arch: allowed +Section: FIXME-(packages."(name)".section) +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + ${cargo:Depends} +Recommends: + ${cargo:Recommends} +Suggests: + ${cargo:Suggests} +Provides: + ${cargo:Provides} +Built-Using: ${cargo:Built-Using} +XB-X-Cargo-Built-Using: ${cargo:X-Cargo-Built-Using} +Description: Proxmox offline repository mirror and subscription key manager + This package contains the following binaries built from the Rust crate + "proxmox-offline-mirror": + - proxmox-apt-repo + - proxmox-offline-mirror diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d2d30fc --- /dev/null +++ b/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/debian/debcargo.toml b/debian/debcargo.toml new file mode 100644 index 0000000..85340e7 --- /dev/null +++ b/debian/debcargo.toml @@ -0,0 +1,10 @@ +overlay = "." +crate_src_path = ".." +maintainer = "Proxmox Support Team " + +[source] +vcs_git = "git://git.proxmox.com/git/proxmox-offline-mirror.git" +vcs_browser = "https://git.proxmox.com/?p=proxmox-offline-mirror.git" + +[packages.bin] +section = "admin"