summaryrefslogtreecommitdiff
path: root/print/magicfilter
diff options
context:
space:
mode:
authorrillig <rillig>2006-08-31 08:22:38 +0000
committerrillig <rillig>2006-08-31 08:22:38 +0000
commita474651809052d357eb2fee2e4a98dadc2636853 (patch)
tree1e74e2a2b72393e08bd6c8f603d9391b6211ab09 /print/magicfilter
parent679172fe5ef6637e5b462cfefb3868f2a240a43a (diff)
downloadpkgsrc-a474651809052d357eb2fee2e4a98dadc2636853.tar.gz
Added PAPERSIZE to BUILD_DEFS. Separated the code that installs the
printer filters from the one that adds them to the PLIST. Converted the sed(1) command to use the SUBST framework, so that the proper install(1) commands are used for installing the files.
Diffstat (limited to 'print/magicfilter')
-rw-r--r--print/magicfilter/Makefile42
1 files changed, 25 insertions, 17 deletions
diff --git a/print/magicfilter/Makefile b/print/magicfilter/Makefile
index e61cfd77bc8..966bb46ca33 100644
--- a/print/magicfilter/Makefile
+++ b/print/magicfilter/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2006/08/10 03:21:40 minskim Exp $
+# $NetBSD: Makefile,v 1.50 2006/08/31 08:22:38 rillig Exp $
DISTNAME= magicfilter-1.2
PKGREVISION= 5
@@ -20,29 +20,37 @@ CONFIGURE_ENV+= GHOSTSCRIPT=${TOOLS_PATH.gs}
CONFIGURE_ENV+= GZIP=${TOOLS_GZIP_CMD:Q}
TEX_ACCEPTED= teTeX3
-PLIST_SRC= ${WRKDIR}/PLIST
-
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}/'
+
+INSTALLATION_DIRS+= ${FILTER_DIR}
+
+GENERATE_PLIST+= \
+ (cd ${WRKSRC}/filters; \
+ for f in *-filter; do \
+ ${ECHO} ${FILTER_DIR}/"$$f"; \
+ done; \
+ ${ECHO} "@dirrm ${FILTER_DIR}");
post-install:
- @${CP} ${PKGDIR}/PLIST ${PLIST_SRC}
- @${INSTALL_DATA_DIR} ${PREFIX}/${FILTER_DIR}
- @(cd ${WRKSRC}/filters; \
- paper=`${ECHO} ${PAPERSIZE} | ${TR} '[A-Z]' '[a-z]'`; \
- for FILTER in *-filter; do \
- TARGET=${PREFIX}/${FILTER_DIR}/$$FILTER; \
- ${ECHO} "Installing $$FILTER as $$TARGET"; \
- ${SED} 's/-sOutputFile=-/-sOutputFile=- -sPAPERSIZE='$$paper'/' \
- <$$FILTER >${PREFIX}/${FILTER_DIR}/$$FILTER; \
- ${CHOWN} ${BINOWN}:${BINGRP} $$TARGET; \
- ${CHMOD} ${BINMODE} $$TARGET; \
- ${ECHO} ${FILTER_DIR}/$$FILTER >>${PLIST_SRC}; \
- done)
- @${ECHO} "@dirrm ${FILTER_DIR}" >>${PLIST_SRC}
+ set -e; \
+ cd ${WRKSRC}/filters; \
+ for f in *-filter; do \
+ ${ECHO} "Installing $$f as ${PREFIX}/${FILTER_DIR}/$$f"; \
+ ${INSTALL_SCRIPT} "$$f" ${PREFIX}/${FILTER_DIR}/"$$f"; \
+ done
.include "../../mk/tex.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"