Add totd (#1401)
authorFlorian Fainelli <florian@openwrt.org>
Mon, 26 Feb 2007 11:19:29 +0000 (11:19 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 26 Feb 2007 11:19:29 +0000 (11:19 +0000)
SVN-Revision: 6386

net/totd/Makefile [new file with mode: 0644]
net/totd/files/totd.conf [new file with mode: 0644]
net/totd/files/totd.init [new file with mode: 0644]
net/totd/patches/01-no_warning_as_errors.patch [new file with mode: 0644]

diff --git a/net/totd/Makefile b/net/totd/Makefile
new file mode 100644 (file)
index 0000000..c8a9598
--- /dev/null
@@ -0,0 +1,58 @@
+# 
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id: Makefile 5329 2006-10-28 22:43:08Z nico $
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=totd
+PKG_VERSION:=1.5.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.pasta.cs.uit.no/pub/totd/
+PKG_MD5SUM:=7edaedae9f6aca5912dd6c123582cf08
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/totd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+kmod-ipv6
+  TITLE:=Small DNS proxy that supports IPv6/IPv4 record translation
+  DESCRIPTION:=\
+       totd is a small DNS proxy nameserver which supports IPv6 and enable IPv6\\\
+       only sites to access IPv4 sites by using some translation mechanism such\\\
+       as NAT-PT, KAME faith, etc...
+  URL:=http://pasta.cs.uit.no/software/totd.html
+endef
+
+define Package/totd/conffiles
+/etc/totd.conf
+endef
+
+# uses GNU configure
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               CC=$(TARGET_CC) \
+               all
+endef
+
+define Package/totd/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/
+       $(INSTALL_CONF) ./files/totd.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/totd.init $(1)/etc/init.d/totd
+endef
+
+$(eval $(call BuildPackage,totd))
diff --git a/net/totd/files/totd.conf b/net/totd/files/totd.conf
new file mode 100644 (file)
index 0000000..49fcca4
--- /dev/null
@@ -0,0 +1,18 @@
+; $Id: totd.conf.sample,v 1.9 2003/09/17 15:56:20 dillema Exp $
+; Totd sample configuration file
+; you can have multiple forwarders, totd will always prefer
+; forwarders listed early and only use forwarders listed later
+; if the first ones are unresponsive.
+forwarder 192.168.1.1 port 5353
+; you can have multiple prefixes or even no prefixes at all
+; totd uses them in round-robin fashion
+prefix 3ffe:abcd:1234:9876::
+; the port totd listens on for incoming requests
+port 53
+; the pidfile to use (default: /var/run/totd.pid)
+pidfile /var/run/totd.pid
+; interfaces totd listens on (UDP only for now and not on Linux)
+; If left out totd will only open wildcard sockets.
+; interfaces lo br0
+; 6to4 reverse lookup
+; stf
diff --git a/net/totd/files/totd.init b/net/totd/files/totd.init
new file mode 100644 (file)
index 0000000..c12cc41
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+START=60
+BIN=totd
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN.pid
+
+
+start() {
+       mkdir -p $RUN_D
+       $BIN -c /etc/totd.conf
+}
+
+stop() {
+       [ -f $PID_F ] && kill $(cat $PID_F)
+}
+
+restart() {
+       stop
+       sleep 1
+       start
+}
diff --git a/net/totd/patches/01-no_warning_as_errors.patch b/net/totd/patches/01-no_warning_as_errors.patch
new file mode 100644 (file)
index 0000000..88fc359
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN totd-1.5.1/Makefile.in totd-1.5.1.new/Makefile.in
+--- totd-1.5.1/Makefile.in     2005-01-31 12:55:14.000000000 +0100
++++ totd-1.5.1.new/Makefile.in 2007-02-26 12:12:05.000000000 +0100
+@@ -19,7 +19,7 @@
+ INSTALL = /usr/bin/install
+-CFLAGS  = @CFLAGS@ @DEFS@  -Werror -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH)
++CFLAGS  = @CFLAGS@ @DEFS@ -Wall -DTOTCONF=\"$(TOT_CONFIG_FILE)\" @OPTFLAGS@ $(INCLUDEPATH)
+ # When debugging is enabled by --enable-malloc-debug flag to the configure
+ # script, the @DBMALLOC@ substitution will contain the empty string, thus