From 024dc1c99fd1b8a11e9de90f68357d6e97ced877 Mon Sep 17 00:00:00 2001
From: Joseph Koshy <jkoshy@FreeBSD.org>
Date: Tue, 24 Aug 2004 03:01:01 +0000
Subject: Unbreak port by merging the build and install phases.  Create a PLIST
 dynamically so that pkg_delete works.  Make the Makefile and pkg-descr
 portlint clean.

---
 misc/tet/Makefile  | 39 ++++++++++++++++++++++-----------------
 misc/tet/pkg-descr |  1 -
 2 files changed, 22 insertions(+), 18 deletions(-)

(limited to 'misc/tet')

diff --git a/misc/tet/Makefile b/misc/tet/Makefile
index fe4bbab586b6..902f59664d14 100644
--- a/misc/tet/Makefile
+++ b/misc/tet/Makefile
@@ -11,22 +11,21 @@ CATEGORIES=		misc
 MASTER_SITES=		ftp://ftp.rdg.opengroup.org/pub/TET/TET3/ \
 			${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	jkoshy
-DISTFILES=		${PORTNAME}${PORTVERSION}-unsup.src.tgz
+DISTNAME=		${PORTNAME}${PORTVERSION}-unsup.src
+EXTRACT_SUFX=		.tgz
 
 MAINTAINER=		jkoshy@freebsd.org
 COMMENT=		An test execution framework from the Open Group
-BROKEN=			"Installs/removes files outside of the install/deinstall phases"
 
 NO_WRKSUBDIR=		yes
 NO_PACKAGE=		TET_ROOT needs to be set at compile time
 HAS_CONFIGURE=		yes
 CONFIGURE_ARGS=		-t ${TET_CONFIG_TARGET}
+NO_BUILD=		yes
+PLIST=			${WRKDIR}/PLIST
 
 TET_CONFIG_TARGET?=	inet	# options are `lite', `xti' and `inet'
 
-do-build:
-	cd ${WRKDIR}/src && ${MAKE} ${ALL_TARGET}
-
 pre-extract:
 .if !defined(TET_ROOT)
 	@${ECHO_MSG}
@@ -39,21 +38,27 @@ pre-extract:
 	@${TRUE}
 .endif
 
-# remove the TET_ROOT directory if it exists
-pre-clean:
-.if defined(TET_ROOT)
-	${RM} -rf ${TET_ROOT}
-.endif
-	${RM} -rf ${WRKDIR}
-
-# move the work directory to $TET_ROOT after extraction
-post-extract:
+# fix permissions
+pre-configure:
 	${CHMOD} +x ${WRKDIR}/configure
+
+# move the work directory to $TET_ROOT after extraction, and build
+# TET inside of $TET_ROOT
+pre-install:
 	${MKDIR} ${TET_ROOT}
-	cd ${WRKDIR} && tar cf - . | (cd ${TET_ROOT} && tar xf -)
-	${RM} -rf ${WRKDIR} && ${LN} -s ${TET_ROOT} ${WRKDIR}
+	cd ${WRKDIR} && ${TAR} -cf - * | \
+		(cd ${TET_ROOT} && ${TAR} xf -)
+	cd ${TET_ROOT}/src && ${MAKE} ${ALL_TARGET}
+	cd ${TET_ROOT}/src && ${MAKE} ${INSTALL_TARGET}
+	${ECHO} "@cwd ${TET_ROOT}" > ${PLIST}
+	cd ${TET_ROOT} && ${FIND} . ! -type d | \
+		${SED} -e 's,^\./,,' >> ${PLIST}
+	cd ${TET_ROOT} && ${FIND} -d . -type d -print | ${SORT} -ru | \
+		${SED} -e 's,^\./,,' -e '/^\.$$/d' -e 's/^/@dirrm /' \
+		>> ${PLIST}
+	${ECHO} "@unexec ${RMDIR} ${TET_ROOT}" >> ${PLIST}
 
 do-install:
-	cd ${WRKDIR}/src && ${MAKE} ${INSTALL_TARGET}
+	@${TRUE}
 
 .include	<bsd.port.mk>
diff --git a/misc/tet/pkg-descr b/misc/tet/pkg-descr
index d464c1fb4eb3..e5906101480d 100644
--- a/misc/tet/pkg-descr
+++ b/misc/tet/pkg-descr
@@ -17,4 +17,3 @@ It allows facilities to execute test cases in several ways:
 	  times or until some time period has expired.
 
 WWW: 	http://tetworks.opengroup.org/documents/docs33.html
-
-- 
cgit v1.2.3