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, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Theodoros Foradis <theodoros@foradis.org>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages upnp)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages python)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix utils)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix licenses)
30 #:use-module (guix packages))
32 (define-public miniupnpc
35 (version "2.1.20190408")
39 (uri (string-append "https://miniupnp.tuxfamily.org/files/"
40 name "-" version ".tar.gz"))
42 (base32 "1v0l2m8j7r6jiy871d6v11ls243xqn6s3856iwd3bmk5c37npi50"))))
43 (build-system gnu-build-system)
45 `(("python" ,python-2)))
47 ;; The build system does not use a configure script but depends on
48 ;; `make'. Hence we should pass parameters to `make' instead and remove
49 ;; the configure phase.
52 (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh")
53 (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out"))
56 ;; Allow executables to find libminiupnpc.so.
57 (string-append "LDFLAGS=-Wl,-rpath="
58 (assoc-ref %outputs "out") "/lib"))
60 (modify-phases %standard-phases
62 (add-before 'install 'qualify-paths
63 (lambda* (#:key outputs #:allow-other-keys)
64 (substitute* "external-ip.sh"
66 (string-append (assoc-ref outputs "out") "/bin/upnpc")))
68 (home-page "http://miniupnp.free.fr/")
69 (synopsis "UPnP protocol client library")
71 "The MiniUPnPc client library facilitates access to the services provided
72 by any @dfn{Universal Plug and Play} (UPnP) @dfn{Internet Gateway Device} (IGD)
73 present on the network. In UPnP terminology, MiniUPnPc is a UPnP Control Point.
75 It is useful whenever an application needs to listen for incoming connections
76 while running behind a UPnP-enabled router or firewall. Such applications
77 include peer-to-peer applications, active-mode FTP clients, DCC file transfers
78 over IRC, instant messaging, network games, and most server software.")
80 (x11-style "file://LICENSE" "See 'LICENSE' file in the distribution"))))
82 (define-public monero-miniupnpc
83 ;; This package is the bundled version of miniupnpc used with monero.
84 ;; Monero-project has been maintaining its own version of the package since
85 ;; release 0.12.2.0. It includes security fixes not included in upstream
88 (commit "6a63f9954959119568fbc4af57d7b491b9428d87"))
91 (name "miniupnpc-monero")
92 (version (string-append "2.1-monero-0.12.3.0-" revision "."
93 (string-take commit 7)))
97 (url "https://github.com/monero-project/miniupnp/")
101 "0s67zcz978iapjlq30yy9dl8qda9xhrl3jdi5f99cnbglh5gy16a"))
102 (file-name (string-append name "-" version "-checkout"))
103 (modules '((guix build utils)))
106 ;; Delete miniupnp subprojects except for miniupnpc.
108 delete-file-recursively
109 '("minissdpd" "miniupnpc-async" "miniupnpc-libevent"
113 (substitute-keyword-arguments (package-arguments miniupnpc)
115 `(modify-phases ,phases
116 (add-before 'build 'change-directory
120 (add-after 'change-directory 'chmod-header-file
122 (chmod "miniupnpc.h" #o644)
125 (define-public libupnp
132 (uri (string-append "mirror://sourceforge/pupnp/pupnp/libUPnP%20"
133 version "/" name "-" version ".tar.bz2"))
136 "0hzsd7rvfa87b4hxg9yj4xhdfxx9sp09r9sqdl3mqhvmcyw018y5"))))
137 (build-system gnu-build-system)
139 ;; The tests require a network device capable of multicasting which is
140 ;; not available in the build environment. See
141 ;; https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00312.html.
143 #:configure-flags '("--enable-ipv6")))
144 (home-page "http://pupnp.sourceforge.net")
145 (synopsis "Portable SDK for UPnP Devices")
147 "The portable SDK for UPnP Devices (libupnp) provides developers with an
148 API and code for building control points, devices, and bridges that are
149 compliant with Version 1.0 of the Universal Plug and Play Device Architecture
150 Specification and support several operating systems like Linux, *BSD, Solaris