diff options
author | Norikatsu Shigemura <nork@FreeBSD.org> | 2002-10-23 15:35:35 +0000 |
---|---|---|
committer | Norikatsu Shigemura <nork@FreeBSD.org> | 2002-10-23 15:35:35 +0000 |
commit | e6aeacd5971603b030c6888a01f6fe3a36d36ae4 (patch) | |
tree | ac1d25c802bc154225afc8d1644207a0777b4879 /net-mgmt/ehnt | |
parent | 1. Removed unused refs to sleep. (diff) |
Distributed with ehnt data file contains a bit outdated ASN list.
Also, RIPE NCC had totally switched their database to RPSL, so
new preparation logic should take place.
PR: ports/44357
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=68670
Diffstat (limited to 'net-mgmt/ehnt')
-rw-r--r-- | net-mgmt/ehnt/Makefile | 12 | ||||
-rw-r--r-- | net-mgmt/ehnt/files/patch-ProcessASN.pl | 128 |
2 files changed, 138 insertions, 2 deletions
diff --git a/net-mgmt/ehnt/Makefile b/net-mgmt/ehnt/Makefile index bf6d4e23f0b7..7299a2dc29ea 100644 --- a/net-mgmt/ehnt/Makefile +++ b/net-mgmt/ehnt/Makefile @@ -7,17 +7,25 @@ PORTNAME= ehnt PORTVERSION= 0.3 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} -DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \ - ${PORTNAME}_data-${PORTVERSION}${EXTRACT_SUFX} +DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} +.if !defined(NO_ASN_DATA) +DISTFILES+= ${PORTNAME}_data-${PORTVERSION}${EXTRACT_SUFX} +.endif MAINTAINER= marck@rinet.ru MAN1= ehnt.1 MAN8= ehntserv.8 +.if defined(NO_ASN_DATA) +post-extract: + ${TOUCH} ${WRKSRC}/asnc.txt +.endif + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/ehnt ${PREFIX}/bin/ ${INSTALL_PROGRAM} ${WRKSRC}/ehntserv ${PREFIX}/sbin/ diff --git a/net-mgmt/ehnt/files/patch-ProcessASN.pl b/net-mgmt/ehnt/files/patch-ProcessASN.pl new file mode 100644 index 000000000000..367b4766d102 --- /dev/null +++ b/net-mgmt/ehnt/files/patch-ProcessASN.pl @@ -0,0 +1,128 @@ + +$FreeBSD$ + +--- ProcessASN.pl.orig Tue Oct 22 00:21:49 2002 ++++ ProcessASN.pl Tue Oct 22 00:21:53 2002 +@@ -4,7 +4,7 @@ + + #ftp://ftp.arin.net/netinfo/asn.txt + #ftp://ftp.apnic.net/pub/apnic/dbase/data/apnic.an.gz +-#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz ++#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz + + #and put them all in another file in a dumb format so they can + #be processed by my dumb C program. +@@ -51,28 +51,28 @@ + } + } + +-if (! -f "ripe.db.an" ) { +- if (-f "ripe.db.an.gz") { +- system "$gzip -d ripe.db.an.gz"; ++if (! -f "ripe.db.aut-num" ) { ++ if (-f "ripe.db.aut-num.gz") { ++ system "$gzip -d ripe.db.aut-num.gz"; + $r=$?; + if ($r > 0) { +- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; ++ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; + print "---> Please get $gzip and try again\n"; + exit(1); + } + } else { +- if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz","ripe.db.an.gz")) { +- system "$gzip -d ripe.db.an.gz"; ++ if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz","ripe.db.aut-num.gz")) { ++ system "$gzip -d ripe.db.aut-num.gz"; + $r=$?; + if ($r > 0) { +- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; ++ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; + print "---> Please get $gzip and try again\n"; + exit(1); + } + } else { +- print "---> Cannot retrieve ripe.db.an.gz\n"; ++ print "---> Cannot retrieve ripe.db.aut-num.gz\n"; + print "---> Please download it from\n"; +- print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz\n"; ++ print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz\n"; + $MissingFile=1; + } + } +@@ -109,7 +109,7 @@ + print "Processed $c ASes from asn.txt\n"; + + ProcessRipeDB("apnic.an"); +-ProcessRipeDB("ripe.db.an"); ++ProcessRipeDB("ripe.db.aut-num"); + + $c=0; + open OUTPUT,">asnc.txt"; +@@ -124,7 +124,7 @@ + $c=0; + open APNIC,"<$file"; + while (<APNIC>) { +- if (/^\*an: AS(..*)/) { ++ if (/^(\*an|aut-num):\s+AS(..*)/) { + if ($an) { + if ($aa) { $ASNs{$an}=$aa; $c++; } + elsif ($mb) { $ASNs{$an}=$mb; $c++; } +@@ -133,25 +133,25 @@ + + undef $an; undef $aa; undef $mb; undef $de; + } +- $an=$1; ++ $an=$2; + } +- if (/^\*aa: (..*)/) { ++ if (/^(\*aa|as-name):\s+(..*)/) { + if (! $aa) { +- $aa=$1; ++ $aa=$2; + $aa=~ s/ /_/g; + if ($aa eq 'UNSPECIFIED') { + $aa="AS$an"; # 'an:' is always defined here + } + } + } +- if (/^\*mb: MAINT\-(..*)/) { ++ if (/^(\*mb|mnt-by):\s+MAINT\-(..*)/) { + if (! $mb) { +- $mb=$1; ++ $mb=$2; + $mb=~ s/ /_/g; + } +- } elsif (/^\*mb: (..*)/) { ++ } elsif (/^(\*mb|mnt-by):\s+(..*)/) { + if (! $mb) { +- $mb=$1; ++ $mb=$2; + $mb=~ s/ /_/g; + } + } +@@ -176,20 +176,12 @@ + + print "RetrieveFile: getting $location\n"; + +- $wget="wget"; +- $ncftp="ncftp"; +- $curl="curl"; +- system "$wget -q $location"; +- $r=$?; +- if ($r==0) { print "Got file with $wget.\n"; return 1; } ++ $fetch="fetch"; + +- system "$ncftp $location"; ++ system "$fetch $location"; + $r=$?; +- if ($r==0) { print "Got file with $ncftp.\n"; return 1; } ++ if ($r==0) { print "Got file with $fetch.\n"; return 1; } + +- system "$curl -o $filename $location"; +- $r=$?; +- if ($r==0) { print "Got file with $curl\n"; return 1; } +- if ($r > 0) { print "Could not get $filename with $curl, $wget or $ncftp.\n"; } ++ if ($r > 0) { print "Could not get $filename with $fetch, $curl, $wget or $ncftp.\n"; } + return 0; + } |