# New ports collection makefile for:    ports-common
# Date created:                         2010-10-22
# Whom:                                 Parallels
# OS Version:                           6.1
#
# $FreeBSD: ports/swsoft/ports-common/Makefile 20090108000000 2010/10/22 04:08:25 Parallels Exp $
#

PORTNAME= ports-common
PORTVERSION= 1.2.0
PORTREVISION= 295357

CATEGORIES= swsoft
MASTER_SITES?= http://autoinstall.plesk.com/PSA_9.5.3/dist-pkg-FreeBSD-6.1-i386/distfiles/

MAINTAINER= info@parallels.com
COMMENT= Common things for all projects of Parallels

PORTEPOCH= 1
EXTRACT_SUFX= .tar.gz

BUILD_DEPENDS+=	/usr/share/mk/plesk.depends.mk:${PORTSDIR}/swsoft/ports-core

RUN_DEPENDS+=	perl5.8.8:${PORTSDIR}/lang/perl5.8
RUN_DEPENDS+=	${LOCALBASE}/sbin/portupgrade:${PORTSDIR}/ports-mgmt/portupgrade
RUN_DEPENDS+=	${LOCALBASE}/etc/rc.d/bsdstats.sh:${PORTSDIR}/sysutils/bsdstats

CONFLICTS= ports-core-1.0.[0-1]*

VALID_CATEGORIES+= swsoft

PREFIX= /usr

pre-extract:
. for i in ${CONFLICTS}
	@pkg_delete -f ${i:S/*/\\*/} 2>/dev/null || true
. endfor

pre-fetch:
	@file=$$(${MD5} ${DISTDIR}/${DISTFILES} | ${AWK} -F '=' '{print $$2}') && \
	sum=$$(${CAT} ${MD5_FILE} | ${GREP} ${DISTFILES} | ${AWK} -F '=' '{print $$2}') && \
	if [ "X$$sum" != "X$$file" ]; then \
		${ECHO} "${DISTFILES} was to be refetch"; \
		${RM} -f ${DISTDIR}/${DISTFILES}; \
	fi

do-build:

do-install:
	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
	@${CP} -Rf ${WRKSRC}/* ${PREFIX}
	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.mk>
