pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/print/psutils Shortened the Makefile a bit, cleaned up...
details: https://anonhg.NetBSD.org/pkgsrc/rev/8848bb977a31
branches: trunk
changeset: 523226:8848bb977a31
user: rillig <rillig%pkgsrc.org@localhost>
date: Wed Jan 03 21:09:55 2007 +0000
description:
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:
print/psutils/Makefile | 46 +++++++++++++++++-----------------------------
1 files changed, 17 insertions(+), 29 deletions(-)
diffs (71 lines):
diff -r 8600ffd36f40 -r 8848bb977a31 print/psutils/Makefile
--- a/print/psutils/Makefile Wed Jan 03 20:48:41 2007 +0000
+++ b/print/psutils/Makefile Wed Jan 03 21:09:55 2007 +0000
@@ -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 @@
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"
Home |
Main Index |
Thread Index |
Old Index