diff options
author | sommerfeld <sommerfeld@pkgsrc.org> | 2003-04-22 02:30:47 +0000 |
---|---|---|
committer | sommerfeld <sommerfeld@pkgsrc.org> | 2003-04-22 02:30:47 +0000 |
commit | 71e7b57307266fc416102901e6a4318e0c81c864 (patch) | |
tree | 09e98c65346fba1ff886acb14f8622b401602eff /print/papersize | |
parent | 268ff03fe147af787c405f6941c358da50838bea (diff) | |
download | pkgsrc-71e7b57307266fc416102901e6a4318e0c81c864.tar.gz |
Convert to use ${FILES_SUBST_SED} instead of ad-hoc substitution.
Use @SH@ and friends so package works on solaris, too.
Bump version to 1.0.5
Diffstat (limited to 'print/papersize')
-rw-r--r-- | print/papersize/Makefile | 10 | ||||
-rw-r--r-- | print/papersize/files/getpapersize | 46 | ||||
-rw-r--r-- | print/papersize/files/setpapersize | 66 |
3 files changed, 61 insertions, 61 deletions
diff --git a/print/papersize/Makefile b/print/papersize/Makefile index 75fa9bc7796..87f11ab6384 100644 --- a/print/papersize/Makefile +++ b/print/papersize/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.10 2003/03/29 12:42:16 jmmv Exp $ +# $NetBSD: Makefile,v 1.11 2003/04/22 02:30:47 sommerfeld Exp $ # -DISTNAME= papersize-1.0.4 +DISTNAME= papersize-1.0.5 WRKSRC= ${WRKDIR} CATEGORIES= print MASTER_SITES= # empty @@ -13,11 +13,11 @@ COMMENT= Manipulate the default papersize in certain packages EXTRACT_ONLY= # empty NO_CHECKSUM= yes NO_CONFIGURE= yes +USE_PKGINSTALL= yes do-build: - for f in setpapersize getpapersize; do \ - ${SED} -e 's|@localbase@|${LOCALBASE}|g' \ - -e 's|@x11prefix@|${X11PREFIX}|g' \ + @for f in setpapersize getpapersize; do \ + ${SED} ${FILES_SUBST_SED} \ ${FILESDIR}/$$f > ${WRKSRC}/$$f; \ done diff --git a/print/papersize/files/getpapersize b/print/papersize/files/getpapersize index c07456f6bb5..bf4222fab8c 100644 --- a/print/papersize/files/getpapersize +++ b/print/papersize/files/getpapersize @@ -1,6 +1,6 @@ -#! /bin/sh +#!@SH@ # -# $NetBSD: getpapersize,v 1.5 2002/07/30 00:57:24 ross Exp $ +# $NetBSD: getpapersize,v 1.6 2003/04/22 02:30:48 sommerfeld Exp $ # # Small shell script to show the default papersize for packages # @@ -15,60 +15,60 @@ set $pkgs while [ $# -gt 0 ]; do case $1 in a2ps) - f=@localbase@/etc/a2ps-site.cfg + f=@LOCALBASE@/etc/a2ps-site.cfg if [ -e "$f" ]; then - echo -n "$1 has default papersize: " - awk '/^Options: --medium=/ { gsub(".*=", "", $0); print $0; }' $f + @ECHO@ -n "$1 has default papersize: " + @AWK@ '/^Options: --medium=/ { gsub(".*=", "", $0); print $0; }' $f fi ;; ddd) - f=@x11prefix@/lib/X11/app-defaults/Ddd + f=@X11BASE@/lib/X11/app-defaults/Ddd if [ -e "$f" ]; then - echo -n "$1 has default papersize: " - awk '/^@Ddd\*paperSize: / { gsub(".*:", "", $0); print $0; }' $f + @ECHO@ -n "$1 has default papersize: " + @AWK@ '/^@Ddd\*paperSize: / { gsub(".*:", "", $0); print $0; }' $f fi ;; enscript) - f=@localbase@/etc/enscript.cfg + f=@LOCALBASE@/etc/enscript.cfg if [ -e "$f" ]; then - echo -n "$1 has default papersize: " - awk '/^DefaultMedia:.*/ { gsub(".*:", "", $0); print $0; }' $f + @ECHO@ -n "$1 has default papersize: " + @AWK@ '/^DefaultMedia:.*/ { gsub(".*:", "", $0); print $0; }' $f fi ;; ghostscript) - f=`ls @localbase@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1` + f=`ls @LOCALBASE@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1` if [ -e "$f" ]; then - echo -n "$1 has default papersize: " - gssize=`sed -n -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^% Optionally.*\n[[:space:]]*(\(.*\)) \/PAPERSIZE where.*$/\1/p' $f` + @ECHO@ -n "$1 has default papersize: " + gssize=`@SED@ -n -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^% Optionally.*\n[[:space:]]*(\(.*\)) \/PAPERSIZE where.*$/\1/p' $f` if [ -z "$gssize" ] ; then - echo "(unknown)" + @ECHO@ "(unknown)" else - echo $gssize + @ECHO@ $gssize fi fi ;; magicfilter) - magicdir=@localbase@/libexec/magicfilter + magicdir=@LOCALBASE@/libexec/magicfilter if [ -e $magicdir ]; then done=0 for f in $magicdir/*-filter; do if [ $done -eq 0 ]; then - echo -n "$1 has default papersize: " - grep 'PAPERSIZE' $f | sed -e 's|\(.*\)-sPAPERSIZE=\([a-zA-Z0-9_]*\)\(.*\)|\2|' | tail -n 1 + @ECHO@ -n "$1 has default papersize: " + @GREP@ 'PAPERSIZE' $f | @SED@ -e 's|\(.*\)-sPAPERSIZE=\([a-zA-Z0-9_]*\)\(.*\)|\2|' | tail -n 1 done=1 fi done fi ;; psutils) - f=@localbase@/etc/psutils.cfg + f=@LOCALBASE@/etc/psutils.cfg if [ -e "$f" ]; then - echo -n "$1 has default papersize: " - awk '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f + @ECHO@ -n "$1 has default papersize: " + @AWK@ '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f fi ;; *) - echo "Warning: Package $1 not recognised" + @ECHO@ "Warning: Package $1 not recognised" ;; esac shift 1 diff --git a/print/papersize/files/setpapersize b/print/papersize/files/setpapersize index 053d3ed7b18..d42825cc089 100644 --- a/print/papersize/files/setpapersize +++ b/print/papersize/files/setpapersize @@ -1,13 +1,13 @@ -#! /bin/sh +#!@SH@ # -# $NetBSD: setpapersize,v 1.6 2002/07/30 00:57:24 ross Exp $ +# $NetBSD: setpapersize,v 1.7 2003/04/22 02:30:49 sommerfeld Exp $ # # Small shell script to set the default papersize for packages # # Make sure we've been given an argument if [ $# -lt 1 ]; then - echo "Usage: setpapersize papersize" + @ECHO@ "Usage: setpapersize papersize" exit 1 fi @@ -21,20 +21,20 @@ a4|A4) dimensions="210mm x 297mm" ;; letter|letterdj) - papersize=`echo $papersize|sed -e 's|^.|L|'` + papersize=`@ECHO@ $papersize|@SED@ -e 's|^.|L|'` dimensions='8.5" x 11"' ;; Letter|Letterdj) dimensions='8.5" x 11"' ;; *) - echo "Invalid paper size: $papersize" - echo "It should be one of: A4, Letter or Letterdj" + @ECHO@ "Invalid paper size: $papersize" + @ECHO@ "It should be one of: A4, Letter or Letterdj" exit 1 ;; esac -lowpaper=`echo $papersize | tr '[A-Z]' '[a-z]'` +lowpaper=`@ECHO@ $papersize | @TR@ '[A-Z]' '[a-z]'` if [ $# -eq 0 ]; then pkgs="a2ps ddd enscript ghostscript magicfilter psutils"; @@ -46,58 +46,58 @@ set $pkgs while [ $# -gt 0 ]; do case $1 in a2ps) - a2psfile=@localbase@/etc/a2ps-site.cfg + a2psfile=@LOCALBASE@/etc/a2ps-site.cfg if [ -e "$a2psfile" ]; then - mv $a2psfile $a2psfile.old - sed -e 's|^Options: --medium=.*|Options: --medium='$papersize'|' $a2psfile.old > $a2psfile && rm $a2psfile.old - echo "Set $1 package default paper size to $papersize in $a2psfile" + @MV@ $a2psfile $a2psfile.old + @SED@ -e 's|^Options: --medium=.*|Options: --medium='$papersize'|' $a2psfile.old > $a2psfile && @RM@ $a2psfile.old + @ECHO@ "Set $1 package default paper size to $papersize in $a2psfile" fi ;; ddd) - dddfile=@x11prefix@/lib/X11/app-defaults/Ddd + dddfile=@X11BASE@/lib/X11/app-defaults/Ddd if [ -e "$dddfile" ]; then - mv $dddfile $dddfile.old - sed -e 's|@Ddd@\*paperSize:.*|@Ddd@*paperSize: '$dimensions'|' $dddfile.old > $dddfile && rm $dddfile.old - echo "Set $1 package default paper size to $papersize in $dddfile" + @MV@ $dddfile $dddfile.old + @SED@ -e 's|@Ddd@\*paperSize:.*|@Ddd@*paperSize: '$dimensions'|' $dddfile.old > $dddfile && @RM@ $dddfile.old + @ECHO@ "Set $1 package default paper size to $papersize in $dddfile" fi ;; enscript) - enscriptfile=@localbase@/etc/enscript.cfg + enscriptfile=@LOCALBASE@/etc/enscript.cfg if [ -e "$enscriptfile" ]; then - mv $enscriptfile $enscriptfile.old - sed -e 's|^DefaultMedia:.*|DefaultMedia: '$papersize'|' $enscriptfile.old > $enscriptfile && rm $enscriptfile.old - echo "Set $1 package default paper size to $papersize in $enscriptfile" + @MV@ $enscriptfile $enscriptfile.old + @SED@ -e 's|^DefaultMedia:.*|DefaultMedia: '$papersize'|' $enscriptfile.old > $enscriptfile && @RM@ $enscriptfile.old + @ECHO@ "Set $1 package default paper size to $papersize in $enscriptfile" fi ;; ghostscript) - ghostscriptfile=`ls @localbase@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1` + ghostscriptfile=`ls @LOCALBASE@/share/ghostscript/*/lib/gs_init.ps 2>/dev/null | tail -1` if [ -e "$ghostscriptfile" ]; then - mv $ghostscriptfile $ghostscriptfile.old - sed -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^\(% Optionally.*\n\)[%[:space:]]*(.*\() \/PAPERSIZE where.*\)$/\1('$lowpaper'\2/' $ghostscriptfile.old > $ghostscriptfile && rm $ghostscriptfile.old - echo "Set $1 package default paper size to $papersize in $ghostscriptfile" + @MV@ $ghostscriptfile $ghostscriptfile.old + @SED@ -e '/^% Optionally choose a default paper size other than U.S. letter.$/N' -e 's/^\(% Optionally.*\n\)[%[:space:]]*(.*\() \/PAPERSIZE where.*\)$/\1('$lowpaper'\2/' $ghostscriptfile.old > $ghostscriptfile && @RM@ $ghostscriptfile.old + @ECHO@ "Set $1 package default paper size to $papersize in $ghostscriptfile" fi ;; magicfilter) - magicdir=@localbase@/libexec/magicfilter + magicdir=@LOCALBASE@/libexec/magicfilter if [ -e "$magicdir" ]; then for f in $magicdir/*-filter; do - mv $f $f.old - sed -e 's|-sPAPERSIZE=[a-zA-Z0-9_]*|-sPAPERSIZE='$lowpaper'|' $f.old > $f && rm $f.old - chmod 555 $f + @MV@ $f $f.old + @SED@ -e 's|-sPAPERSIZE=[a-zA-Z0-9_]*|-sPAPERSIZE='$lowpaper'|' $f.old > $f && @RM@ $f.old + @CHMOD@ 555 $f done - echo "Set $1 package default paper size to $papersize in $magicdir/*-filter" + @ECHO@ "Set $1 package default paper size to $papersize in $magicdir/*-filter" fi ;; psutils) - psutilsfile=@localbase@/etc/psutils.cfg + psutilsfile=@LOCALBASE@/etc/psutils.cfg if [ -e "$psutilsfile" ]; then - mv $psutilsfile $psutilsfile.old - sed -e 's|^PAPERSIZE.*|PAPERSIZE='$lowpaper'|' $psutilsfile.old > $psutilsfile && rm $psutilsfile.old - echo "Set $1 package default paper size to $papersize in $psutilsfile" + @MV@ $psutilsfile $psutilsfile.old + @SED@ -e 's|^PAPERSIZE.*|PAPERSIZE='$lowpaper'|' $psutilsfile.old > $psutilsfile && @RM@ $psutilsfile.old + @ECHO@ "Set $1 package default paper size to $papersize in $psutilsfile" fi ;; *) - echo "Warning: Package $1 not recognised" + @ECHO@ "Warning: Package $1 not recognised" ;; esac shift 1 |