#	$OpenBSD$

COMMENT =		collection of RFCs

DISTNAME =		rfc-0.0.7000
PKGNAME = 		${DISTNAME}
CATEGORIES =		books
HOMEPAGE =		http://www.rfc-editor.org
MAINTAINER =		Peter Hessler <phessler@openbsd.org>

# ISC RFC License
PERMIT_PACKAGE_CDROM =	Yes

#MASTER_SITES =		ftp://ftp.rfc-editor.org/in-notes/tar/
MASTER_SITES =		https://www.rfc-editor.org/in-notes/tar/
MASTER_SITES0 =		http://www.ietf.org/rfc/
DISTFILES =		rfc-index.txt:0 bcp-index.txt:0 \
			RFCs0001-0500.tar.gz RFCs0501-1000.tar.gz \
			RFCs1501-2000.tar.gz RFCs2001-2500.tar.gz \
			RFCs2501-3000.tar.gz RFCs3001-3500.tar.gz \
			RFCs3501-4000.tar.gz RFCs4001-4500.tar.gz \
			RFCs4501-5000.tar.gz RFCs5001-5500.tar.gz \
			RFCs5501-6000.tar.gz RFCs6001-6500.tar.gz \
			RFCs6501-7000.tar.gz

# Avoid uncompressing a plaintext file
EXTRACT_CASES=		*.txt) cp ${FULLDISTDIR}/$$archive ${WRKDIST};;

NO_BUILD =		Yes
NO_TEST =		Yes
PKG_ARCH =		*

INSTALL_LOC =		${PREFIX}/share/doc/rfc
WRKDIST =		${WRKDIR}

do-install:
	${INSTALL_DATA_DIR} ${INSTALL_LOC}
	${INSTALL_DATA} ${WRKDIST}/rfc*.txt ${INSTALL_LOC}/
	${INSTALL_DATA} ${DISTDIR}/rfc-index.txt ${INSTALL_LOC}/
	${INSTALL_DATA} ${DISTDIR}/bcp-index.txt ${INSTALL_LOC}/
	${INSTALL_SCRIPT} ${FILESDIR}/rfc.sh ${PREFIX}/bin/rfc
	perl -i -pe 's!%%TRUEPREFIX%%!${TRUEPREFIX}!g' ${PREFIX}/bin/rfc

.include <bsd.port.mk>
