Subject: [alpine-devel] [PATCH] extra/maradns: new aport

From: Leonardo Arena <[email-masked]>
Date: Mon, 11 May 2009 13:53:27 +0200

please review attached patch
leo
From 1b74dc27a6a635ddab39459adf301af4217e5ef5 Mon Sep 17 00:00:00 2001
From: root <root@df1844j.(none)>
Date: Mon, 11 May 2009 11:51:11 +0000
Subject: [PATCH] extra/maradns: new aport

---
 extra/maradns/APKBUILD       |   61 ++++++++++++++++++++++++++++++++
 extra/maradns/db.example.net |   80 ++++++++++++++++++++++++++++++++++++++++++
 extra/maradns/mararc         |   38 ++++++++++++++++++++
 3 files changed, 179 insertions(+), 0 deletions(-)
 create mode 100644 extra/maradns/APKBUILD
 create mode 100644 extra/maradns/db.example.net
 create mode 100644 extra/maradns/mararc

diff --git a/extra/maradns/APKBUILD b/extra/maradns/APKBUILD
new file mode 100644
index 0000000..136fc97
--- /dev/null
+++ b/extra/maradns/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Leonardo Arena <[email-masked]>
+pkgname=maradns
+pkgver=1.3.07.09
+pkgrel=0
+pkgdesc="A security-aware DNS server"
+url="http://www.maradns.org"
+license="as-is"
+depends="uclibc"
+makedepends=""
+install=
+subpackages="$pkgname-doc"
+source="http://www.maradns.org/download/1.3/$pkgver/$pkgname-$pkgver.tar.bz2
+mararc
+db.example.net"
+
+build() {
+	cd "$srcdir/$pkgname-$pkgver"
+
+	./configure
+	make || return 1
+	install -m755 -D $srcdir/$pkgname-$pkgver/tools/askmara $pkgdir/usr/bin
+	install -m755 -D $srcdir/$pkgname-$pkgver/tools/duende $pkgdir/usr/bin
+	install -m755 -D $srcdir/$pkgname-$pkgver/tcp/fetchzone $pkgdir/usr/bin
+	install -m755 -D $srcdir/$pkgname-$pkgver/tcp/getzone $pkgdir/usr/bin
+	install -m755 -D $srcdir/$pkgname-$pkgver/server/maradns $pkgdir/usr/sbin
+	install -m755 -D $srcdir/$pkgname-$pkgver/tcp/zoneserver $pkgdir/usr/sbin
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/askmara.1 $pkgdir/usr/share/man/man1
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/fetchzone.1 $pkgdir/usr/share/man/man1
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/getzone.1 $pkgdir/usr/share/man/man1
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/getzone.1 $pkgdir/usr/share/man/man1
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/csv1.5 $pkgdir/usr/share/man/man5
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/csv2.5 $pkgdir/usr/share/man/man5
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/csv2_txt.5 $pkgdir/usr/share/man/man5
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/mararc.5 $pkgdir/usr/share/man/man5
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/duende.8 $pkgdir/usr/share/man/man8
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/maradns.8 $pkgdir/usr/share/man/man8
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/zoneserver.8 $pkgdir/usr/share/man/man8
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/webpage $pkgdir/usr/share/doc/maradns/webpage
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/man $pkgdir/usr/share/doc/maradns/man
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/tutorial $pkgdir/usr/share/doc/maradns/tutorial
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/text $pkgdir/usr/share/doc/maradns/text
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/examples $pkgdir/usr/share/doc/maradns/examples
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/misc $pkgdir/usr/share/doc/maradns/misc
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/source $pkgdir/usr/share/doc/maradns/source
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/README $pkgdir/usr/share/doc/maradns
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/Makefile $pkgdir/usr/share/doc/maradns
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/faq* $pkgdir/usr/share/doc/maradns
+	install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/files.txt $pkgdir/usr/share/doc/maradns
+	install -m644 -d $srcdir/$pkgname-$pkgver/doc/en/pdf $pkgdir/usr/share/doc/maradns/pdf
+	install -m644 -D $srcdir/$pkgname-$pkgver/maradns.gpg.key $pkgdir/usr/share/doc/maradns
+	install -m644 -D $srcdir/$pkgname-$pkgver/0QuickStart $pkgdir/usr/share/doc/maradns/QuickStart
+	install -m644 -D $srcdir/$pkgname-$pkgver/CHANGELOG $pkgdir/usr/share/doc/maradns
+	install -m644 -D $srcdir/$pkgname-$pkgver/CREDITS $pkgdir/usr/share/doc/maradns
+	install -m644 -D ../../mararc $pkgdir/etc/mararc
+	install -m644 -D ../../db.example.net $pkgdir/etc/maradns/db.example.net
+	mkdir $pkgdir/etc/maradns/logger
+}
+
+md5sums="1d221438fb4d9317263555262b9c652c  maradns-1.3.07.09.tar.bz2
+9ba4f45129fbfe8a01e61f6d244e5847  mararc
+91f4d32a3cc303f0abe3cdf0f6149e2b  db.example.net"
diff --git a/extra/maradns/db.example.net b/extra/maradns/db.example.net
new file mode 100644
index 0000000..43f4c71
--- /dev/null
+++ b/extra/maradns/db.example.net
@@ -0,0 +1,80 @@
+# This is an example csv2 zone file
+
+# First of all, csv2 zone files do not need an SOA record; however, if
+# one is provided, we will make it the SOA record for our zone
+# The SOA record needs to be the first record in the zone if provided
+# This is a commented out record and disabled.
+
+#% 	SOA	% email@% 1 7200 3600 604800 1800 ~
+
+# Second of all, csv2 zone files do not need authoritative NS records.
+# If they aren't there, MaraDNS will synthesize them, based on the IP
+# addresses MaraDNS is bound to.  (She's pretty smart about this; if
+# Mara is bound to both public and private IPs, only the public IPs will
+# be synthesized as NS records)
+
+
+#% 	NS 	a.% ~
+#%	NS	b.% ~
+
+# Here are some A (ipv4 address) records; since this is the most
+# common field, the zone file format allows a compact representation
+# of it.
+a.example.net. 	10.10.10.10 ~
+# Here, you can see that a single name, "b.example.net." has multiple IPs
+# This can be used as a primitive form of load balancing; MaraDNS will
+# rotate the IPs so that first IP seen by a DNS client changes every time
+# a query for "b.example.net." is made
+b.example.net.  10.10.10.11 ~
+b.example.net.  10.10.10.12 ~
+
+# We can have the label in either case; it makes no difference
+Z.EXAMPLE.NET. 	10.2.3.4 ~
+Y.EXAMPLE.net.  10.3.4.5 ~
+
+# We can use the percent shortcut.  When the percent shortcut is present,
+# it indicates that the name in question should terminate with the name
+# of the zone we are processing.
+percent.%	a 		10.9.8.7 ~
+
+# And we can have star records
+#*.example.net.  A		10.11.12.13 ~
+
+# We can have a ttl in a record; however the ttl needs a '+' before it:
+# Note that the ttl has to be in seconds, and is before the RTYPE
+d.example.net. +86400 A 10.11.12.13 ~
+
+f.example.net. # As you can see, records can span multiple lines
+        	A 	10.2.19.83 ~
+
+# This allows well-commented records, like this:
+c.example.net. 		# Our C class machine
+        +86400  	# This record is stored for one day
+        A       	# A record
+        10.1.1.1 	# Where we are 
+        ~               # End of record
+
+# We can even have something similiar to csv1 if we want...
+e.example.net.|+86400|a|10.2.3.4|~
+h.example.net.|a|10.9.8.7|~
+# Here, we see we can specify the ttl but not the rtype if desired
+g.example.net.|+86400|10.11.9.8|~
+
+# Here is a MX record
+% mx 10 mail.% ~
+mail.% +86400 IN A 10.22.23.24 ~
+
+# We even have a bit of ipv6 support
+a.example.net. 		aaaa 	3ffe:ffff:1:2:3::4:f ~
+
+# Not to mention support for SRV records
+_http._tcp.%    srv   0 0 80 a.% ~
+
+# TXT records, naturally
+example.net.    txt 'This is some text' ~
+
+# Starting with MaraDNS 1.2.08, there is also support for SPF records,
+# which are identical to TXT records.  See RFC4408 for more details.
+example.net.    spf 'v=spf1 +mx a:colo.example.com/28 -all' ~
+
+
diff --git a/extra/maradns/mararc b/extra/maradns/mararc
new file mode 100644
index 0000000..c726785
--- /dev/null
+++ b/extra/maradns/mararc
@@ -0,0 +1,38 @@
+# Example mararc file. 
+# This only shows a subset of MaraDNS' features needed to be an
+# authoritative and recursive name server.  Look at 
+# detailed/example_full_mararc for an example showing most of 
+# the features that MaraDNS has.
+
+# Note that this example mararc file will not actually do anything
+# without modification.
+# Look in the doc/en/examples directory for a working example 
+# authoritative nameserver, and a working recursive nameserver.
+
+# The various zones we support
+
+# When running in authoritative mode, we must initialize the csv2 hash, 
+# or MaraDNS will be unable to load any csv2 zone files
+csv2 = {}
+
+# This is just to show the format of the file
+# Note the this is commented out.  Any line that starts with 
+# a '#' is not read by the parser.  Remove the leading '#' to 
+# enable any line that is commented out
+
+# The following line (commented out) tells MaraDNS to look at the 
+# file db.example.net to get the zone for example.net
+csv2["example.net."] = "db.example.net"
+# Naturally, we can have multiple zone files
+#csv2["example.com."] = "db.example.com"
+
+# The address this DNS server runs on.  If you want to bind 
+# to multiple addresses, separate them with a comma like this:
+# "10.1.2.3, 10.1.2.4, 127.0.0.1"
+ipv4_bind_addresses = "127.0.0.1"
+# The directory with all of the zone files
+chroot_dir = "/etc/maradns"
+
+# If you want to enable recursion on the loopback interface, uncomment
+# the following line:
+#recursive_acl = "127.0.0.1/8"
-- 
1.6.2.3

