summaryrefslogtreecommitdiff
path: root/net/exabgp
diff options
context:
space:
mode:
authorhe <he@pkgsrc.org>2015-02-17 13:41:36 +0000
committerhe <he@pkgsrc.org>2015-02-17 13:41:36 +0000
commit0a9b2474efadc147add278b37e67abc2e8ede2fc (patch)
tree11326bfb722a8d7b1e57c7f31e87f4cd3a8c3407 /net/exabgp
parenta6ae13540a19841d8be9a674648369dbe650ba87 (diff)
downloadpkgsrc-0a9b2474efadc147add278b37e67abc2e8ede2fc.tar.gz
Fix healthcheck.py so that it works with NetBSD's (and other) outputs
from "ifconfig lo0" -- no sense in insisting on leading spaces in the regexp after having done string.strip() on the target string... Add dependency on py-ipaddr for healthcheck.py. Remove *.orig files before installing, and make install target re-runnable. Bump PKGREVISION.
Diffstat (limited to 'net/exabgp')
-rw-r--r--net/exabgp/Makefile13
-rw-r--r--net/exabgp/distinfo3
-rw-r--r--net/exabgp/patches/patch-etc_exabgp_processes_healthcheck.py35
3 files changed, 47 insertions, 4 deletions
diff --git a/net/exabgp/Makefile b/net/exabgp/Makefile
index 6f0d3d1d6cc..fae02e6ebce 100644
--- a/net/exabgp/Makefile
+++ b/net/exabgp/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.8 2014/08/13 22:34:57 joerg Exp $
+# $NetBSD: Makefile,v 1.9 2015/02/17 13:41:36 he Exp $
DISTNAME= exabgp-3.3.2
EGG_NAME= exabgp-0.0.0
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= net
-MASTER_SITES= -https://github.com/Exa-Networks/exabgp/tarball/3.3.2
+MASTER_SITES= https://github.com/Exa-Networks/exabgp/tarball/3.3.2
MAINTAINER= pettai@NetBSD.org
HOMEPAGE= https://github.com/Exa-Networks/exabgp/
@@ -15,6 +15,8 @@ WRKSRC= ${WRKDIR}/Exa-Networks-exabgp-d73251b
USE_TOOLS+= perl:run
+DEPENDS+= ${PYPKGPREFIX}-ipaddr>=0:../../devel/py-ipaddr
+
REPLACE_PERL= etc/exabgp/processes/dynamic-1.pl
REPLACE_PERL+= etc/exabgp/processes/watchdog-1.pl
REPLACE_PYTHON= lib/exabgp/application/bmp.py
@@ -34,10 +36,15 @@ USE_LANGUAGES= # none
INSTALLATION_DIRS= bin/exabgp sbin
+pre-install:
+ find work -name '*.orig' | xargs rm -f
+
post-install:
+ rm -f ${DESTDIR}${PREFIX}/sbin/exabgp
${LN} -s ${DESTDIR}${PREFIX}/bin/exabgp/exabgp \
${DESTDIR}${PREFIX}/sbin/
.include "../../lang/python/distutils.mk"
.include "../../lang/python/application.mk"
+.include "../../lang/python/pyversion.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/net/exabgp/distinfo b/net/exabgp/distinfo
index 536ff42d5e3..1dca37fa665 100644
--- a/net/exabgp/distinfo
+++ b/net/exabgp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2014/06/15 11:40:42 wiz Exp $
+$NetBSD: distinfo,v 1.6 2015/02/17 13:41:36 he Exp $
SHA1 (exabgp-3.3.2.tar.gz) = e6a883ceb513b9c21fcf7092b720dbf13784ebf7
RMD160 (exabgp-3.3.2.tar.gz) = 3ed5b73e244678c5b4f7f01fea4c3438e7e4d0dd
@@ -15,4 +15,5 @@ SHA1 (patch-dev_self_refresh_first) = b3b1315e9f3a5f053178f9adeb9451dfe1af736b
SHA1 (patch-dev_self_refresh_second) = 2c3bbe93e93ac908b75842aa46b79876bb10c78f
SHA1 (patch-dev_self_simple_first) = c5210d4b5a2d65bb9cf2e68752662a13b73b96ab
SHA1 (patch-dev_self_simple_second) = 1dad8e64ac4cfdcb5f5bcb6457ea6f7b7099e224
+SHA1 (patch-etc_exabgp_processes_healthcheck.py) = d2c97f08be1834295744e7f9a26c9907310c6207
SHA1 (patch-setup.py) = 95da865dfcbdb4b09c78efffa2c5f7ba9b1e31ca
diff --git a/net/exabgp/patches/patch-etc_exabgp_processes_healthcheck.py b/net/exabgp/patches/patch-etc_exabgp_processes_healthcheck.py
new file mode 100644
index 00000000000..bdcf0a69ec0
--- /dev/null
+++ b/net/exabgp/patches/patch-etc_exabgp_processes_healthcheck.py
@@ -0,0 +1,35 @@
+$NetBSD: patch-etc_exabgp_processes_healthcheck.py,v 1.1 2015/02/17 13:41:36 he Exp $
+
+Also match interface alias addresses, and spaces at the front
+are optional, particularly after "strip"...
+Also, provide more debugging output.
+
+--- etc/exabgp/processes/healthcheck.py.orig 2014-03-25 19:39:16.000000000 +0000
++++ etc/exabgp/processes/healthcheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/pkg/bin/python2.7
+
+ """Healthchecker for exabgp.
+
+@@ -210,16 +210,19 @@ def loopback_ips():
+ cmd = subprocess.Popen("/sbin/ip -o address show dev lo".split(), shell=False, stdout=subprocess.PIPE)
+ else:
+ # Try with ifconfig
+- ipre = re.compile(r"^\s+inet6?\s+(?P<ip>[\da-f.:]+)\s+(?:netmask 0x(?P<netmask>[0-9a-f]+)|prefixlen (?P<mask>\d+)).*")
++ ipre = re.compile(r"^\s*inet6?\s+(alias )?(?P<ip>[\da-f.:]+)\s+(?:netmask 0x(?P<netmask>[0-9a-f]+)|prefixlen (?P<mask>\d+)).*")
+ cmd = subprocess.Popen("/sbin/ifconfig lo0".split(), shell=False, stdout=subprocess.PIPE)
+ for line in cmd.stdout:
+ line = line.decode("ascii", "ignore").strip()
+ mo = ipre.match(line)
+ if not mo:
++ logger.debug("Skipping line: {0}".format(line))
+ continue
+ ip = ip_address(mo.group("ip"))
+ if not ip.is_loopback:
+ addresses.append(ip)
++ else:
++ logger.debug("Skipping loopback address: {0}".format(ip))
+ if not addresses:
+ raise RuntimeError("No loopback IP found")
+ logger.debug("Loopback addresses: {0}".format(addresses))