aboutsummaryrefslogtreecommitdiff
path: root/network/nss-mdns
diff options
context:
space:
mode:
authorMenno Duursma <druiloor@zonnet.nl>2010-05-11 20:01:40 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 20:01:40 +0200
commit65ce762f7f0e7f5514391e30c22734c862ca2375 (patch)
treea974f6e378c7b51ca231cf3c5bf68dd9a1e8cb00 /network/nss-mdns
parent092fa42c62795f762d20d530d266ae41a5a91a5e (diff)
network/nss-mdns: Added to 12.0 repository
Diffstat (limited to 'network/nss-mdns')
-rw-r--r--network/nss-mdns/README18
-rw-r--r--network/nss-mdns/doinst.sh16
-rw-r--r--network/nss-mdns/mdns.allow12
-rw-r--r--network/nss-mdns/nss-mdns.SlackBuild82
-rw-r--r--network/nss-mdns/nss-mdns.info8
-rw-r--r--network/nss-mdns/nsswitch.conf-mdns42
-rw-r--r--network/nss-mdns/slack-desc10
7 files changed, 188 insertions, 0 deletions
diff --git a/network/nss-mdns/README b/network/nss-mdns/README
new file mode 100644
index 000000000000..75a811a1bd3b
--- /dev/null
+++ b/network/nss-mdns/README
@@ -0,0 +1,18 @@
+nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality
+of the GNU C Library (glibc) which provides host name resolution via
+Multicast DNS (a.k.a. Zeroconf, a.k.a. Apple Rendezvous, a.k.a Apple Bonjour).
+This effectively allows name resolution by common Unix/Linux programs in the
+ad-hoc mDNS domain .local.
+
+By default nss-mdns tries to contact a running avahi-daemon for resolving
+host names and addresses and making use of its superior record caching.
+Optionally nss-mdns can be compiled with a mini mDNS stack that can be
+used to resolve host names without a local Avahi installation. Both Avahi
+support and this mini mDNS stack are optional, however at least one of the
+needs to be enabled. If both are enabled a connection to Avahi is tried first,
+and if that fails the mini mDNS stack is used. This build script enables
+both, but the mini mDNS stack will be used on a default Slackware install,
+as Avahi is not included.
+
+To test, the following command should return a mapping for the remote host:
+ getent hosts <hostname>.local
diff --git a/network/nss-mdns/doinst.sh b/network/nss-mdns/doinst.sh
new file mode 100644
index 000000000000..66a1051516c0
--- /dev/null
+++ b/network/nss-mdns/doinst.sh
@@ -0,0 +1,16 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/mdns.allow.new
+config etc/nsswitch.conf-mdns.new
+
diff --git a/network/nss-mdns/mdns.allow b/network/nss-mdns/mdns.allow
new file mode 100644
index 000000000000..7ca905f237bc
--- /dev/null
+++ b/network/nss-mdns/mdns.allow
@@ -0,0 +1,12 @@
+# /etc/mdns.allow
+# Empty lines are ignored as are comments starting with #.
+
+# If the configuration file is absent or unreadable nss-mdns behaves
+# as if the following lines are uncommented
+#
+#.local.
+#.local
+
+# enable mDNS lookups of all names, regardless of the domain suffix
+*
+
diff --git a/network/nss-mdns/nss-mdns.SlackBuild b/network/nss-mdns/nss-mdns.SlackBuild
new file mode 100644
index 000000000000..29c5ba207b20
--- /dev/null
+++ b/network/nss-mdns/nss-mdns.SlackBuild
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# Slackware build script for nss-mdns
+# Written by Menno Duursma <druiloor@zonnet.nl>
+
+PRGNAM=nss-mdns
+VERSION=0.10
+ARCH=${ARCH:-i486}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+set -e # Exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Options that may be of interest:
+#
+# --enable-avahi Enable lookups with Avahi (default=yes)
+# --enable-legacy Enable legacy unicast mDNS lookups when Avahi isn't
+# available (default=no)
+# --enable-search-domains Honour search domains from /etc/resolv.conf
+# (default=no)
+#
+# install into /lib as /usr maybe unavailable in bootstrapping
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/ \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-legacy
+
+make
+make install DESTDIR=$PKG
+
+( cd $PKG
+ find . \
+ | xargs file \
+ | grep "shared object" \
+ | grep ELF \
+ | cut -f 1 -d : \
+ | xargs strip --strip-unneeded 2> /dev/null
+)
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a [A-Z][A-Z]* $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
+cp -a doc/README.html $PKG/usr/doc/$PRGNAM-$VERSION/html
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/etc
+cat $CWD/mdns.allow > $PKG/etc/mdns.allow.new
+cat $CWD/nsswitch.conf-mdns > $PKG/etc/nsswitch.conf-mdns.new
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
diff --git a/network/nss-mdns/nss-mdns.info b/network/nss-mdns/nss-mdns.info
new file mode 100644
index 000000000000..c8605b0c7965
--- /dev/null
+++ b/network/nss-mdns/nss-mdns.info
@@ -0,0 +1,8 @@
+PRGNAM="nss-mdns"
+VERSION="0.10"
+HOMEPAGE="http://0pointer.de/lennart/projects/nss-mdns/"
+DOWNLOAD="http://0pointer.de/lennart/projects/nss-mdns/nss-mdns-0.10.tar.gz"
+MD5SUM="03938f17646efbb50aa70ba5f99f51d7"
+MAINTAINER="Menno Duursma"
+EMAIL="druiloor@zonnet.nl"
+APPROVED="rworkman,BP{k}"
diff --git a/network/nss-mdns/nsswitch.conf-mdns b/network/nss-mdns/nsswitch.conf-mdns
new file mode 100644
index 000000000000..be3ea5e4914b
--- /dev/null
+++ b/network/nss-mdns/nsswitch.conf-mdns
@@ -0,0 +1,42 @@
+#
+# /etc/nsswitch.conf-mdns
+#
+# An example Name Service Switch config file. This file should be
+# sorted with the most-used services at the beginning.
+#
+# The entry '[NOTFOUND=return]' means that the search for an
+# entry should stop if the search in the previous entry turned
+# up nothing. Note that if the search failed due to some other reason
+# (like no NIS server responding) then the search continues with the
+# next entry.
+#
+# Legal entries are:
+#
+# nisplus or nis+ Use NIS+ (NIS version 3)
+# nis or yp Use NIS (NIS version 2), also called YP
+# dns Use DNS (Domain Name Service)
+# files Use the local files
+# [NOTFOUND=return] Stop searching if not found so far
+#
+
+# passwd: files nis
+# shadow: files nis
+# group: files nis
+
+passwd: compat
+group: compat
+
+hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
+networks: files dns
+
+services: files
+protocols: files
+rpc: files
+ethers: files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
+
diff --git a/network/nss-mdns/slack-desc b/network/nss-mdns/slack-desc
new file mode 100644
index 000000000000..252e24da8560
--- /dev/null
+++ b/network/nss-mdns/slack-desc
@@ -0,0 +1,10 @@
+nss-mdns: Multicast DNS host name resolution NSS module
+nss-mdns:
+nss-mdns: nss-mdns is a plugin for the GNU Name Service Switch (NSS)
+nss-mdns: functionality of the GNU C Library (glibc) which provides
+nss-mdns: host name resolution via via Multicast DNS (a.k.a. Zeroconf,
+nss-mdns: a.k.a. Apple Rendezvous, a.k.a Apple Bonjour). This effectively
+nss-mdns: allows name resolution by common Unix/Linux programs in the ad-hoc
+nss-mdns: ad-hoc mDNS domain .local.
+nss-mdns:
+nss-mdns: nss-mdns is maintained by Lennart Poettering