[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / print / magicfilter

File: [cvs.NetBSD.org] / pkgsrc / print / magicfilter / Makefile (download)

Revision 1.57, Fri Feb 12 00:18:29 2010 UTC (14 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1
Changes since 1.56: +8 -4 lines

DESTDIR support

# $NetBSD: Makefile,v 1.57 2010/02/12 00:18:29 joerg Exp $

DISTNAME=	magicfilter-1.2
PKGREVISION=	7
CATEGORIES=	print
MASTER_SITES=	${MASTER_SITE_SUNSITE:=system/printing/}

MAINTAINER=	pkgsrc-users@NetBSD.org
COMMENT=	Customizable, extensible automatic printer filter
LICENSE=	gnu-gpl-v2

PKG_DESTDIR_SUPPORT=	user-destdir

# Any version will do:
#
DEPENDS+=	a2ps-[0-9]*:../../print/a2ps
DEPENDS+=	netpbm-[0-9]*:../../graphics/netpbm
DEPENDS+=	papersize-[0-9]*:../../print/papersize
DEPENDS+=	dvipsk-[0-9]*:../../print/dvipsk

USE_TOOLS+=	gmake gs:run gzip
GNU_CONFIGURE=	yes
CONFIGURE_ENV+=	GHOSTSCRIPT=${TOOLS_PATH.gs}
CONFIGURE_ENV+= GZIP=${TOOLS_GZIP_CMD:Q}

FILTER_DIR=	libexec/magicfilter

.include "../../mk/bsd.prefs.mk"

BUILD_DEFS+=	PAPERSIZE
PAPERSIZE?=	A4
LOWER_PAPERSIZE_cmd=	${ECHO} ${PAPERSIZE} | ${TR} "[A-Z]" "[a-z]"
LOWER_PAPERSIZE=	${LOWER_PAPERSIZE_cmd:sh}

SUBST_CLASSES+=		mf
SUBST_STAGE.mf=		post-build
SUBST_MESSAGE.mf=	Adjusting paper size in filters.
SUBST_FILES.mf=		filters/*-filter
SUBST_SED.mf=		-e 's/-sOutputFile=-/& -sPAPERSIZE=${LOWER_PAPERSIZE:Q:Q}/'

SUBST_CLASSES+=		gs
SUBST_STAGE.gs=		post-configure
SUBST_MESSAGE.gs=	Adjusting ghostscript temporary directory.
SUBST_FILES.gs=		filters/filters2.h
SUBST_SED.gs=		-e 's,${PREFIX}/bin/gs,${SETENV} TEMP=$${TMPDIR:-/tmp} &,'

INSTALLATION_DIRS+=	bin ${FILTER_DIR} ${PKGMANDIR}/man8

GENERATE_PLIST+= \
	cd ${WRKSRC}/filters &&						\
	for f in *-filter; do						\
	  ${ECHO} ${FILTER_DIR}/"$$f";					\
	done;

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/magicfilter ${DESTDIR}${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/magicfilter.man ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/magicfilter.8
	set -e;								\
	cd ${WRKSRC}/filters;						\
	for f in *-filter; do						\
	  ${ECHO} "Installing $$f as ${DESTDIR}${PREFIX}/${FILTER_DIR}/$$f";	\
	  ${INSTALL_SCRIPT} "$$f" ${DESTDIR}${PREFIX}/${FILTER_DIR}/"$$f";	\
	done

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