]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
miredo: New package.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 May 2012 13:37:31 +0000 (15:37 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 May 2012 13:38:28 +0000 (15:38 +0200)
Miredo is a teredo client.

miredo/client-hook [new file with mode: 0644]
miredo/miredo.nm [new file with mode: 0644]
miredo/patches/miredo-1.2.5-libteredo-header.patch [new file with mode: 0644]
miredo/patches/miredo-config-not-exec.patch [new file with mode: 0644]
miredo/patches/reread-resolv-before-resolv-ipv4.patch [new file with mode: 0644]
miredo/systemd/miredo-client@.service [new file with mode: 0644]
miredo/systemd/miredo-server.service [new file with mode: 0644]

diff --git a/miredo/client-hook b/miredo/client-hook
new file mode 100644 (file)
index 0000000..4ae8b0c
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2012  IPFire Network Development Team                         #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+# This is a proxy script which is started instead of the real helper.
+# However, the only thing this script does it to call the actual helper script.
+
+script="/usr/lib/network/helpers/miredo-helper"
+
+if [ -x "${script}" ]; then
+       exec ${script}
+fi
+
+echo "${script} could not be found." >&2
+exit 1
diff --git a/miredo/miredo.nm b/miredo/miredo.nm
new file mode 100644 (file)
index 0000000..48d9b43
--- /dev/null
@@ -0,0 +1,151 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = miredo
+version    = 1.2.5
+release    = 1
+
+groups     = Network/VPN
+url        = http://www.remlab.net/miredo/
+license    = GPLv2+
+summary    = Tunneling of IPv6 over UDP through NATs.
+
+description
+       Miredo is an implementation of the "Teredo: Tunneling IPv6 over UDP
+       through NATs" proposed Internet standard (RFC4380). It can serve
+       either as a Teredo client, a stand-alone Teredo relay, or a Teredo
+       server, please install the miredo-server or miredo-client aproprietly.
+       It is meant to provide IPv6 connectivity to hosts behind NAT
+       devices, most of which do not support IPv6, and not even
+       IPv6-over-IPv4 (including 6to4).
+end
+
+source_dl  = http://www.remlab.net/files/miredo/
+sources    = %{thisapp}.tar.xz
+
+build
+       requires
+               libcap-devel
+               shadow-utils
+               systemd-units
+       end
+
+       configure_options += \
+               --disable-static \
+               --disable-rpath \
+               --enable-miredo-user
+
+       install_cmds
+               install -v -m 755 %{DIR_SOURCE}/client-hook \
+                       %{BUILDROOT}%{sysconfdir}/miredo/client-hook
+
+               touch %{BUILDROOT}%{sysconfdir}/miredo/miredo-server.conf
+       end
+end
+
+packages
+       package %{name}-client
+               summary = This is the client part of miredo.
+
+               # There is not "miredo" package, so the -client
+               # package has an alias for it.
+               provides = miredo = %{thisver}
+
+               requires
+                       %{name}-libs = %{thisver}
+                       network
+               end
+
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl try-restart miredo-client.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl --no-reload disable miredo-client.service >/dev/null 2>&1 || :
+                       systemctl stop miredo-client.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               configfiles
+                       %{sysconfdir}/miredo/miredo.conf
+               end
+
+               files
+                       %{sysconfdir}/miredo/client-hook
+                       %{sysconfdir}/miredo/miredo.conf
+                       %{sbindir}/miredo
+                       %{unitdir}/miredo-client@.service
+                       %{mandir}/man?/miredo.*
+               end
+       end
+
+       package %{name}-server
+               summary = This is the server part of miredo.
+
+               requires = %{name}-libs = %{thisver}
+
+               script postin
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+                       systemctl try-restart miredo-server.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       systemctl --no-reload disable miredo-server.service >/dev/null 2>&1 || :
+                       systemctl stop miredo-server.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               configfiles
+                       %{sysconfdir}/miredo/miredo-server.conf
+               end
+
+               files
+                       %{bindir}/teredo-mire
+                       %{sbindir}/miredo-server
+                       %{sbindir}/miredo-checkconf
+                       %{unitdir}/miredo-server.service
+                       %{mandir}/man?/teredo-mire*
+                       %{mandir}/man?/miredo-server*
+                       %{mandir}/man?/miredo-checkconf*
+               end
+       end
+
+       package %{name}-libs
+               template LIBS
+
+               files += %{libdir}/miredo
+
+               script prein
+                       getent group miredo >/dev/null || groupadd -r miredo
+                       getent passwd miredo >/dev/null || useradd -r -g miredo \
+                               -d %{sysconfdir}/miredo -s /sbin/nologin -c "Miredo Daemon" miredo
+               end
+       end
+
+       package %{name}-devel
+               template DEVEL
+
+               requires = %{name}-libs = %{thisver}
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/miredo/patches/miredo-1.2.5-libteredo-header.patch b/miredo/patches/miredo-1.2.5-libteredo-header.patch
new file mode 100644 (file)
index 0000000..6d7dc38
--- /dev/null
@@ -0,0 +1,10 @@
+--- miredo-1.2.5/libteredo/tunnel.h.orig       2012-05-30 14:59:00.742600216 +0000
++++ miredo-1.2.5/libteredo/tunnel.h    2012-05-30 14:59:05.760760580 +0000
+@@ -32,6 +32,7 @@
+ # define LIBTEREDO_TUNNEL_H
+ # include <stdbool.h>
++# include <stddef.h>
+ # ifdef __cplusplus
+ extern "C" {
diff --git a/miredo/patches/miredo-config-not-exec.patch b/miredo/patches/miredo-config-not-exec.patch
new file mode 100644 (file)
index 0000000..c4c5a31
--- /dev/null
@@ -0,0 +1,17 @@
+diff -ru miredo-1.1.6/misc/client-hook.iproute miredo-1.1.6-new/misc/client-hook.iproute
+--- miredo-1.1.6/misc/client-hook.iproute      2008-12-17 16:14:23.000000000 +0100
++++ miredo-1.1.6-new/misc/client-hook.iproute  2009-06-28 01:24:22.000000000 +0200
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#!/bin/sh
+ #
+ # Miredo client hook script for Linux/iproute2
+ # Copyright © 2007 Rémi Denis-Courmont.
+diff -ru miredo-1.1.6/misc/miredo.conf-in miredo-1.1.6-new/misc/miredo.conf-in
+--- miredo-1.1.6/misc/miredo.conf-in   2009-04-09 18:31:30.000000000 +0200
++++ miredo-1.1.6-new/misc/miredo.conf-in       2009-06-28 01:24:29.000000000 +0200
+@@ -1,4 +1,3 @@
+-#! @sbindir@/miredo -f -c
+ #
+ # Sample configuration file for Miredo
diff --git a/miredo/patches/reread-resolv-before-resolv-ipv4.patch b/miredo/patches/reread-resolv-before-resolv-ipv4.patch
new file mode 100644 (file)
index 0000000..4d7d9e1
--- /dev/null
@@ -0,0 +1,16 @@
+@@ -, +, @@ 
+ libteredo/maintain.c |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+--- a/libteredo/maintain.c     
++++ a/libteredo/maintain.c     
+@@ -262,6 +262,9 @@ void maintenance_thread (teredo_maintenance *m)
+               /* Resolve server IPv4 addresses */
+               while (server_ip == 0)
+               {
++                      /* Reread resolv.conf, it could have changed */
++                      res_init();
++
+                       /* FIXME: mutex kept while resolving - very bad */
+                       int val = getipv4byname (m->server, &server_ip);
+                       gettime (&deadline);
+
diff --git a/miredo/systemd/miredo-client@.service b/miredo/systemd/miredo-client@.service
new file mode 100644 (file)
index 0000000..b55e214
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Miredo - Teredo IPv6 Tunneling Client For Unix on %I
+BindTo=dev-%I.device
+After=dev-%I.device
+
+[Service]
+ExecStartPre=/usr/lib/network/helpers/miredo-config-helper create %I
+ExecStart=/usr/sbin/miredo -f -c /run/network/miredo/%I/client.conf -p /run/network/miredo/%I/client.pid
+ExecStopPost=/usr/lib/network/helpers/miredo-config-helper remove %I
+Restart=always
+UtmpIdentifier=%I
+KillMode=process
diff --git a/miredo/systemd/miredo-server.service b/miredo/systemd/miredo-server.service
new file mode 100644 (file)
index 0000000..e6d4d44
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Miredo - Teredo IPv6 tunneling Server For Unix
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/miredo-server.pid
+ExecStart=/usr/sbin/miredo-server
+
+[Install]
+WantedBy=multi-user.target