Bug 55005 - fix patch error in ports/chinese/telnet
Summary: fix patch error in ports/chinese/telnet
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Yen-Ming Lee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-29 09:40 UTC by Liu Kang
Modified: 2003-07-30 11:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liu Kang 2003-07-29 09:40:09 UTC
ports/chinese/telnet is marked as broken(Fails to patch) now.
It is because the path of telnet's sourcecode is different in 5.1-current 
and 4.x-stable
The old ports is made for 4.x-stable, so it can not be compiled on 
5.1-current.

Fix: I've test this patch on both 5.1-current and 4.8-stable



PORTNAME=	telnet
PORTVERSION=	1.0
+PORTREVISION= 	1
CATEGORIES=	chinese
MASTER_SITES=	# none
DISTFILES=	# none
@@ -14,31 +15,54 @@
MAINTAINER=	leeym@FreeBSD.org
COMMENT=	8bit compatible telnet client for Chinese input

-BROKEN=		"Fails to patch"
-
-SRCDIR=		/usr/src/usr.bin/telnet
+SRCDIR=		/usr/src/contrib/telnet/telnet
USE_REINPLACE=	yes

MAN1=		zh-telnet.1

+.include <bsd.port.pre.mk>
+.if  ${OSVERSION} < 500000
+SRCDIR=/usr/src/usr.bin/telnet
+.endif
+
do-extract:
.if exists (${SRCDIR})
	@${MKDIR} ${WRKDIR}
	@${CP} -R ${SRCDIR} ${WRKSRC}
+.if ${OSVERSION} < 500000
	@${MKDIR} ${WRKSRC}/lib
-	@${CP} -R /usr/src/lib/libtelnet ${WRKSRC}/lib
+	@${CP} -R ${SRCDIR}/../../lib/libtelnet ${WRKSRC}/lib
+.else
+	@${CP} -R ${SRCDIR}/../libtelnet ${WRKSRC}
+	@${CP} ${SRCDIR}/../arpa/telnet.h ${WRKSRC}/libtelnet
+	@${CP} -R ${SRCDIR}/../../../usr.bin/telnet/Makefile ${WRKSRC}
+	@${CP} -R ${SRCDIR}/../../../lib/libtelnet/Makefile ${WRKSRC}/libtelnet
+.endif
.else
IGNORE=	"You need to build this port with ${SRCDIR}"
.endif

pre-patch:
+.if  ${OSVERSION} < 500000
	@${REINPLACE_CMD} -e 's,/../..,,g' ${WRKSRC}/Makefile
+.else
+	@${REINPLACE_CMD} -e 's,/../../contrib/telnet,,g' 
${WRKSRC}/libtelnet/Makefile
+	@${REINPLACE_CMD} -e 's,../../lib/,,g' ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's,/../../contrib/telnet,,g' ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's,${TELNETDIR}/telnet,${TELNETDIR},g' 
${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's,/arpa,,g' ${WRKSRC}/libtelnet/Makefile
+.endif
+

pre-build:
+.if  ${OSVERSION} < 500000
	@cd ${WRKSRC}/lib/libtelnet && ${MAKE}
+.else
+	@cd ${WRKSRC}/libtelnet && ${MAKE}
+.endif

do-install:
	@${INSTALL_PROGRAM} ${WRKSRC}/telnet ${PREFIX}/bin/zh-telnet
	@${INSTALL_MAN} ${WRKSRC}/telnet.1 ${PREFIX}/man/man1/${MAN1}

-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail--UTbezlKlr24QAGwXOvGPGSX0ew5pLZ1Mr5DF705BJWzk766c
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- Makefile.orig	Tue Jul 29 16:15:37 2003
+++ Makefile	Tue Jul 29 16:15:40 2003
@@ -7,6 +7,7 @@
How-To-Repeat: just run make in ports/chinese/telnet
Comment 1 Kirill Ponomarev freebsd_committer 2003-07-29 09:49:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->leeym

Over to maintainer.
Comment 2 Yen-Ming Lee freebsd_committer 2003-07-30 11:16:05 UTC
State Changed
From-To: open->closed

Committed, thanks.