diff options
author | rillig <rillig> | 2007-01-03 21:09:55 +0000 |
---|---|---|
committer | rillig <rillig> | 2007-01-03 21:09:55 +0000 |
commit | 3bae31b99205cc1802bffab64f6f4c9de7acba63 (patch) | |
tree | c3796e24fb4027be64ba39ac1049df4df7ad0a93 /print/psutils/Makefile | |
parent | 5f3e616d848c35b7393b11613bbba1ae41b0e94a (diff) | |
download | pkgsrc-3bae31b99205cc1802bffab64f6f4c9de7acba63.tar.gz |
Shortened the Makefile a bit, cleaned up the code, removed unnecessary
code, made the PAPERSIZE check at load time, removed automatic stripping
of the binary files.
Diffstat (limited to 'print/psutils/Makefile')
-rw-r--r-- | print/psutils/Makefile | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/print/psutils/Makefile b/print/psutils/Makefile index c1132af73be..f543fe3b5f9 100644 --- a/print/psutils/Makefile +++ b/print/psutils/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2006/09/09 02:46:08 obache Exp $ +# $NetBSD: Makefile,v 1.36 2007/01/03 21:09:55 rillig Exp $ DISTNAME= psutils-p17 PKGNAME= psutils-1.17 @@ -14,45 +14,33 @@ WRKSRC= ${WRKDIR}/psutils USE_TOOLS+= perl:run .include "../../mk/bsd.prefs.mk" +BUILD_DEFS+= PAPERSIZE -PAPERSIZE?= A4 +.if !defined(PAPERSIZE) +PKG_FAIL_REASON+= "PAPERSIZE must be defined by the pkgsrc user." +.else +. if ${PAPERSIZE} != "A4" && ${PAPERSIZE} != "Letter" +PKG_FAIL_REASON+= "Invalid PAPERSIZE (${PAPERSIZE}). Choose one of A4 or Letter." +. endif +.endif MAKE_ENV+= PERL5=${PERL5:Q} MAKE_FLAGS+= PAPER=`${ECHO} ${PAPERSIZE} | ${TR} '[A-Z]' '[a-z]'` +MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}/man1 MAKE_FILE= Makefile.unix EGDIR= ${PREFIX}/share/examples/psutils CONF_FILES= ${EGDIR}/psutils.cfg ${PKG_SYSCONFDIR}/psutils.cfg -post-patch: - cd ${WRKSRC}; for file in psutil.c; do \ - ${MV} -f $$file $$file.in; \ - ${SED} -e "s|@prefix@|${PREFIX}|g" $$file.in > $$file; \ - done - -pre-configure: - @case "X${PAPERSIZE}" in \ - XA4|XLetter) \ - ;; \ - XA3|XA5|XB5|Xledger|Xstatement|Xexecutive|Xfolio|Xquarto|X10x14)\ - ${ECHO} "Other packages do not recognise ${PAPERSIZE}"; \ - ;; \ - *) \ - ${ECHO} "Error: PAPERSIZE invalid: \"${PAPERSIZE}\""; \ - ${ECHO} "Possible values are:"; \ - ${ECHO} " A3, A4 (default), A5, B5, Letter, Legal,"; \ - ${ECHO} " Ledger, Tabloid, Statement, Executive,"; \ - ${ECHO} " Folio, Quarto, and 10x14."; \ - ${FALSE}; \ - ;; \ - esac +SUBST_CLASSES+= psu +SUBST_STAGE.psu= pre-configure +SUBST_MESSAGE.psu= Adjusting the installation prefix. +SUBST_FILES.psu= psutil.c +SUBST_SED.psu= -e "s|@prefix@|${PREFIX}|g" post-install: - for f in epsffit psbook psnup psresize psselect pstops; do \ - strip ${PREFIX}/bin/$$f; \ - done ${INSTALL_DATA_DIR} ${EGDIR} - low=`${ECHO} ${PAPERSIZE} | ${TR} '[A-Z]' '[a-z]'`; \ - ${ECHO} "PAPERSIZE=$$low" > ${EGDIR}/psutils.cfg; + low=`${ECHO} ${PAPERSIZE} | ${TR} '[A-Z]' '[a-z]'` \ + && ${ECHO} "PAPERSIZE=$$low" > ${EGDIR}/psutils.cfg .include "../../mk/bsd.pkg.mk" |