summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobin@reportlab.com2015-06-16 10:31:44 +0100
committerrobin@reportlab.com2015-06-16 10:31:44 +0100
commitf43e989961b46e9eb2d4784ecf169051c2b3baf4 (patch)
tree466e73a286574bdc073f4152a0cb91aded1bbc00
downloadaur-f43e989961b46e9eb2d4784ecf169051c2b3baf4.tar.gz
initial import
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD43
-rw-r--r--nss-mdns.install20
-rw-r--r--search-local.patch38
4 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5ef2a5f913a8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = nss-mdns-domainless
+ pkgdesc = glibc plugin providing host name resolution via mDNS (domainless allowed for .local)
+ pkgver = 0.10
+ pkgrel = 6
+ url = http://0pointer.de/lennart/projects/nss-mdns/
+ install = nss-mdns.install
+ arch = i686
+ arch = x86_64
+ license = LGPL
+ depends = glibc
+ provides = nss-dns=0.10-6
+ conflicts = nss-mdns
+ source = http://pkgs.fedoraproject.org/repo/pkgs/nss-mdns/nss-mdns-0.10.tar.gz/03938f17646efbb50aa70ba5f99f51d7/nss-mdns-0.10.tar.gz
+ source = search-local.patch
+ md5sums = 03938f17646efbb50aa70ba5f99f51d7
+ md5sums = c8b707747ddaeb5c8ed3859e1aa6fa15
+
+pkgname = nss-mdns-domainless
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b252f4f56520
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Based on nss-mdns pkg by
+# Maintainer: Tom Gundersen <teg@jklm.no>
+# Contributor: Travis Willard <travis@archlinux.org>
+# adds an automatic search name.local when name containss
+# no . thus allowing domainless searches
+
+pkgname=nss-mdns-domainless
+pkgver=0.10
+pkgrel=6
+pkgdesc="glibc plugin providing host name resolution via mDNS (domainless allowed for .local)"
+arch=('i686' 'x86_64')
+url="http://0pointer.de/lennart/projects/nss-mdns/"
+license=('LGPL')
+depends=('glibc')
+conflicts=('nss-mdns')
+provides=("nss-dns=${pkgver}-${pkgrel}")
+install=nss-mdns.install
+source=("http://pkgs.fedoraproject.org/repo/pkgs/nss-mdns/nss-mdns-$pkgver.tar.gz/03938f17646efbb50aa70ba5f99f51d7/nss-mdns-$pkgver.tar.gz"
+ "search-local.patch"
+ )
+md5sums=('03938f17646efbb50aa70ba5f99f51d7'
+ 'c8b707747ddaeb5c8ed3859e1aa6fa15'
+ )
+prepare(){
+ local d=${srcdir}/${pkgname}-${pkgver}
+ [ ! -h "$d" ] && ln -s ${pkgname%-domainless}-${pkgver} "$d"
+ [ ! -d "$d" ] && echo "!!!!! cannot locate dir '$d'" && exit 666
+ patch -Np0 -i "$srcdir/search-local.patch"
+ }
+
+build() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --disable-lynx
+ make
+}
+
+package() {
+ make -C"${srcdir}/${pkgname}-${pkgver}" DESTDIR="${pkgdir}" install
+}
diff --git a/nss-mdns.install b/nss-mdns.install
new file mode 100644
index 000000000000..85e4d269aab2
--- /dev/null
+++ b/nss-mdns.install
@@ -0,0 +1,20 @@
+post_install() {
+ cat << 'EOM'
+==> To enable IPv4 multicast DNS lookups, append 'mdns4' to the hosts line
+ in /etc/nsswitch.conf. Use 'mdns6' for IPv6 or 'mdns' for both.
+EOM
+}
+
+post_upgrade() {
+ if [ "$2" == "0.7-1" ]; then
+ echo -n "disabling mdns lookups in /etc/nsswitch.conf... "
+ sed -i -e '/^hosts: / s/ mdns\([46]\)\?\>//g' etc/nsswitch.conf && echo "done."
+ fi
+ cat << 'EOM'
+==> Please note that due to security reasons from version 0.9 on the
+ minimal mDNS stack included in nss-mdns (dubbed "legacy") is no
+ longer built - nss-mdns will not work unless Avahi is running.
+EOM
+
+ post_install
+}
diff --git a/search-local.patch b/search-local.patch
new file mode 100644
index 000000000000..3d1f4b188f92
--- /dev/null
+++ b/search-local.patch
@@ -0,0 +1,38 @@
+*** nss-mdns-0.10/src/nss.c.orig 2015-02-14 18:27:09.307400597 +0000
+--- nss-mdns-0.10/src/nss.c 2015-02-14 18:28:38.826193854 +0000
+***************
+*** 378,383 ****
+--- 378,410 ----
+ } else
+ status = NSS_STATUS_NOTFOUND;
+ }
++ if (u.count == 0 && avahi_works && !strstr(name, ".")) {
++ const char *p="local";
++ int fullnamesize;
++ char *fullname;
++ fullnamesize = strlen(name) + strlen(p) + 2;
++ if ((fullname = malloc(fullnamesize))){
++ snprintf(fullname, fullnamesize, "%s.%s", name, p);
++ if (verify_name_allowed(fullname)) {
++ int r;
++ if ((r = avahi_resolve_name(af, fullname, data)) < 0) {
++ /* Lookup failed */
++ avahi_works = 0;
++ }
++ else if (r == 0) {
++ /* Lookup succeeded */
++ if (af == AF_INET && ipv4_func)
++ ipv4_func((ipv4_address_t*) data, &u);
++ if (af == AF_INET6 && ipv6_func)
++ ipv6_func((ipv6_address_t*)data, &u);
++ }
++ else
++ /* Lookup suceeded, but nothing found */
++ status = NSS_STATUS_NOTFOUND;
++ }
++ free(fullname);
++ }
++ }
+
+ #ifdef HONOUR_SEARCH_DOMAINS
+ if (u.count == 0 && avahi_works && !ends_with(name, ".")) {