Commit | Line | Data |
---|---|---|
c4dc4466 SHT |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in> | |
0b5eff84 | 3 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> |
7f1d8b5c | 4 | ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
a811bca2 | 5 | ;;; Copyright © 2018 Theodoros Foradis <theodoros@foradis.org> |
c4dc4466 SHT |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
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. | |
13 | ;;; | |
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. | |
18 | ;;; | |
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/>. | |
21 | ||
22 | (define-module (gnu packages upnp) | |
23 | #:use-module (gnu packages) | |
24 | #:use-module (gnu packages python) | |
25 | #:use-module (guix build-system gnu) | |
a811bca2 | 26 | #:use-module (guix utils) |
c4dc4466 | 27 | #:use-module (guix download) |
a811bca2 | 28 | #:use-module (guix git-download) |
c4dc4466 SHT |
29 | #:use-module (guix licenses) |
30 | #:use-module (guix packages)) | |
31 | ||
32 | (define-public miniupnpc | |
33 | (package | |
34 | (name "miniupnpc") | |
b861fc15 | 35 | (version "2.1.20190210") |
c4dc4466 SHT |
36 | (source |
37 | (origin | |
38 | (method url-fetch) | |
d9cf11e0 TGR |
39 | (uri (string-append "https://miniupnp.tuxfamily.org/files/" |
40 | name "-" version ".tar.gz")) | |
c4dc4466 | 41 | (sha256 |
b861fc15 | 42 | (base32 "05w8p51yd71ksapajb9nag464ncakk72v9dxr01y168wix707d49")))) |
c4dc4466 SHT |
43 | (build-system gnu-build-system) |
44 | (native-inputs | |
45 | `(("python" ,python-2))) | |
46 | (arguments | |
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. | |
50 | '(#:make-flags | |
51 | (list | |
05b1feb9 | 52 | (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh") |
c4dc4466 | 53 | (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out")) |
caf0c0a9 LC |
54 | "CC=gcc" |
55 | ||
56 | ;; Allow executables to find libminiupnpc.so. | |
57 | (string-append "LDFLAGS=-Wl,-rpath=" | |
58 | (assoc-ref %outputs "out") "/lib")) | |
c4dc4466 | 59 | #:phases |
cdbdaf7b | 60 | (modify-phases %standard-phases |
5af82630 TGR |
61 | (delete 'configure) |
62 | (add-before 'install 'qualify-paths | |
63 | (lambda* (#:key outputs #:allow-other-keys) | |
64 | (substitute* "external-ip.sh" | |
65 | (("upnpc") | |
1e000f17 TGR |
66 | (string-append (assoc-ref outputs "out") "/bin/upnpc"))) |
67 | #t))))) | |
c4dc4466 | 68 | (home-page "http://miniupnp.free.fr/") |
e0f8a520 | 69 | (synopsis "UPnP protocol client library") |
c4dc4466 | 70 | (description |
e0f8a520 | 71 | "The MiniUPnPc client library facilitates access to the services provided |
8a6f168c TGR |
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. | |
74 | ||
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.") | |
c4dc4466 SHT |
79 | (license |
80 | (x11-style "file://LICENSE" "See 'LICENSE' file in the distribution")))) | |
0b5eff84 | 81 | |
a811bca2 TF |
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 | |
86 | ;; releases. | |
87 | (let ((revision "0") | |
88 | (commit "6a63f9954959119568fbc4af57d7b491b9428d87")) | |
89 | (package | |
90 | (inherit miniupnpc) | |
91 | (name "miniupnpc-monero") | |
92 | (version (string-append "2.1-monero-0.12.3.0-" revision "." | |
93 | (string-take commit 7))) | |
94 | (source (origin | |
95 | (method git-fetch) | |
96 | (uri (git-reference | |
97 | (url "https://github.com/monero-project/miniupnp/") | |
98 | (commit commit))) | |
99 | (sha256 | |
100 | (base32 | |
101 | "0s67zcz978iapjlq30yy9dl8qda9xhrl3jdi5f99cnbglh5gy16a")) | |
102 | (file-name (string-append name "-" version "-checkout")) | |
103 | (modules '((guix build utils))) | |
104 | (snippet | |
105 | '(begin | |
106 | ;; Delete miniupnp subprojects except for miniupnpc. | |
107 | (for-each | |
108 | delete-file-recursively | |
109 | '("minissdpd" "miniupnpc-async" "miniupnpc-libevent" | |
110 | "miniupnpd" )) | |
111 | #t)))) | |
112 | (arguments | |
113 | (substitute-keyword-arguments (package-arguments miniupnpc) | |
114 | ((#:phases phases) | |
115 | `(modify-phases ,phases | |
116 | (add-before 'build 'change-directory | |
117 | (lambda _ | |
118 | (chdir "miniupnpc") | |
119 | #t)) | |
120 | (add-after 'change-directory 'chmod-header-file | |
121 | (lambda _ | |
122 | (chmod "miniupnpc.h" #o644) | |
123 | #t))))))))) | |
124 | ||
0b5eff84 LF |
125 | (define-public libupnp |
126 | (package | |
127 | (name "libupnp") | |
50e1843b | 128 | (version "1.6.25") |
0b5eff84 LF |
129 | (source |
130 | (origin | |
131 | (method url-fetch) | |
132 | (uri (string-append "mirror://sourceforge/pupnp/pupnp/libUPnP%20" | |
133 | version "/" name "-" version ".tar.bz2")) | |
134 | (sha256 | |
135 | (base32 | |
50e1843b | 136 | "0hzsd7rvfa87b4hxg9yj4xhdfxx9sp09r9sqdl3mqhvmcyw018y5")))) |
0b5eff84 LF |
137 | (build-system gnu-build-system) |
138 | (arguments | |
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. | |
142 | `(#:tests? #f | |
143 | #:configure-flags '("--enable-ipv6"))) | |
144 | (home-page "http://pupnp.sourceforge.net") | |
145 | (synopsis "Portable SDK for UPnP Devices") | |
146 | (description | |
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 | |
151 | and others.") | |
152 | (license bsd-3))) |