ports/129881: [patch] net/openospfd: update to 4.3 and fix some bugs
Eygene Ryabinkin
rea-fbsd at codelabs.ru
Tue Dec 23 21:55:38 UTC 2008
I have another patch that just cleans up some things:
* FreeBSD now has <sys/hash.h>, so it is better to use the native one;
* __dead2 macro is here and does the same thing as __dead for OpenBSD;
* kroute.c needs no substitutions -- we have them in the patch.
These fixes are mostly cosmetic ones, but I feel that is right to
include them to the port.
--- update-to-4.3-pack4.diff begins here ---
From a4365e162d129f7111895ce75b50fe41e949752d Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
Date: Wed, 24 Dec 2008 00:14:37 +0300
Subject: [PATCH 4/4] net/openospfd: clean up some FreeBSD-specific stuff
- FreeBSD has __dead2 macro instead of __dead one, so there is no point
in wiping '__dead' completely. __dead2 is here at least since
RELENG_4, so we seem to be safe here.
- FreeBSD has sys/hash.h since FreeBSD 6.x, so it will be better to
use local version. Just now it coincides with one that was exported
by flz at .
- Remove sed construct for kroute.c -- we have a patch for this.
Signed-off-by: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
---
net/openospfd/Makefile | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/net/openospfd/Makefile b/net/openospfd/Makefile
index 56b919d..695c095 100644
--- a/net/openospfd/Makefile
+++ b/net/openospfd/Makefile
@@ -12,7 +12,7 @@ MASTER_SITES= ${MASTER_SITE_OPENBSD:S/$/:openbsd/g} \
${MASTER_SITE_LOCAL:S/$/:freebsd/g}
MASTER_SITE_SUBDIR= flz/openospfd/:freebsd OpenBGPD/:openbsd
DISTFILES= ${PORTNAME}-${PORTVERSION}.tgz:openbsd \
- if_media.h:freebsd hash.h:freebsd
+ if_media.h:freebsd
DIST_SUBDIR= ${PORTNAME}
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}.tgz
@@ -23,6 +23,13 @@ LIB_DEPENDS= event-1.4:${PORTSDIR}/devel/libevent
CONFLICTS= zebra-0* quagga-0*
+.include <bsd.port.pre.mk>
+
+HASH_H!= ${TEST} -f /usr/include/sys/hash.h > /dev/null 2>&1 && ${ECHO} yes || ${TRUE}
+.if ${HASH_H} != yes
+DISTFILES+= hash.h:freebsd
+.endif
+
WRKSRC= ${WRKDIR}
MANCOMPRESSED= yes
USE_RC_SUBR= openospfd.sh
@@ -43,19 +50,22 @@ SUBDIRS= ospfd \
post-extract:
@${CP} ${DISTDIR}/${DIST_SUBDIR}/if_media.h ${WRKSRC}/ospfctl/
+.if ${HASH_H} != yes
@${CP} ${DISTDIR}/${DIST_SUBDIR}/hash.h ${WRKSRC}/ospfd/
+.endif
post-patch:
+.if ${HASH_H} != yes
@${REINPLACE_CMD} -e "s|sys/hash.h|hash.h|" ${WRKSRC}/ospfd/lsupdate.c
+.endif
@${REINPLACE_CMD} -e "s|<net/if_media.h>|\"if_media.h\"|" ${WRKSRC}/ospfctl/ospfctl.c
- @${REINPLACE_CMD} -e "s|rtm_fmask|rtm_use|" ${WRKSRC}/ospfd/kroute.c
@${REINPLACE_CMD} -e "/rc.conf.local/d" ${WRKSRC}/ospfd/ospfd.conf.5
@${REINPLACE_CMD} -e "s|SIMPLEQ|STAILQ|" ${WRKSRC}/ospfd/*.[chy]
@${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|g" \
${WRKSRC}/ospfd/ospfd.h \
${WRKSRC}/ospfd/ospfd.8 \
${WRKSRC}/ospfd/ospfd.conf.5
- @${REINPLACE_CMD} -e "s|__dead||" \
+ @${REINPLACE_CMD} -e "s|__dead|__dead2|" \
${WRKSRC}/ospfd/log.h \
${WRKSRC}/ospfd/ospfd.c \
${WRKSRC}/ospfctl/ospfctl.c
@@ -73,4 +83,4 @@ do-install:
post-install:
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--
1.6.0.5
--- update-to-4.3-pack4.diff ends here ---
--
Eygene
_ ___ _.--. #
\`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard
/ ' ` , __.--' # to read the on-line manual
)/' _/ \ `-_, / # while single-stepping the kernel.
`-'" `"\_ ,_.-;_.-\_ ', fsc/as #
_.-'_./ {_.' ; / # -- FreeBSD Developers handbook
{_.-``-' {_/ #
More information about the freebsd-ports-bugs
mailing list