--- /dev/null
+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)
--- /dev/null
+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
--- /dev/null
+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.
--- /dev/null
+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/>.
--- /dev/null
+etc/pve-lxc-syscalld.service /lib/systemd/system/
--- /dev/null
+#!/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
--- /dev/null
+3.0 (quilt)
--- /dev/null
+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
--- /dev/null
+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 $@
--- /dev/null
+[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