From cperciva@hexahedron.daemonology.net  Sat Nov  6 19:08:50 2004
Return-Path: <cperciva@hexahedron.daemonology.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8CC7616A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Nov 2004 19:08:50 +0000 (GMT)
Received: from tx2.mail.ox.ac.uk (tx2.mail.ox.ac.uk [163.1.2.163])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E69C143D39
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Nov 2004 19:08:49 +0000 (GMT)
	(envelope-from cperciva@hexahedron.daemonology.net)
Received: from scan2.mail.ox.ac.uk ([163.1.2.162] helo=localhost)
	by tx2.mail.ox.ac.uk with esmtp (Exim 4.42)
	id 1CQVvc-0004pt-9J
	for FreeBSD-gnats-submit@freebsd.org; Sat, 06 Nov 2004 19:08:48 +0000
Received: from rx2.mail.ox.ac.uk ([163.1.2.161])
 by localhost (scan2.mail.ox.ac.uk [163.1.2.162]) (amavisd-new, port 25)
 with ESMTP id 18152-04 for <FreeBSD-gnats-submit@freebsd.org>;
 Sat,  6 Nov 2004 19:08:48 +0000 (GMT)
Received: from gateway.wadham.ox.ac.uk ([163.1.161.253])
	by rx2.mail.ox.ac.uk with smtp (Exim 4.42)
	id 1CQVvc-0004pq-8K
	for FreeBSD-gnats-submit@freebsd.org; Sat, 06 Nov 2004 19:08:48 +0000
Received: (qmail 4041 invoked by uid 1004); 6 Nov 2004 19:08:48 -0000
Received: from cperciva@hexahedron.daemonology.net by gateway by uid 71 with qmail-scanner-1.20 
 (clamscan: 0.67. sweep: 2.18/3.79.  Clear:RC:1(163.1.161.203):. 
 Processed in 0.536155 secs); 06 Nov 2004 19:08:48 -0000
Received: from dhcp1203.wadham.ox.ac.uk (HELO hexahedron.daemonology.net) (163.1.161.203)
  by gateway.wadham.ox.ac.uk with SMTP; 6 Nov 2004 19:08:47 -0000
Received: (qmail 25563 invoked by uid 1001); 6 Nov 2004 16:57:44 -0000
Message-Id: <20041106165744.25562.qmail@hexahedron.daemonology.net>
Date: 6 Nov 2004 16:57:44 -0000
From: Colin Percival <cperciva@daemonology.net>
Reply-To: Colin Percival <cperciva@daemonology.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [MAINTAINER UPDATE] sysutils/portsnap
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         73625
>Category:       ports
>Synopsis:       [MAINTAINER UPDATE] sysutils/portsnap
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 06 19:10:24 GMT 2004
>Closed-Date:    Sat Nov 06 19:49:51 GMT 2004
>Last-Modified:  Sat Nov 06 19:49:51 GMT 2004
>Originator:     Colin Percival
>Release:        FreeBSD 5.2.1-SECURITY i386
>Organization:
>Environment:
System: FreeBSD hexahedron.daemonology.net 5.2.1-SECURITY FreeBSD 5.2.1-SECURITY #0: Tue Sep 28 17:27:41 GMT 2004 root@builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

>Description:
>How-To-Repeat:
>Fix:

1. Fix the portsnap -> freebsd-sha1 dependency: It needs to be wrapped 
inside ${OSVERSION} logic, or the ports infrastructure will register a 
bogus dependency on recent systems. [1]
2. Remove the hardcoded /usr/local in both pkg-message and portsnap 
itself. [2]
3. Bump PORTREVISION.

Pointed out by:	xi and pav [1], lofi [2]

--- portsnap.diff begins here ---
--- ports/sysutils/portsnap/Makefile.orig	Sat Nov  6 16:17:54 2004
+++ ports/sysutils/portsnap/Makefile	Sat Nov  6 16:38:14 2004
@@ -7,23 +7,36 @@
 
 PORTNAME=	portsnap
 PORTVERSION=	0.2
+PORTREVISION=	1
 CATEGORIES=	sysutils net
 MASTER_SITES=	http://www.daemonology.net/portsnap/
 
 MAINTAINER=	cperciva@daemonology.net
 COMMENT=	Provides secure snapshots of the ports directory
 
-# The freebsd-sha1 port is marked IGNORE for some versions of FreeBSD,
-# but for those sha1 should be found in /sbin/, so this should be safe.
 RUN_DEPENDS=	bspatch:${PORTSDIR}/misc/bsdiff		\
-		sha1:${PORTSDIR}/sysutils/freebsd-sha1	\
 		freebsd-update-verify:${PORTSDIR}/security/freebsd-update
 
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 491101 || (${OSVERSION} > 499999 && ${OSVERSION} < 502114)
+RUN_DEPENDS+=	sha1:${PORTSDIR}/sysutils/freebsd-sha1
+.endif
+
 MAN5=		portsnap.conf.5
 MAN8=		portsnap.8
 PLIST_FILES=	etc/portsnap.conf.sample sbin/portsnap
 PLIST_DIRS=	portsnap
 
+PKGMESSAGE=	${WRKDIR}/pkg-message
+
+post-extract:
+	${SED} -e "s#PREFIX=/usr/local#PREFIX=${PREFIX}#g" \
+		${WRKSRC}/portsnap > ${WRKSRC}/portsnap.new
+	${MV} ${WRKSRC}/portsnap.new ${WRKSRC}/portsnap
+	@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${PKGDIR}/pkg-message \
+		> ${PKGMESSAGE}
+
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/portsnap ${PREFIX}/sbin
 	${INSTALL_MAN} ${WRKSRC}/portsnap.conf.5 ${PREFIX}/man/man5/
@@ -35,4 +48,4 @@
 post-install:
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--- ports/sysutils/portsnap/pkg-message.orig	Sat Nov  6 16:33:55 2004
+++ ports/sysutils/portsnap/pkg-message	Sat Nov  6 16:34:21 2004
@@ -5,11 +5,11 @@
 
 A sample configuration file has been installed in
 
-	/usr/local/etc/portsnap.conf.sample
+	%%PREFIX%%/etc/portsnap.conf.sample
 
 which will fetch snapshots built and signed by the author.  If you want to
 use these updates, copy that file to
 
-	/usr/local/etc/portsnap.conf
+	%%PREFIX%%/etc/portsnap.conf
 
 otherwise, create that file as appropriate.
--- portsnap.diff ends here ---
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Sat Nov 6 19:49:44 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73625 
>Unformatted:
