# New ports collection makefile for:   sixxs-aiccu
# Date created:                2004-09-09
# Initial FreeBSD port by: Meno Abels <meno.abels@adviser.com>
# Comments for this port please to the SixXS staff <info@sixxs.net>
#
# $FreeBSD$
#

PORTNAME=       sixxs-aiccu
PORTVERSION=    20050131
PORTREVISION=   1
CATEGORIES=     net ipv6
MASTER_SITES=   http://www.sixxs.net/archive/sixxs/aiccu/unix/
DISTFILES=      aiccu_current.tgz

MAINTAINER=	info@sixxs.net
COMMENT=	Automatic IPv6 Connectivity Configuration Utility (AICCU)

USE_RC_SUBR=	yes
USE_GMAKE=	yes
WRKSRC=		${WRKDIR}/aiccu

pre-build:
	@${SED} -e 's:%%PREFIX%%:${PREFIX}:g' \
		-e 's:%%RC_SUBR%%:${RC_SUBR}:g' \
		${WRKSRC}/doc/aiccu.init.freebsd >${WRKDIR}/aiccu.init.freebsd
	@${SED} \
		-e 's:ipv4_interface eth0:ipv4_interface sis0:' \
		-e 's:ipv6_interface sixxs:ipv6_interface gif0:' \
		${WRKSRC}/doc/aiccu.conf > ${WRKDIR}/aiccu.conf

do-install:
	@${MKDIR} ${DOCSDIR} ${EXAMPLESDIR}
	${INSTALL_PROGRAM} ${WRKSRC}/unix-console/aiccu ${PREFIX}/sbin/sixxs-aiccu
	${INSTALL_DATA} ${WRKSRC}/doc/README ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/LICENSE ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/HOWTO ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/aiccu.conf ${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKDIR}/aiccu.conf ${PREFIX}/etc/aiccu.conf.sample
	${INSTALL_SCRIPT} ${WRKDIR}/aiccu.init.freebsd ${PREFIX}/etc/rc.d/sixxs-aiccu.sh

post-install:
	if [ \! -f ${PREFIX}/etc/aiccu.conf ]; then \
		${MV} ${PREFIX}/etc/aiccu.conf.sample ${PREFIX}/etc/aiccu.conf.sample; \
	fi

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 501100
GIFCONFIG=	netbsd
.else
GIFCONFIG=	freebsd
.endif

.include <bsd.port.post.mk>

