Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/openresolv/dist Import openresolv-3.9.1 with th...
details: https://anonhg.NetBSD.org/src/rev/80e70520e6f6
branches: trunk
changeset: 461924:80e70520e6f6
user: roy <roy%NetBSD.org@localhost>
date: Wed Jul 17 18:24:23 2019 +0000
description:
Import openresolv-3.9.1 with the following changes:
* More strict POSIX shell support
* Interfaces have an implicit metric of 0 unless specified
* Inline comments are stripped from nameserver and domain entries
diffstat:
external/bsd/openresolv/dist/.gitignore | 9 +
external/bsd/openresolv/dist/GNUmakefile | 4 +
external/bsd/openresolv/dist/LICENSE | 23 +++
external/bsd/openresolv/dist/Makefile | 105 +++++++++++++++++
external/bsd/openresolv/dist/README.md | 64 ++++++++++
external/bsd/openresolv/dist/config-null.mk | 1 +
external/bsd/openresolv/dist/configure | 159 ++++++++++++++++++++++++++
external/bsd/openresolv/dist/pdns_recursor.in | 78 ++++++++++++
external/bsd/openresolv/dist/resolvconf.conf | 7 +
9 files changed, 450 insertions(+), 0 deletions(-)
diffs (truncated from 486 to 300 lines):
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/.gitignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/.gitignore Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,9 @@
+resolvconf
+resolvconf.8
+resolvconf.conf.5
+
+dnsmasq
+libc
+named
+pdnsd
+unbound
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/GNUmakefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/GNUmakefile Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,4 @@
+# Nasty hack so that make clean works without configure being run
+CONFIG_MK?=$(shell test -e config.mk && echo config.mk || echo config-null.mk)
+
+include Makefile
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/LICENSE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/LICENSE Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,23 @@
+Copyright (c) 2007-2017 Roy Marples <roy%marples.name@localhost>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/Makefile Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,105 @@
+PKG= openresolv
+
+# Nasty hack so that make clean works without configure being run
+_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk
+CONFIG_MK?= ${_CONFIG_MK}
+include ${CONFIG_MK}
+
+SBINDIR?= /sbin
+SYSCONFDIR?= /etc
+LIBEXECDIR?= /libexec/resolvconf
+VARDIR?= /var/run/resolvconf
+
+INSTALL?= install
+SED?= sed
+
+VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in
+
+BINMODE?= 0755
+DOCMODE?= 0644
+MANMODE?= 0444
+
+RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5
+SUBSCRIBERS= libc dnsmasq named pdnsd unbound
+TARGET= ${RESOLVCONF} ${SUBSCRIBERS}
+SRCS= ${TARGET:C,$,.in,} # pmake
+SRCS:= ${TARGET:=.in} # gmake
+
+SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g'
+SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
+SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
+SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g'
+SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
+SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g'
+SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
+SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g'
+
+DISTPREFIX?= ${PKG}-${VERSION}
+DISTFILEGZ?= ${DISTPREFIX}.tar.gz
+DISTFILE?= ${DISTPREFIX}.tar.xz
+DISTINFO= ${DISTFILE}.distinfo
+DISTINFOSIGN= ${DISTINFO}.asc
+CKSUM?= cksum -a SHA256
+PGP?= netpgp
+
+GITREF?= HEAD
+
+.SUFFIXES: .in
+
+all: ${TARGET}
+
+.in: Makefile ${CONFIG_MK}
+ ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
+ ${SED_VARDIR} \
+ ${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \
+ $< > $@
+
+clean:
+ rm -f ${TARGET}
+
+distclean: clean
+ rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+installdirs:
+
+proginstall: ${TARGET}
+ ${INSTALL} -d ${DESTDIR}${SBINDIR}
+ ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
+ ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+ test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
+ ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
+ ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
+ ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
+
+maninstall:
+ ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
+ ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
+ ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
+ ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
+
+install: proginstall maninstall
+
+import:
+ rm -rf /tmp/${DISTPREFIX}
+ ${INSTALL} -d /tmp/${DISTPREFIX}
+ cp README ${SRCS} /tmp/${DISTPREFIX}
+
+dist-git:
+ git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
+
+dist-inst:
+ mkdir /tmp/${DISTPREFIX}
+ cp -RPp * /tmp/${DISTPREFIX}
+ (cd /tmp/${DISTPREFIX}; make clean)
+ tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX}
+ rm -rf /tmp/${DISTPREFIX}
+
+dist: dist-git
+
+distinfo: dist
+ rm -f ${DISTINFO} ${DISTINFOSIGN}
+ ${CKSUM} ${DISTFILE} >${DISTINFO}
+ #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
+ ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
+ chmod 644 ${DISTINFOSIGN}
+ ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/README.md Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,64 @@
+# openresolv
+
+openresolv is a [resolvconf](https://en.wikipedia.org/wiki/Resolvconf)
+implementation which manages `/etc/resolv.conf`.
+
+`/etc/resolv.conf` is a file that holds the configuration for the local
+resolution of domain names.
+Normally this file is either static or maintained by a local daemon,
+normally a DHCP daemon. But what happens if more than one thing wants to
+control the file?
+Say you have wired and wireless interfaces to different subnets and run a VPN
+or two on top of that, how do you say which one controls the file?
+It's also not as easy as just adding and removing the nameservers each client
+knows about as different clients could add the same nameservers.
+
+Enter resolvconf, the middleman between the network configuration services and
+`/etc/resolv.conf`.
+resolvconf itself is just a script that stores, removes and lists a full
+`resolv.conf` generated for the interface. It then calls all the helper scripts
+it knows about so it can configure the real `/etc/resolv.conf` and optionally
+any local nameservers other than libc.
+
+## Reasons for using openresolv
+
+Why openresolv over the
+[Debian implementation](http://qref.sourceforge.net/Debian/reference/ch-gateway.en.html#s-dns-resolvconf)?
+Here's some reasons:
+ * Works with
+ [POSIX shell and userland](http://www.opengroup.org/onlinepubs/009695399)
+ * Does not need awk, grep or sed which means we can work without `/usr`
+ mounted
+ * Works with other init systems than Debians' out of the box
+ * Available as a 2 clause
+ [BSD license](http://www.freebsd.org/copyright/freebsd-license.html)
+ * Prefer configs via IF_METRIC for dynamic ordering
+ * Configures zones for local resolvers other than libc
+
+The last point is quite important, especially when running VPN systems.
+Take the following resolv.conf files which have been generated by a
+[DHCP client](../dhcpcd) and sent to resolvconf:
+
+```
+# resolv.conf from bge0
+search foo.com
+nameserver 1.2.3.4
+
+# resolv.conf from tap0
+domain bar.org
+nameserver 5.6.7.8
+```
+
+In this instance, queries for foo.com will go to 1.2.3.4 and queries for
+bar.org will go to 5.6.7.8.
+This does require the resolvers to be configured to pickup the resolvconf
+generated configuration for them though.
+openresolv ships with helpers for:
+ * [unbound](http://www.unbound.net/)
+ * [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html)
+ * [ISC BIND](http://www.isc.org/software/bind)
+ * [PowerDNS Recursor](http://wiki.powerdns.com/trac)
+
+See the
+[configuration section](https://roy.marples.name/projects/openresolv/config)
+for more details.
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/config-null.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/config-null.mk Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,1 @@
+# This space left intentionally blank
diff -r f7a2679aa2ed -r 80e70520e6f6 external/bsd/openresolv/dist/configure
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/openresolv/dist/configure Wed Jul 17 18:24:23 2019 +0000
@@ -0,0 +1,159 @@
+#!/bin/sh
+# Try and be like autotools configure, but without autotools
+
+# Ensure that we do not inherit these from env
+OS=
+BUILD=
+HOST=
+TARGET=
+RESTARTCMD=
+RCDIR=
+STATUSARG=
+
+for x do
+ opt=${x%%=*}
+ var=${x#*=}
+ case "$opt" in
+ --os|OS) OS=$var;;
+ --with-cc|CC) CC=$var;;
+ --debug) DEBUG=$var;;
+ --disable-debug) DEBUG=no;;
+ --enable-debug) DEBUG=yes;;
+ --prefix) PREFIX=$var;;
+ --sysconfdir) SYSCONFDIR=$var;;
+ --bindir|--sbindir) SBINDIR=$var;;
+ --libexecdir) LIBEXECDIR=$var;;
+ --statedir|--localstatedir) STATEDIR=$var;;
+ --dbdir) DBDIR=$var;;
+ --rundir) RUNDIR=$var;;
+ --mandir) MANDIR=$var;;
+ --with-ccopts|CFLAGS) CFLAGS=$var;;
+ CPPFLAGS) CPPFLAGS=$var;;
+ --build) BUILD=$var;;
+ --host) HOST=$var;;
+ --target) TARGET=$var;;
+ --libdir) LIBDIR=$var;;
+ --restartcmd) RESTARTCMD=$var;;
+ --rcdir) RCDIR=$var;;
+ --statusarg) STATUSARG=$var;;
+ --includedir) eval INCLUDEDIR="$INCLUDEDIR${INCLUDEDIR:+ }$var";;
+ --datadir|--infodir) ;; # ignore autotools
+ --disable-maintainer-mode|--disable-dependency-tracking) ;;
+ --help) echo "See the README file for available options"; exit 0;;
+ *) echo "$0: WARNING: unknown option $opt" >&2;;
+ esac
+done
+
+if [ -z "$LIBEXECDIR" ]; then
+ printf "Checking for directory /libexec ... "
+ if [ -d /libexec ]; then
+ echo "yes"
+ LIBEXECDIR=$PREFIX/libexec/resolvconf
+ else
+ echo "no"
+ LIBEXECDIR=$PREFIX/lib/resolvconf
+ fi
+fi
+if [ -z "$RUNDIR" ]; then
+ printf "Checking for directory /run ... "
+ if [ -d /run ]; then
+ echo "yes"
+ RUNDIR=/run
+ else
+ echo "no"
+ RUNDIR=/var/run
+ fi
+fi
Home |
Main Index |
Thread Index |
Old Index