summaryrefslogtreecommitdiff
path: root/sysutils/mgm/Makefile
blob: d6484c381f2f0bce6e7d71ba55e005b3350ea934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# $NetBSD: Makefile,v 1.9 2005/07/16 01:19:20 jlam Exp $

DISTNAME=	mgm-1.1
CATEGORIES=	sysutils
MASTER_SITES=	http://www.xiph.org/mgm/
EXTRACT_SUFX=	.tgz

MAINTAINER=	tech-pkg@NetBSD.org
HOMEPAGE=	http://www.xiph.org/mgm/
COMMENT=	Moaning Goat Meter

DEPENDS+=	p5-Tk-[0-9]*:../../x11/p5-Tk

WRKSRC=		${WRKDIR}/${DISTNAME:C/-.*$//}
NO_BUILD=	# defined
USE_TOOLS+=	perl:run
PERL_SCRIPTS=	mgm

MGM_PERL_DIR=	${PREFIX}/lib/${DISTNAME:C/-.*$//}
MGM_DOC_DIR=	${PREFIX}/share/doc/html/${DISTNAME:C/-.*$//}

INSTALLATION_DIRS=	bin

post-patch:
	${SED} -e 's|@@MGM_PERL_DIR@@|${MGM_PERL_DIR}|' \
		${FILESDIR}/mgm.sh > ${WRKDIR}/mgm.sh
	cd ${WRKSRC}; \
	for FILE in ${PERL_SCRIPTS}; do \
		${CP} $$FILE $${FILE}.orig; \
		${SED} -e 's#/usr/bin/perl#${PERL5}#g' \
			<$${FILE}.orig >$$FILE; \
	done

do-install:
	${INSTALL_DATA_DIR} ${MGM_PERL_DIR} ${MGM_PERL_DIR}/modules
	${INSTALL_SCRIPT} ${WRKSRC}/mgm ${MGM_PERL_DIR}
	cd ${WRKSRC}; \
	for DIR in lib modules/*; do \
		${INSTALL_DATA_DIR} ${MGM_PERL_DIR}/$$DIR; \
		for FILE in $$DIR/*; do \
			${INSTALL_DATA} $$FILE ${MGM_PERL_DIR}/$$DIR; \
		done; \
	done
	${INSTALL_DATA_DIR} ${MGM_DOC_DIR}
	for FILE in ${WRKSRC}/doc/*; do \
		${INSTALL_DATA} $$FILE ${MGM_DOC_DIR}; \
	done
	${INSTALL_SCRIPT} ${WRKDIR}/mgm.sh ${PREFIX}/bin/mgm

.include "../../mk/bsd.pkg.mk"