services: avahi: Default to nss-mdns 0.10.
[jackhill/guix/guix.git] / gnu / packages / avahi.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages avahi)
22 #:use-module ((guix licenses) #:select (lgpl2.1+))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages databases)
28 #:use-module (gnu packages libdaemon)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages xml))
33
34 (define-public avahi
35 (package
36 (name "avahi")
37 (version "0.6.31")
38 (home-page "http://avahi.org")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append home-page "/download/avahi-"
42 version ".tar.gz"))
43 (sha256
44 (base32
45 "0j5b5ld6bjyh3qhd2nw0jb84znq0wqai7fsrdzg7bpg24jdp2wl3"))
46 (patches (search-patches "avahi-localstatedir.patch"))))
47 (build-system gnu-build-system)
48 (arguments
49 '(#:configure-flags '("--with-distro=none"
50 "--localstatedir=/var" ; for the DBus socket
51 "--disable-python"
52 "--disable-mono"
53 "--disable-doxygen-doc"
54 "--disable-xmltoman"
55 "--enable-tests"
56 "--disable-qt3" "--disable-qt4"
57 "--disable-gtk" "--disable-gtk3"
58 "--enable-compat-libdns_sd")))
59 (inputs
60 `(("expat" ,expat)
61 ("glib" ,glib)
62 ("dbus" ,dbus)
63 ("gdbm" ,gdbm)
64 ("libcap" ,libcap) ;to enable chroot support in avahi-daemon
65 ("libdaemon" ,libdaemon)))
66 (native-inputs
67 `(("intltool" ,intltool)
68 ("glib" ,glib "bin")
69 ("pkg-config" ,pkg-config)))
70 (synopsis "Implementation of mDNS/DNS-SD protocols")
71 (description
72 "Avahi is a system which facilitates service discovery on a local
73 network. It is an implementation of the mDNS (for \"Multicast DNS\") and
74 DNS-SD (for \"DNS-Based Service Discovery\") protocols.")
75 (license lgpl2.1+)))
76
77 (define-public nss-mdns
78 (package
79 (name "nss-mdns")
80 (version "0.11")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "https://github.com/lathiat/nss-mdns"
84 "/releases/download/v" version "/"
85 name "-" version ".tar.gz"))
86 (sha256
87 (base32
88 "14jwy6mklzgjz3mfmw67mxhszrw9d3d3yjjhg87j4crci6m19i39"))))
89 (build-system gnu-build-system)
90 (arguments
91 ;; The Avahi daemon socket is expected by src/Makefile.am to be at
92 ;; "$(localstatedir)/run/avahi-daemon/socket", so set $(localstatedir)
93 ;; appropriately.
94 '(#:configure-flags '("--localstatedir=/var")))
95 (home-page "https://github.com/lathiat/nss-mdns")
96 (synopsis "Multicast DNS Name Service Switch (@dfn{NSS}) plug-in")
97 (description
98 "Nss-mdns is a plug-in for the GNU C Library's Name Service Switch
99 (@dfn{NSS}) that resolves host names via multicast DNS (@dfn{mDNS}). It is
100 most often used in home and other small networks without a local name server,
101 to resolve host names in the @samp{.local} top-level domain.")
102 (license lgpl2.1+)))
103
104 (define-public nss-mdns-0.10
105 ;; Kept here to work around in bug in 0.11: <https://bugs.gnu.org/30396> and
106 ;; <https://github.com/lathiat/nss-mdns/issues/26>.
107 (package
108 (inherit nss-mdns)
109 (version "0.10")
110 (source (origin
111 (method url-fetch)
112 (uri (list
113 (string-append
114 "mirror://debian/pool/main/n/nss-mdns/nss-mdns_"
115 version ".orig.tar.gz")
116 "http://pkgs.fedoraproject.org/repo/pkgs/nss-mdns/nss-mdns-0.10.tar.gz/03938f17646efbb50aa70ba5f99f51d7/nss-mdns-0.10.tar.gz"
117
118 ;; This used to be the canonical URL but it vanished.
119 ;; See <http://bugs.gnu.org/18704>.
120 ;; (string-append
121 ;; "http://0pointer.de/lennart/projects/nss-mdns/nss-mdns-"
122 ;; version ".tar.gz")
123 ))
124 (sha256
125 (base32
126 "0vgs6j0qsl0mwzh5a0m0bykr7x6bx79vnbyn0r3q289rghp3qs0y"))
127 (file-name (string-append "nss-mdns-" version ".tar.gz"))))))