Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/nsd Add nsd build glue



details:   https://anonhg.NetBSD.org/src/rev/cae107f2d6ae
branches:  trunk
changeset: 820351:cae107f2d6ae
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 07 19:51:21 2017 +0000

description:
Add nsd build glue

diffstat:

 external/bsd/nsd/Makefile                        |    5 +
 external/bsd/nsd/Makefile.inc                    |   31 +
 external/bsd/nsd/etc/Makefile                    |   13 +
 external/bsd/nsd/etc/rc.d/Makefile               |    6 +
 external/bsd/nsd/etc/rc.d/nsd                    |   75 ++
 external/bsd/nsd/include/config.h                |  839 +++++++++++++++++++++++
 external/bsd/nsd/lib/Makefile                    |    5 +
 external/bsd/nsd/lib/Makefile.inc                |    1 +
 external/bsd/nsd/lib/libnsd/Makefile             |   49 +
 external/bsd/nsd/lib/libxfrd/Makefile            |   16 +
 external/bsd/nsd/sbin/Makefile                   |   12 +
 external/bsd/nsd/sbin/Makefile.inc               |   25 +
 external/bsd/nsd/sbin/nsd-checkconf/Makefile     |    5 +
 external/bsd/nsd/sbin/nsd-checkzone/Makefile     |   18 +
 external/bsd/nsd/sbin/nsd-control-setup/Makefile |    5 +
 external/bsd/nsd/sbin/nsd-control/Makefile       |    5 +
 external/bsd/nsd/sbin/nsd/Makefile               |   21 +
 17 files changed, 1131 insertions(+), 0 deletions(-)

diffs (truncated from 1199 to 300 lines):

diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/Makefile Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,5 @@
+#      $NetBSD: Makefile,v 1.1 2017/01/07 19:51:21 christos Exp $
+
+SUBDIR+= lib .WAIT sbin etc
+
+.include <bsd.subdir.mk>
diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/Makefile.inc     Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile.inc,v 1.1 2017/01/07 19:51:21 christos Exp $
+
+USE_FORT?= yes  # network client/server
+
+NSD:=${.PARSEDIR}/dist
+
+CPPFLAGS+=-D_OPENBSD_SOURCE
+CPPFLAGS+=-I${NSD} -I${NSD}/../include
+.PATH: ${NSD}
+
+DPLIBS+= event ${NETBSDSRCDIR}/external/bsd/libevent/lib/libevent
+DPLIBS+= ssl ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libssl
+DPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto
+DPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt
+DPLIBS+= util ${NETBSDSRCDIR}/lib/libutil
+DPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
+
+__subst: .USE
+       ${TOOL_SED} \
+           -e s,@nsdconfigfile@,/etc/nsd/nsd.conf, \
+           -e s,@configdir@,/etc/nsd, \
+           -e s,@dbfile@,/var/db/nsd/nsd.db, \
+           -e s,@pidfile@,/var/run/nsd.pid, \
+           -e s,@zonelistfile@,/var/db/nsd/zone.list, \
+           -e s,@zonesdir@,/etc/namedb, \
+           -e s,@user@,_nsd, \
+           -e s,@logfile@,/var/log/nsd.log, \
+           -e s,@xfrdfile@,/var/db/nsd/xfdr.state, \
+           -e s,@xfrddir@,/var/tmp, \
+           -e s,@chrootdir@,/var/chroot/nsd, \
+           -e s,@ratelimit_default@,0, < ${.ALLSRC} > ${.TARGET}
diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/etc/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/etc/Makefile     Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,13 @@
+#      $NetBSD: Makefile,v 1.1 2017/01/07 19:51:21 christos Exp $
+
+SUBDIR=rc.d
+
+FILESDIR=               /etc/nsd
+FILESMODE=    644
+FILES= nsd.conf
+
+nsd.conf: nsd.conf.sample.in __subst
+CLEANFILES+= nsd.conf
+
+.include <bsd.files.mk>
+.include <bsd.subdir.mk>
diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/etc/rc.d/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/etc/rc.d/Makefile        Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,6 @@
+#      $NetBSD: Makefile,v 1.1 2017/01/07 19:51:21 christos Exp $
+
+SCRIPTS=nsd
+SCRIPTSDIR=/etc/rc.d
+
+.include <bsd.prog.mk>
diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/etc/rc.d/nsd
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/etc/rc.d/nsd     Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# $NetBSD: nsd,v 1.1 2017/01/07 19:51:21 christos Exp $
+#
+
+# PROVIDE: named
+# REQUIRE: NETWORKING mountcritremote syslogd
+# BEFORE:  DAEMON
+# KEYWORD: chrootdir
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="nsd"
+rcvar=$name
+command="/usr/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+required_files="/etc/${name}/${name}.conf"
+start_precmd="nsd_precmd"
+
+nsd_migrate()
+{
+       local src="$1"
+       local dst="$2$1"
+       echo "Migrating $src to $dst"
+(
+       diff=false
+       cd "$src"
+       mkdir -p "$dst"
+       for f in $(find . -type f)
+       do
+               f="${f##./}"
+               case "$f" in
+               */*)
+                       ds="$(dirname "$f")"
+                       dd="$dst/$ds"
+                       mkdir -p "$dd"
+                       chmod "$(stat -f "%p" "$ds" |
+                           sed -e 's/.*\([0-7][0-7][0-7][0-7]\)$/\1/g')" "$dd"
+                       chown "$(stat -f %u:%g "$ds")" "$dd"
+                       ;;
+               *)
+                       ;;
+               esac
+               if [ -r "$dst/$f" ]
+               then
+                       if ! cmp "$f" "$dst/$f"; then
+                               diff=true
+                       fi
+               else
+                       cp -p "$f" "$dst/$f"
+               fi
+       done
+       if $diff; then
+               echo "Cannot complete migration because files are different"
+               echo "Run 'diff -r $src $dst' resolve the differences"
+       else
+               rm -fr "$src"
+               ln -s "$dst" "$src"
+       fi
+)
+}
+
+nsd_precmd()
+{
+       if [ -z "$nsd_chrootdir" ]; then
+               return
+       fi
+
+       if [ ! -h /etc/nsd ]; then
+               nsd_migrate /etc/nsd ${nsd_chrootdir}
+       fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 9e0ea4a10c0e -r cae107f2d6ae external/bsd/nsd/include/config.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/nsd/include/config.h Sat Jan 07 19:51:21 2017 +0000
@@ -0,0 +1,839 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define this to enable BIND8 like NSTATS & XSTATS. */
+#define BIND8_STATS /**/
+
+/* NSD default chroot directory */
+#define CHROOTDIR "/var/chroot/nsd"
+
+/* NSD config dir */
+#define CONFIGDIR CHROOTDIR "/etc/nsd"
+
+/* Pathname to the NSD configuration file */
+#define CONFIGFILE CHROOTDIR "/etc/nsd/nsd.conf"
+
+/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
+   */
+/* #undef DARWIN_BROKEN_SETREUID */
+
+/* Pathname to the NSD database */
+#define DBFILE CHROOTDIR "/var/db/nsd/nsd.db"
+
+/* Define to the default maximum message length with EDNS. */
+#define EDNS_MAX_MESSAGE_LEN 4096
+
+/* Define to the default facility for syslog. */
+#define FACILITY LOG_DAEMON
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define to 1 if you have the `arc4random' function. */
+#define HAVE_ARC4RANDOM 1
+
+/* Define to 1 if you have the `arc4random_uniform' function. */
+#define HAVE_ARC4RANDOM_UNIFORM 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Whether the C compiler accepts the "format" attribute */
+#define HAVE_ATTR_FORMAT 1
+
+/* Whether the C compiler accepts the "unused" attribute */
+#define HAVE_ATTR_UNUSED 1
+
+/* Define to 1 if you have the `b64_ntop' function. */
+/* #undef HAVE_B64_NTOP */
+
+/* Define to 1 if you have the `b64_pton' function. */
+/* #undef HAVE_B64_PTON */
+
+/* Define to 1 if you have the `basename' function. */
+#define HAVE_BASENAME 1
+
+/* Define to 1 if your system has a working `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define to 1 if you have the `chroot' function. */
+#define HAVE_CHROOT 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* if time.h provides ctime_r prototype */
+#define HAVE_CTIME_R_PROTO 1
+
+/* Define to 1 if you have the `dup2' function. */
+#define HAVE_DUP2 1
+
+/* Define to 1 if you have the <endian.h> header file. */
+/* #undef HAVE_ENDIAN_H */
+
+/* Define to 1 if you have the `endpwent' function. */
+#define HAVE_ENDPWENT 1
+
+/* Define to 1 if you have the `ERR_load_crypto_strings' function. */
+#define HAVE_ERR_LOAD_CRYPTO_STRINGS 1
+
+/* Define to 1 if you have the `event_base_free' function. */
+#define HAVE_EVENT_BASE_FREE 1
+
+/* Define to 1 if you have the `event_base_get_method' function. */
+#define HAVE_EVENT_BASE_GET_METHOD 1
+
+/* Define to 1 if you have the `event_base_new' function. */
+#define HAVE_EVENT_BASE_NEW 1
+
+/* Define to 1 if you have the `event_base_once' function. */
+#define HAVE_EVENT_BASE_ONCE 1
+
+/* Define to 1 if you have the <event.h> header file. */
+#define HAVE_EVENT_H 1
+
+/* Define to 1 if you have the `EVP_cleanup' function. */
+#define HAVE_EVP_CLEANUP 1
+
+/* Define to 1 if you have the `ev_default_loop' function. */
+/* #undef HAVE_EV_DEFAULT_LOOP */
+
+/* Define to 1 if you have the `ev_loop' function. */
+/* #undef HAVE_EV_LOOP */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `freeaddrinfo' function. */
+#define HAVE_FREEADDRINFO 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#define HAVE_GAI_STRERROR 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `getpwnam' function. */
+#define HAVE_GETPWNAM 1
+
+/* Define to 1 if you have the `glob' function. */
+#define HAVE_GLOB 1
+
+/* Define to 1 if you have the <glob.h> header file. */
+#define HAVE_GLOB_H 1
+
+/* Define to 1 if you have the <grp.h> header file. */
+#define HAVE_GRP_H 1
+
+/* Define to 1 if you have the `HMAC_CTX_new' function. */
+/* #undef HAVE_HMAC_CTX_NEW */
+
+/* Define to 1 if you have the `HMAC_CTX_reset' function. */
+/* #undef HAVE_HMAC_CTX_RESET */
+
+/* Define to 1 if you have the `inet_aton' function. */



Home | Main Index | Thread Index | Old Index