---

From: Natanael Copa <[email-masked]>
Date: Wed, 13 May 2009 15:21:30 +0200

On Mon, 2009-05-11 at 13:53 +0200, Leonardo Arena wrote:
> differences between files attachment (0001-extra-maradns-new-aport.patch)
> 

Those lines here will install first askmara as usr/bin (the binary file
itself will be called bin in a /usr subdir). Directly after the 'bin'
file will be overwritten by duende, fetchzone and finally getzone.

The tar archive will contain an executable file named /usr/bin (which is
getzone).

> +       install -m755 -D $srcdir/$pkgname-$pkgver/tcp/zoneserver $pkgdir/usr/sbin

Same here.
$ tar -ztvf maradns-1.3.07.09-r0.apk 
-rw-r--r-- root/root       327 2009-05-13 12:28:27 .PKGINFO
drwxr-xr-x root/root         0 2009-05-13 12:28:26 etc/
-rw-r--r-- root/root      1477 2009-05-13 12:28:26 etc/mararc
drwxr-xr-x root/root         0 2009-05-13 12:28:26 etc/maradns/
-rw-r--r-- root/root      2802 2009-05-13 12:28:26 etc/maradns/db.example.net
drwxr-xr-x root/root         0 2009-05-13 12:28:26 etc/maradns/logger/
drwxr-xr-x root/root         0 2009-05-13 12:28:27 usr/
-rwxr-xr-x root/root    127418 2009-05-13 12:28:27 usr/bin
-rwxr-xr-x root/root    149031 2009-05-13 12:28:27 usr/sbin

> +       install -m644 -D $srcdir/$pkgname-$pkgver/doc/en/man/askmara.1 $pkgdir/usr/share/man/man1

those lines do similar things.

Also, since you already are in "$srcdir"/$pkgname-$pkgver so you dont
need the "$srcdir/$pkgname-$pkgver prefix.

install -m755 -D server/maradns $pkgdir/usr/sbin/maradns

care to give a new try?
after package is built, run a tar -ztvf maradns.apk to verify that
things got properly installed.

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---