summaryrefslogtreecommitdiff
path: root/net/iana-etc
diff options
context:
space:
mode:
authorchristos <christos@pkgsrc.org>2012-08-25 10:59:50 +0000
committerchristos <christos@pkgsrc.org>2012-08-25 10:59:50 +0000
commite7ed514eed013afb4e744847aeb1d31dc6e62639 (patch)
tree18d39a4b7c3a9079c2bc3c4d7dc69bed07307fe7 /net/iana-etc
parentb35c994ba33fd944f1381199c1286d5f9bbd953e (diff)
downloadpkgsrc-e7ed514eed013afb4e744847aeb1d31dc6e62639.tar.gz
New iana-etc package, from Seth W. Klein's source. This package can
be used to create services and protocols files from the IANA sources.
Diffstat (limited to 'net/iana-etc')
-rw-r--r--net/iana-etc/DESCR6
-rw-r--r--net/iana-etc/Makefile16
-rw-r--r--net/iana-etc/PLIST0
-rw-r--r--net/iana-etc/distinfo8
-rw-r--r--net/iana-etc/patches/patch-Makefile42
-rw-r--r--net/iana-etc/patches/patch-get.gawk24
-rw-r--r--net/iana-etc/patches/patch-services.gawk24
7 files changed, 120 insertions, 0 deletions
diff --git a/net/iana-etc/DESCR b/net/iana-etc/DESCR
new file mode 100644
index 00000000000..4c7f13b7884
--- /dev/null
+++ b/net/iana-etc/DESCR
@@ -0,0 +1,6 @@
+This package installs nothing but creates a "protocols" and "services"
+file in it's work area. It uses Seth W. Klein's iana-etc software, but
+since this has not been modified since 2008, I have updated it to handle
+the location and the format of the current files. You can use the protocols
+and services files it generates for NetBSD following the information in
+/usr/src/doc/3RDPARTY
diff --git a/net/iana-etc/Makefile b/net/iana-etc/Makefile
new file mode 100644
index 00000000000..8ab5dd5c50f
--- /dev/null
+++ b/net/iana-etc/Makefile
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2012/08/25 10:59:50 christos Exp $
+#
+
+DISTNAME= iana-etc-2.30
+CATEGORIES= net
+MASTER_SITES= http://sethwklein.net/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= christos@NetBSD.org
+HOMEPAGE= http://sethwklein.net/
+COMMENT= Tools to process the IANA source files into services and protocols
+LICENSE= osl
+
+USE_TOOLS+= gmake gawk
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/iana-etc/PLIST b/net/iana-etc/PLIST
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/net/iana-etc/PLIST
diff --git a/net/iana-etc/distinfo b/net/iana-etc/distinfo
new file mode 100644
index 00000000000..4633ce0997b
--- /dev/null
+++ b/net/iana-etc/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2012/08/25 10:59:50 christos Exp $
+
+SHA1 (iana-etc-2.30.tar.bz2) = 218593bcb9264014c4e397d838b2c218eac9df06
+RMD160 (iana-etc-2.30.tar.bz2) = c381a9b1a26a6a06cebf8b1789ac42b8d362256f
+Size (iana-etc-2.30.tar.bz2) = 205618 bytes
+SHA1 (patch-Makefile) = 4579e64c24c4834964915de81835111645d4e4b3
+SHA1 (patch-get.gawk) = 9ee0c6f5ffc917605e10a0a17c78d317ea888a05
+SHA1 (patch-services.gawk) = 49f6d44cf1a33bb5f21c4ce9693fe6b26cddfab2
diff --git a/net/iana-etc/patches/patch-Makefile b/net/iana-etc/patches/patch-Makefile
new file mode 100644
index 00000000000..76f2dd0fcce
--- /dev/null
+++ b/net/iana-etc/patches/patch-Makefile
@@ -0,0 +1,42 @@
+$NetBSD: patch-Makefile,v 1.1 2012/08/25 10:59:50 christos Exp $
+
+--- Makefile 2012-08-25 13:45:59.000000000 +0300
++++ Makefile 2012-08-25 13:10:09.000000000 +0300
+@@ -17,7 +17,7 @@
+ .PHONY: all files get test test-services test-protocols install clean \
+ protocol-numbers.iana port-numbers.iana dist
+
+-all: files
++all: get files
+ files: protocols services
+
+ get: protocol-numbers.iana port-numbers.iana
+@@ -30,10 +30,10 @@
+ test-protocols: protocols test-lib.gawk test-protocols.gawk
+ $(AWK) -f test-lib.gawk -f test-protocols.gawk <protocols
+
+-install: files
+- install -d $(DESTDIR)$(PREFIX)$(ETC_DIR)
+- install -m 644 protocols $(DESTDIR)$(PREFIX)$(ETC_DIR)
+- install -m 644 services $(DESTDIR)$(PREFIX)$(ETC_DIR)
++#install: files
++# install -d $(DESTDIR)$(PREFIX)$(ETC_DIR)
++# install -m 644 protocols $(DESTDIR)$(PREFIX)$(ETC_DIR)
++# install -m 644 services $(DESTDIR)$(PREFIX)$(ETC_DIR)
+
+ clean:
+ rm -vf \
+@@ -42,11 +42,11 @@
+ protocol-numbers.iana port-numbers.iana
+
+ protocol-numbers.iana:
+- $(AWK) -f get.gawk -v file=protocol-numbers >protocol-numbers.iana
++ $(AWK) -f get.gawk -v url=protocol-numbers file=protocol-numbers >protocol-numbers.iana
+ rm -f protocol-numbers
+
+ port-numbers.iana:
+- $(AWK) -f get.gawk -v file=port-numbers >port-numbers.iana
++ $(AWK) -f get.gawk -v url=service-names-port-numbers file=port-numbers >port-numbers.iana
+ rm -f port-numbers
+
+ protocol-numbers:
diff --git a/net/iana-etc/patches/patch-get.gawk b/net/iana-etc/patches/patch-get.gawk
new file mode 100644
index 00000000000..c1e71907156
--- /dev/null
+++ b/net/iana-etc/patches/patch-get.gawk
@@ -0,0 +1,24 @@
+$NetBSD: patch-get.gawk,v 1.1 2012/08/25 10:59:50 christos Exp $
+
+--- get.gawk 2008-03-05 20:04:18.000000000 +0200
++++ get.gawk 2012-08-25 13:10:28.000000000 +0300
+@@ -7,7 +7,7 @@
+
+ # get.awk: retrieves IANA numbers assignments from iana.org.
+ # Requires GNU Awk.
+-# Usage: get.gawk -v file=<filename>
++# Usage: get.gawk -v url=<url> file=<filename>
+
+ BEGIN {
+ host = "www.iana.org"
+@@ -15,8 +15,8 @@
+ # file is set by the caller
+ socket = "/inet/tcp/0/" host "/80"
+
+- print "Getting http://" host path file >"/dev/stderr"
+- printf "GET %s%s HTTP/1.0\r\nHost: %s\r\n\r\n", path, file, host |& socket
++ print "Getting http://" host path url "/" url ".txt" >"/dev/stderr"
++ printf "GET %s%s/%s.txt HTTP/1.0\r\nHost: %s\r\n\r\n", path, url, url, host |& socket
+ printf "Request sent, waiting for data... " >"/dev/stderr"
+
+ NR = 0
diff --git a/net/iana-etc/patches/patch-services.gawk b/net/iana-etc/patches/patch-services.gawk
new file mode 100644
index 00000000000..30284c02c9e
--- /dev/null
+++ b/net/iana-etc/patches/patch-services.gawk
@@ -0,0 +1,24 @@
+$NetBSD: patch-services.gawk,v 1.1 2012/08/25 10:59:50 christos Exp $
+
+--- services.gawk 2008-03-05 19:51:45.000000000 +0200
++++ services.gawk 2012-08-25 13:36:06.000000000 +0300
+@@ -22,15 +22,15 @@
+ }
+ }
+ { sub(/\r/, "") }
+-# 1:name 2:ws 3:port 4:range 5:proto 6:comment
+-match($0, /(^[[:alnum:]][^ \t]+)([ \t]+)([0-9]+)(-[0-9]+)?\/([^ \t]+)(.*)/, f) \
++# 1:name 2:ws 3:port 4:range 6:proto 7:comment
++match($0, /(^[[:alnum:]][^ \t]+)([ \t]+)([0-9]+)(-[0-9]+)?([ \t]+)(dccp|sctp|tcp|udp)(.*)/, f) \
+ && f[3] != "0" {
+ # port 0 means unallocated, per port-numbers
+ name = f[1]
+ whitespace = f[2]
+ port = f[3]
+- protocol = f[5]
+- comment = f[6]
++ protocol = f[6]
++ comment = f[7]
+ if (strip) {
+ whitespace = "\t"
+ comment = ""