]> git.proxmox.com Git - pve-lxc-syscalld.git/commitdiff
debian/ import
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 10 Jul 2019 12:43:49 +0000 (14:43 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 10 Jul 2019 13:00:54 +0000 (15:00 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Makefile [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/install [new file with mode: 0644]
debian/rules [new file with mode: 0644]
debian/source/format [new file with mode: 0644]
defines.mk [new file with mode: 0644]
etc/Makefile [new file with mode: 0644]
etc/pve-lxc-syscalld.service.in [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..2146133
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,72 @@
+include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/pkg-info.mk
+
+include defines.mk
+
+GITVERSION:=$(shell git rev-parse HEAD)
+
+SUBDIRS := etc
+
+ifeq ($(BUILD_MODE), release)
+CARGO_BUILD_ARGS += --release
+COMPILEDIR := target/release
+else
+COMPILEDIR := target/debug
+endif
+
+SERVICE_BIN := pve-lxc-syscalld
+
+COMPILED_BINS := \
+       $(addprefix $(COMPILEDIR)/,$(SERVICE_BIN))
+
+DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_HOST_ARCH).deb
+DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
+BUILDSRC := $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
+
+all: cargo-build $(SUBDIRS)
+
+.PHONY: $(SUBDIRS)
+$(SUBDIRS):
+       $(MAKE) -C $@
+
+.PHONY: cargo-build
+cargo-build:
+       cargo build $(CARGO_BUILD_ARGS)
+
+$(COMPILED_BINS): cargo-build
+
+install: $(COMPILED_BINS)
+       install -dm755 $(DESTDIR)$(LIBEXECDIR)/proxmox-backup
+       $(foreach i,$(SERVICE_BIN), \
+           install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/ ;)
+
+# always re-create this dir
+# but also copy the local target/ dir as a build-cache
+.PHONY: $(BUILDSRC)
+$(BUILDSRC):
+       rm -rf $(BUILDSRC)
+       cargo build --release
+       rsync -a debian Makefile defines.mk Cargo.toml Cargo.lock \
+           src $(SUBDIRS) \
+           target \
+           $(BUILDSRC)/
+       $(foreach i,$(SUBDIRS), \
+           $(MAKE) -C $(BUILDSRC)/$(i) clean ;)
+
+.PHONY: deb
+deb: $(DEB)
+$(DEB): $(BUILDSRC)
+       cd $(BUILDSRC); dpkg-buildpackage -b -us -uc --no-pre-clean
+       lintian $(DEB)
+
+.PHONY: dsc
+dsc: $(DSC)
+$(DSC): $(BUILDSRC)
+       cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
+       lintian $(DSC)
+
+clean:
+       $(foreach i,$(SUBDIRS), \
+           $(MAKE) -C $(i) clean ;)
+       cargo clean
+       rm -rf *.deb *.dsc *.tar.gz *.buildinfo *.changes $(BUILDSRC)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..1cd8c85
--- /dev/null
@@ -0,0 +1,5 @@
+pve-lxc-syscalld (0.1-1) pve; urgency=medium
+
+  * initial release
+
+ -- Proxmox Support Team <support@proxmox.com>  Wed, 10 Jul 2019 14:40:16 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..f599e28
--- /dev/null
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..40d794d
--- /dev/null
@@ -0,0 +1,14 @@
+Source: pve-lxc-syscalld
+Section: admin
+Priority: optional
+Maintainer: Proxmox Support Team <support@proxmox.com>
+Build-Depends: debhelper (>= 10),
+Standards-Version: 3.9.5
+Homepage: https://www.proxmox.com
+
+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/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..ae43835
--- /dev/null
@@ -0,0 +1,16 @@
+Copyright (C) 2019 Proxmox Server Solutions GmbH
+
+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/>.
diff --git a/debian/install b/debian/install
new file mode 100644 (file)
index 0000000..6ccfbb4
--- /dev/null
@@ -0,0 +1 @@
+etc/pve-lxc-syscalld.service /lib/systemd/system/
diff --git a/debian/rules b/debian/rules
new file mode 100644 (file)
index 0000000..0920463
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
+
+export BUILD_MODE=release
+
+%:
+       dh $@ --with=systemd
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/defines.mk b/defines.mk
new file mode 100644 (file)
index 0000000..98f1efb
--- /dev/null
@@ -0,0 +1,10 @@
+PACKAGE := pve-lxc-syscalld
+
+PREFIX := /usr
+BINDIR := $(PREFIX)/bin
+SBINDIR := $(PREFIX)/sbin
+LIBDIR := $(PREFIX)/lib
+LIBEXECDIR := $(LIBDIR)
+DATAROOTDIR := $(PREFIX)/share
+MAN1DIR := $(PREFIX)/share/man/man1
+SYSCONFDIR := /etc
diff --git a/etc/Makefile b/etc/Makefile
new file mode 100644 (file)
index 0000000..7238294
--- /dev/null
@@ -0,0 +1,15 @@
+include ../defines.mk
+
+UNITS := pve-lxc-syscalld.service
+
+all: $(UNITS)
+
+clean:
+       rm -f $(UNITS)
+
+.SUFFIXES: .service.in .service
+.service.in.service:
+       sed \
+           -e 's!%LIBEXECDIR%!$(LIBEXECDIR)!g' \
+           $< >$@.tmp
+       mv $@.tmp $@
diff --git a/etc/pve-lxc-syscalld.service.in b/etc/pve-lxc-syscalld.service.in
new file mode 100644 (file)
index 0000000..b1d707a
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Proxmox VE LXC Syscall Daemon
+Before=pve-guests.service
+
+[Service]
+#FIXME!!!
+Type=simple
+ExecStart=%LIBEXECDIR%/pve/pve-lxc-syscalld
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target