Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / upnp.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016, 2017 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 upnp)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages python)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix download)
26 #:use-module (guix licenses)
27 #:use-module (guix packages))
28
29 (define-public miniupnpc
30 (package
31 (name "miniupnpc")
32 (version "2.0.20180222")
33 (source
34 (origin
35 (method url-fetch)
36 (uri (string-append "https://miniupnp.tuxfamily.org/files/"
37 name "-" version ".tar.gz"))
38 (sha256
39 (base32 "0xavcrifk8v8gwig3mj0kjkm7rvw1kbsxcs4jxrrzl39cil48yaq"))))
40 (build-system gnu-build-system)
41 (native-inputs
42 `(("python" ,python-2)))
43 (arguments
44 ;; The build system does not use a configure script but depends on
45 ;; `make'. Hence we should pass parameters to `make' instead and remove
46 ;; the configure phase.
47 '(#:make-flags
48 (list
49 (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh")
50 (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out"))
51 "CC=gcc"
52
53 ;; Allow executables to find libminiupnpc.so.
54 (string-append "LDFLAGS=-Wl,-rpath="
55 (assoc-ref %outputs "out") "/lib"))
56 #:phases
57 (modify-phases %standard-phases
58 (delete 'configure)
59 (add-before 'install 'qualify-paths
60 (lambda* (#:key outputs #:allow-other-keys)
61 (substitute* "external-ip.sh"
62 (("upnpc")
63 (string-append (assoc-ref outputs "out") "/bin/upnpc")))
64 #t)))))
65 (home-page "http://miniupnp.free.fr/")
66 (synopsis "UPnP protocol client library")
67 (description
68 "The MiniUPnPc client library facilitates access to the services provided
69 by any @dfn{Universal Plug and Play} (UPnP) @dfn{Internet Gateway Device} (IGD)
70 present on the network. In UPnP terminology, MiniUPnPc is a UPnP Control Point.
71
72 It is useful whenever an application needs to listen for incoming connections
73 while running behind a UPnP-enabled router or firewall. Such applications
74 include peer-to-peer applications, active-mode FTP clients, DCC file transfers
75 over IRC, instant messaging, network games, and most server software.")
76 (license
77 (x11-style "file://LICENSE" "See 'LICENSE' file in the distribution"))))
78
79 (define-public libupnp
80 (package
81 (name "libupnp")
82 (version "1.6.24")
83 (source
84 (origin
85 (method url-fetch)
86 (uri (string-append "mirror://sourceforge/pupnp/pupnp/libUPnP%20"
87 version "/" name "-" version ".tar.bz2"))
88 (sha256
89 (base32
90 "15ngi1i7cvsv7g15fb9bkswvi99d1plz52x5qgjn4h5vyfddg0vx"))))
91 (build-system gnu-build-system)
92 (arguments
93 ;; The tests require a network device capable of multicasting which is
94 ;; not available in the build environment. See
95 ;; https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00312.html.
96 `(#:tests? #f
97 #:configure-flags '("--enable-ipv6")))
98 (home-page "http://pupnp.sourceforge.net")
99 (synopsis "Portable SDK for UPnP Devices")
100 (description
101 "The portable SDK for UPnP Devices (libupnp) provides developers with an
102 API and code for building control points, devices, and bridges that are
103 compliant with Version 1.0 of the Universal Plug and Play Device Architecture
104 Specification and support several operating systems like Linux, *BSD, Solaris
105 and others.")
106 (license bsd-3)))