# New ports collection makefile for:    hwpx installer
# Version required:     R4
# Date created:         Jul 16 1999
# Whom:                 CHOI Junho <cjh@kr.freebsd.org>
#
# $Id$
#

DISTNAME=	hwpx-4.0-3.i386
PKGNAME=	ko-hwpx-4.0.3
CATEGORIES=	korean print
EXTRACT_SUFX=   .rpm

MAINTAINER=	cjh@kr.freebsd.org

IGNOREFILES=    ${DISTFILES}
WRKSRC=         ${WRKDIR}
HWPDIR=         /usr/hwpx
DISTDIR=        ${MOUNT_PT}
MOUNT_PT?=      /cdrom
MOUNT_DEV?=     /dev/wcd0c
# in case of SCSI CD-ROM
#MOUNT_DEV?=     /dev/cd0c

# LIB_DEPENDS cannot catch linux library
BUILD_DEPENDS=  /compat/linux/lib/libc.so.6:${PORTSDIR}/emulators/linux_base \
		rpm:${PORTSDIR}/misc/rpm

ONLY_FOR_ARCHS=	i386

RESTRICTED=     "You should buy from MIZI Research Inc."
NO_CDROM=       "You should buy from MIZI Research Inc."
NO_PACKAGE=     "You should buy from MIZI Research Inc."
NO_BUILD=       YES
EXTRACT_ONLY=	
IS_INTERACTIVE= YES

do-fetch:
	@echo "Please mount HWPX-R4 CDROM in /cdrom"; \
	echo "You can do one of the following:"; \
	echo "  mount /cdrom"; \
	echo "  mount /dev/wcd0c /cdrom"; \
	echo "  mount /dev/scd0c /cdrom"; \
	echo "If you ready to go, please press Enter."; \
	echo -n "If not, please press CTRL-C here and mount, and run again"; \
	read yn

pre-install:
	# check if rpm is working properly
	@if [ ! -f /var/lib/rpm/packages.rpm ]; then \
	${MKDIR} /var/lib/rpm; \
	${PREFIX}/bin/rpm --initdb; \
	fi

do-install:
	@env DISTDIR=${DISTDIR} sh ${FILESDIR}/install-FreeBSD.noX

post-install:
	@/sbin/umount ${MOUNT_PT}
	@(cd ${HWPDIR}/bin; ${PATCH} < ${FILESDIR}/runarch.patch)
	-linux

.include <bsd.port.mk>
