# Created by: Andreas Dobloug <andreasd@@ifi.uio.no>
# $FreeBSD: branches/RELENG_9_2_0/sysutils/mgeupsd/Makefile 319252 2013-05-27 15:09:38Z bsam $

PORTNAME=		mgeupsd
PORTVERSION=		0.3
PORTREVISION=	1
CATEGORIES=		sysutils
MASTER_SITES=		${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR=	system/ups

MAINTAINER=		ports@FreeBSD.org
COMMENT=	Monitor a state of MGE Pulsar UPS connected to RS-232 port

USE_GMAKE=		YES
WRKSRC=			${WRKDIR}/MGE

PLIST_FILES=		sbin/mgeupsd sbin/powerhandler etc/rc.d/mgeupsd.sh
MAN8=			mgeupsd.8
SUB_FILES=		pkg-message

post-patch:
		@${REINPLACE_CMD} -e '/^CC=/s:gcc:${CC}:' \
			-e '/^CFLAGS=/s:-Wall -O2:${CFLAGS}:' ${WRKSRC}/Makefile

post-install:
		${INSTALL_SCRIPT} ${FILESDIR}/mgeupsd.sh ${PREFIX}/etc/rc.d
		${INSTALL_SCRIPT} ${FILESDIR}/powerhandler ${PREFIX}/sbin
		@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>
