diff --git a/srcpkgs/ndhc/INSTALL b/srcpkgs/ndhc/INSTALL new file mode 100644 index 0000000000..6f1722442d --- /dev/null +++ b/srcpkgs/ndhc/INSTALL @@ -0,0 +1,8 @@ +case "$ACTION" in +post) + rm -f /var/lib/ndhc/jail/dev/null /var/lib/ndhc/jail/dev/random + mknod /var/lib/ndhc/jail/dev/null c 1 3 + mknod /var/lib/ndhc/jail/dev/random c 1 9 + ;; +esac + diff --git a/srcpkgs/ndhc/files/ndhc-eth0/log/run b/srcpkgs/ndhc/files/ndhc-eth0/log/run new file mode 100755 index 0000000000..3dd63242fc --- /dev/null +++ b/srcpkgs/ndhc/files/ndhc-eth0/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec logger -t ndhc diff --git a/srcpkgs/ndhc/files/ndhc-eth0/run b/srcpkgs/ndhc/files/ndhc-eth0/run new file mode 100755 index 0000000000..f18d3aeebc --- /dev/null +++ b/srcpkgs/ndhc/files/ndhc-eth0/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec ndhc -i eth0 -R /etc/resolv.conf -u ndhc -U ndhc -D ndhc -C /var/lib/ndhc/jail -s /var/lib/ndhc/state 2>&1 diff --git a/srcpkgs/ndhc/template b/srcpkgs/ndhc/template new file mode 100644 index 0000000000..873b84316e --- /dev/null +++ b/srcpkgs/ndhc/template @@ -0,0 +1,36 @@ +# Template file for 'ndhc' +pkgname=ndhc +version=20150212 +revision=1 +build_style=cmake +make_dirs="/var/lib/ndhc/state 0755 root root + /var/lib/ndhc/jail/dev 0755 root root" +hostmakedepends="cmake git ragel" +makedepends="libcap-devel" +short_desc="Privilege-seperated secure DHCPv4 client" +maintainer="Christian Neukirchen " +license="BSD" +homepage="https://github.com/niklata/ndhc" +#nocross=yes # needs heavy CMakeLists patching + +# XXX we use only one account for privsep, not three, because they +# should have the same primary group. to be verified. +system_accounts="ndhc" +ndhc_homedir="/var/lib/ndhc/jail" + +build_options="static" +if [ "$build_option_static" ]; then + LDFLAGS+=" -static" +fi + +do_fetch() { + git clone git://github.com/niklata/ndhc ${pkgname}-${version} + git clone git://github.com/niklata/ncmlib ${pkgname}-${version}/ncmlib +} + +do_install() { + vbin build/src/ndhc + vman src/ndhc.8 + vsv ndhc-eth0 + vlicense LICENSE +}