summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Kaspar Rudert (mortzu)2015-05-22 07:55:56 +0200
committerMoritz Kaspar Rudert (mortzu)2015-05-22 07:55:56 +0200
commit81d39874d87ea0971eb28ef78fe59a22fe1251b3 (patch)
treeacd6bc011baea3662e74c76310808fc9c6cadd32
downloadaur-81d39874d87ea0971eb28ef78fe59a22fe1251b3.tar.gz
initial commit
-rw-r--r--.SRCINFO26
-rw-r--r--Makefile.in.patch31
-rw-r--r--PKGBUILD49
-rw-r--r--totd.conf4
-rw-r--r--totd.install36
-rw-r--r--totd.service10
-rw-r--r--totd.tmpfiles1
7 files changed, 157 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2530958552ab
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = totd
+ pkgdesc = Totd (Trick Or Treat Daemon) is DNS-proxy for IPv4/IPv6 translation (DNS-ALG)
+ pkgver = 1.5.1
+ pkgrel = 7
+ url = http://www.dillema.net/software/totd.html
+ install = totd.install
+ arch = x86_64
+ arch = i686
+ groups = network
+ license = BSD
+ depends = glibc
+ optdepends = socat
+ backup = etc/totd.conf
+ source = http://www.dillema.net/software/totd/totd-1.5.1.tar.gz
+ source = Makefile.in.patch
+ source = totd.conf
+ source = totd.service
+ source = totd.tmpfiles
+ md5sums = 7edaedae9f6aca5912dd6c123582cf08
+ md5sums = d2700ca1d451747d937fd3c1a3cf465f
+ md5sums = ff07c559419f8b7ee05351182a140483
+ md5sums = 0ac3d9982a2c79842778bdb5fa60435f
+ md5sums = 07b927909c9c440f15552ddf1a5ff56e
+
+pkgname = totd
+
diff --git a/Makefile.in.patch b/Makefile.in.patch
new file mode 100644
index 000000000000..94220d7ee72a
--- /dev/null
+++ b/Makefile.in.patch
@@ -0,0 +1,31 @@
+diff -Naur totd-1.5.1/Makefile.in totd-1.5.1-new/Makefile.in
+--- totd-1.5.1/Makefile.in 2005-01-31 05:55:14.000000000 -0600
++++ totd-1.5.1-new/Makefile.in 2011-10-13 18:55:35.664818486 -0500
+@@ -12,14 +12,15 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+
++DESTDIR=?
+ INSTALLDIR = @sbindir@
+ INSTALLLIB = @libdir@
+ INSTALLMAN = @mandir@
+ TOT_CONFIG_FILE=@sysconfdir@/totd.conf
+
+ 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
+@@ -66,8 +67,8 @@
+ -ranlib libswill.a
+
+ install: $(PROG)
+- $(INSTALL) -c -s -m 0555 -o bin -g bin $(PROG) $(INSTALLDIR)
+- $(INSTALL) -c -m 0444 -o root -g wheel $(MAN) $(INSTALLMAN)/man8
++ $(INSTALL) $(PROG) $(DESTDIR)$(INSTALLDIR)
++ $(INSTALL) $(MAN) $(DESTDIR)$(INSTALLMAN)/man8
+
+ lint:
+ lint ${SRCS}
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..29d0875af2e6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+pkgname=totd
+pkgver=1.5.1
+pkgrel=7
+pkgdesc="Totd (Trick Or Treat Daemon) is DNS-proxy for IPv4/IPv6 translation (DNS-ALG)"
+arch=('x86_64' 'i686')
+url="http://www.dillema.net/software/totd.html"
+license=('BSD')
+groups=(network)
+depends=('glibc')
+optdepends=(socat)
+backup=(etc/totd.conf)
+install=totd.install
+source=("http://www.dillema.net/software/$pkgname/$pkgname-$pkgver.tar.gz"
+ Makefile.in.patch
+ totd.conf
+ totd.service
+ totd.tmpfiles)
+md5sums=('7edaedae9f6aca5912dd6c123582cf08'
+ 'd2700ca1d451747d937fd3c1a3cf465f'
+ 'ff07c559419f8b7ee05351182a140483'
+ '0ac3d9982a2c79842778bdb5fa60435f'
+ '07b927909c9c440f15552ddf1a5ff56e')
+
+build() {
+ cd "$pkgname-$pkgver"
+
+ patch -Np1 -i "$srcdir/Makefile.in.patch"
+ ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin
+
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+
+ # prepare directories
+ mkdir -p ${pkgdir}/usr/{bin,man/man8}
+
+ # build program
+ make DESTDIR="$pkgdir" install
+
+ # install default config
+ install -Dm664 "$srcdir/totd.conf" "$pkgdir/etc/totd.conf"
+
+ # systemd
+ install -Dm644 "$srcdir/totd.service" "$pkgdir/usr/lib/systemd/system/totd.service"
+ install -Dm644 "$srcdir/totd.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/totd.conf"
+}
+# vim:set ts=2 sw=2 et:
diff --git a/totd.conf b/totd.conf
new file mode 100644
index 000000000000..e08b476f5882
--- /dev/null
+++ b/totd.conf
@@ -0,0 +1,4 @@
+forwarder 127.0.0.1 port 53
+prefix 3ffe:abcd:1234:9876::
+port 5005
+pidfile /run/totd/totd.pid
diff --git a/totd.install b/totd.install
new file mode 100644
index 000000000000..8d6a673942a1
--- /dev/null
+++ b/totd.install
@@ -0,0 +1,36 @@
+post_install() {
+ groupadd -g 111 totd
+ useradd -u 111 -g totd -d / -s /bin/false totd & > /dev/null
+
+ post_upgrade
+
+ echo "==> totd: "
+ echo "==> totd: Adjust /etc/totd.conf if you use other then"
+ echo "==> totd: locally binded DNS server - ie. 127.0.0.1:53"
+ echo "==> totd: "
+ echo "==> totd: TOTD uses UDPv6/TCPv6 port 5005 and runs uder"
+ echo "==> totd: separate totd user for security reasons."
+ echo "==> totd: If you would like to use TOTD directly as 'fake'"
+ echo "==> totd: DNS server for your LAN you have to setup some"
+ echo "==> totd: port-forwarding or other tricks because only root"
+ echo "==> totd: can bind ports <1024; ip6tables is not able to"
+ echo "==> totd: do REDIRECT right now :("
+ echo "==> totd: "
+ echo "==> totd: Example with 'socat', child processes run under"
+ echo "==> totd: totd user."
+ echo "==> totd: "
+ echo "==> totd: # socat \\"
+ echo "==> totd: UDP6-LISTEN:ingress_ipv6:53,bind=[::1],reuseaddr,fork,su=totd \\"
+ echo "==> totd: UDP6:[::1]:5005,bind=[::1]"
+ echo "==> totd: "
+}
+
+post_upgrade() {
+ if [[ ! -d run/totd ]]; then
+ usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/totd.conf
+ fi
+}
+
+pre_remove() {
+ userdel totd & > /dev/null
+}
diff --git a/totd.service b/totd.service
new file mode 100644
index 000000000000..3c0863930a2b
--- /dev/null
+++ b/totd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Trick Or Treat Daemon
+
+[Service]
+ExecStart=/usr/bin/totd -d1 -u totd -g totd -c /etc/totd.conf
+KillMode=process
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/totd.tmpfiles b/totd.tmpfiles
new file mode 100644
index 000000000000..1bf0d316ebae
--- /dev/null
+++ b/totd.tmpfiles
@@ -0,0 +1 @@
+d /run/totd 755 totd totd -