]> git.proxmox.com Git - pve-lxc-syscalld.git/commitdiff
buildsys: cleanup, derive upload dist, drop debcargo usage
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 May 2023 12:10:06 +0000 (14:10 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 24 May 2023 12:10:42 +0000 (14:10 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Makefile
debian/compat [deleted file]
debian/control [new file with mode: 0644]
debian/control.in [deleted file]
debian/copyright
debian/debcargo.toml [deleted file]
debian/rules
debian/source/format
rustfmt.toml [deleted file]

index c50e5afb57f9314a570a669540b333cc135f5aa9..548c863d5e3985886f19c3d596cf7cf9db257edb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,9 @@ COMPILED_BINS := \
        $(addprefix $(COMPILEDIR)/,$(SERVICE_BIN))
 
 DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
-DSC=rust-$(PACKAGE)_$(DEB_VERSION).dsc
+DSC=$(PACKAGE)_$(DEB_VERSION).dsc
+
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 
 all: cargo-build $(SUBDIRS)
 
@@ -39,12 +41,6 @@ test:
 .PHONY: check
 check: test
 
-.PHONY: san
-san:
-       cargo +nightly fmt -- --check
-       cargo clippy
-       cargo test
-
 $(COMPILED_BINS): cargo-build
 
 install: $(COMPILED_BINS)
@@ -52,43 +48,38 @@ install: $(COMPILED_BINS)
        $(foreach i,$(SERVICE_BIN), \
            install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/pve-lxc-syscalld/ ;)
 
-.PHONY: build
-build:
-       rm -rf build
-       debcargo package \
-         --config debian/debcargo.toml \
-         --changelog-ready \
-         --no-overlay-write-back \
-         --directory build \
-         pve-lxc-syscalld \
-         $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//')
-       sed -e '1,/^$$/ ! d' build/debian/control > build/debian/control.src
-       cat build/debian/control.src build/debian/control.in > build/debian/control
-       rm build/debian/control.in build/debian/control.src
-       rm build/Cargo.lock
-       find build/debian -name "*.hint" -delete
-       echo system >build/rust-toolchain
-       $(foreach i,$(SUBDIRS), \
-           $(MAKE) -C build/$(i) clean ;)
+$(BUILDDIR): src debian etc Cargo.toml
+       rm -rf $(BUILDDIR) $(BUILDDIR).tmp
+       mkdir $(BUILDDIR).tmp
+       #mkdir $(BUILDDIR).tmp/.cargo
+       cp -a -t $(BUILDDIR).tmp $^ Makefile defines.mk
+       #cp -a -t $(BUILDDIR).tmp/.cargo .cargo/config
+       echo "git clone git://git.proxmox.com/git/pve-lxc-syscalld.git\\ngit checkout $(shell git rev-parse HEAD)" > $(BUILDDIR).tmp/debian/SOURCE
+       mv $(BUILDDIR).tmp $(BUILDDIR)
 
 .PHONY: deb
 deb: $(DEB)
-$(DEB): build
-       cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEB)
 
-upload: deb
-       dcmd --deb rust-pve-lxc-syscalld_*.changes \
-           | grep -v '.changes$$' \
-           | tar -cf- -T- \
-           | ssh -X repoman@repo.proxmox.com upload --product pve --dist bullseye
-
 .PHONY: dsc
 dsc: $(DSC)
-$(DSC): build
-       cd build; dpkg-buildpackage -S -us -uc -d -nc
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
        lintian $(DSC)
 
+sbuild: $(DSC)
+       sbuild $(DSC)
+
+.PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+       dcmd --deb pve-lxc-syscalld_*.changes \
+           | grep -v '.changes$$' \
+           | tar -cf- -T- \
+           | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
+
 .PHONY: dinstall
 dinstall:
        $(MAKE) deb
@@ -97,5 +88,6 @@ dinstall:
 clean:
        $(foreach i,$(SUBDIRS), \
            $(MAKE) -C $(i) clean ;)
-       cargo clean
-       rm -rf *.deb *.dsc *.tar.gz *.buildinfo *.changes build
+       rm -rf ./target
+       rm -rf ./$(BUILDDIR)
+       rm -f -- *.deb *.dsc *.tar.?z *.buildinfo *.build *.changes
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 48082f7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-12
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..7d96a58
--- /dev/null
@@ -0,0 +1,33 @@
+Source: pve-lxc-syscalld
+Section: admin
+Priority: optional
+Build-Depends: debhelper-compat (= 13),
+ bash-completion,
+ libsystemd-dev,
+ dh-cargo (>= 25),
+ cargo:native,
+ rustc:native,
+ libstd-rust-dev,
+ librust-anyhow-1+default-dev,
+ librust-bitflags-1+default-dev (>= 1.2-~~),
+ librust-lazy-static-1+default-dev (>= 1.4-~~),
+ librust-libc-0.2+default-dev,
+ librust-nix-0.26+default-dev,
+ librust-num-cpus-1+default-dev,
+ librust-tokio-1+default-dev,
+ librust-tokio-1+io-util-dev,
+ librust-tokio-1+net-dev,
+ librust-tokio-1+rt-multi-thread-dev,
+Maintainer: Proxmox Support Team <support@proxmox.com>
+Standards-Version: 4.6.1
+Vcs-Git: git://git.proxmox.com/git/pve-lxc-syscalld.git
+Vcs-Browser: https://git.proxmox.com/?p=pve-lxc-syscalld.git;a=summary
+Homepage: https://www.proxmox.com
+Rules-Requires-Root: no
+
+Package: pve-lxc-syscalld
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+Description: PVE LXC syscall daemon
+ A daemon which handles a selected subset of syscalls for unprivileged
+ containers.
diff --git a/debian/control.in b/debian/control.in
deleted file mode 100644 (file)
index ee98092..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Package: pve-lxc-syscalld
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends},
-Description: PVE LXC syscall daemon
- A daemon which handles a selected subset of syscalls for unprivileged
- containers.
index 2c91d38c8de14371fc2fef6bea5fc9d789886508..0d9eab3e3678ec5f3f8657773595660aa3c68f67 100644 (file)
@@ -1,16 +1,18 @@
-Copyright (C) 2019,2020 Proxmox Server Solutions GmbH
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
-This software is written by Proxmox Server Solutions GmbH <support@proxmox.com>
-
-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 <http://www.gnu.org/licenses/>.
+Files:
+ *
+Copyright: 2019 - 2023 Proxmox Server Solutions GmbH <support@proxmox.com>
+License: AGPL-3.0-or-later
+ 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 <https://www.gnu.org/licenses/>.
diff --git a/debian/debcargo.toml b/debian/debcargo.toml
deleted file mode 100644 (file)
index 7bf0eec..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-overlay = "."
-crate_src_path = ".."
-maintainer = "Proxmox Support Team <support@proxmox.com>"
-
-[source]
-section = "admin"
-build_depends = [ "debhelper (>= 12~)", "bash-completion", "libsystemd-dev" ]
-build_depends_excludes = [ "debhelper (>=11)" ]
-# TODO:
-vcs_git = ""
-vcs_browser = ""
index 9f608f50aa30dca2cb7e448ea6e0f188879ef903..d1215aa21d2bd76fe4b3d927dbb32abe1da8f76f 100755 (executable)
@@ -21,6 +21,8 @@ export DEB_CARGO_PACKAGE=pve-lxc-syscalld
        dh $@
 
 override_dh_auto_configure:
+       @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \
+           die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml
        $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system
        dh_auto_configure
 
index 163aaf8d82b6c54f23c45f32895dbdfdcc27b047..89ae9db8f88b823b6a7eabf55e203658739da122 100644 (file)
@@ -1 +1 @@
-3.0 (quilt)
+3.0 (native)
diff --git a/rustfmt.toml b/rustfmt.toml
deleted file mode 100644 (file)
index 32a9786..0000000
+++ /dev/null
@@ -1 +0,0 @@
-edition = "2018"