diff options
author | wiz <wiz@pkgsrc.org> | 2002-07-05 23:24:19 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2002-07-05 23:24:19 +0000 |
commit | 48ef548441d151e3ebb73a518300621eff16fb06 (patch) | |
tree | b9a0871da55f877bbe634e39d5fa9c7aabae75d8 /print | |
parent | bd743f295c17100d0450ff01f0d33f3b08aee75d (diff) | |
download | pkgsrc-48ef548441d151e3ebb73a518300621eff16fb06.tar.gz |
1.0.3: Add support for ghostscript, from Jeremy C. Reed in pkg/17488.
Diffstat (limited to 'print')
-rw-r--r-- | print/papersize/Makefile | 4 | ||||
-rw-r--r-- | print/papersize/files/getpapersize | 16 | ||||
-rw-r--r-- | print/papersize/files/getpapersize.1 | 6 | ||||
-rw-r--r-- | print/papersize/files/setpapersize | 12 | ||||
-rw-r--r-- | print/papersize/files/setpapersize.1 | 6 |
5 files changed, 32 insertions, 12 deletions
diff --git a/print/papersize/Makefile b/print/papersize/Makefile index 22ceeb51908..2805fd8ba0d 100644 --- a/print/papersize/Makefile +++ b/print/papersize/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.6 2001/09/09 20:36:45 agc Exp $ +# $NetBSD: Makefile,v 1.7 2002/07/05 23:24:19 wiz Exp $ # -DISTNAME= papersize-1.0.2 +DISTNAME= papersize-1.0.3 CATEGORIES= print MASTER_SITES= # empty DISTFILES= # empty diff --git a/print/papersize/files/getpapersize b/print/papersize/files/getpapersize index 3b94eb60b83..67cf19cf246 100644 --- a/print/papersize/files/getpapersize +++ b/print/papersize/files/getpapersize @@ -1,12 +1,12 @@ #! /bin/sh # -# $NetBSD: getpapersize,v 1.3 2000/07/11 10:06:41 agc Exp $ +# $NetBSD: getpapersize,v 1.4 2002/07/05 23:24:20 wiz Exp $ # # Small shell script to show the default papersize for packages # if [ $# -eq 0 ]; then - pkgs="a2ps ddd enscript magicfilter psutils"; + pkgs="a2ps ddd enscript ghostscript magicfilter psutils"; else pkgs=$@ fi @@ -35,6 +35,18 @@ while [ $# -gt 0 ]; do awk '/^DefaultMedia:.*/ { gsub(".*:", "", $0); print $0; }' $f fi ;; + ghostscript) + 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` + if [ -z "$gssize" ] ; then + echo "(unknown)" + else + echo $gssize + fi + fi + ;; magicfilter) magicdir=@localbase@/libexec/magicfilter if [ -e $magicdir ]; then diff --git a/print/papersize/files/getpapersize.1 b/print/papersize/files/getpapersize.1 index 16b7617cda3..ec6896c4432 100644 --- a/print/papersize/files/getpapersize.1 +++ b/print/papersize/files/getpapersize.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: getpapersize.1,v 1.2 2001/12/03 19:03:24 wiz Exp $ +.\" $NetBSD: getpapersize.1,v 1.3 2002/07/05 23:24:20 wiz Exp $ .Dd November 9, 1998 .Dt GETPAPERSIZE 1 .Os @@ -12,8 +12,8 @@ The .Nm utility shows the default paper size for a number of packages. -At the present time, these are the a2ps, ddd, enscript, magicfilter -and psutils packages. +At the present time, these are the a2ps, ddd, enscript, ghostscript, +magicfilter, and psutils packages. If no package argument is given, all packages are assumed. The .Xr setpapersize 1 diff --git a/print/papersize/files/setpapersize b/print/papersize/files/setpapersize index 751d16aa26e..010484c27e1 100644 --- a/print/papersize/files/setpapersize +++ b/print/papersize/files/setpapersize @@ -1,6 +1,6 @@ #! /bin/sh # -# $NetBSD: setpapersize,v 1.4 2000/07/11 10:06:41 agc Exp $ +# $NetBSD: setpapersize,v 1.5 2002/07/05 23:24:20 wiz Exp $ # # Small shell script to set the default papersize for packages # @@ -37,7 +37,7 @@ esac lowpaper=`echo $papersize | tr '[A-Z]' '[a-z]'` if [ $# -eq 0 ]; then - pkgs="a2ps ddd enscript magicfilter psutils"; + pkgs="a2ps ddd enscript ghostscript magicfilter psutils"; else pkgs=$@ fi @@ -69,6 +69,14 @@ while [ $# -gt 0 ]; do 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` + 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" + fi + ;; magicfilter) magicdir=@localbase@/libexec/magicfilter if [ -e $magicdir ]; then diff --git a/print/papersize/files/setpapersize.1 b/print/papersize/files/setpapersize.1 index b04961593d6..5066c566c38 100644 --- a/print/papersize/files/setpapersize.1 +++ b/print/papersize/files/setpapersize.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: setpapersize.1,v 1.2 2001/12/03 19:03:24 wiz Exp $ +.\" $NetBSD: setpapersize.1,v 1.3 2002/07/05 23:24:20 wiz Exp $ .Dd November 9, 1998 .Dt SETPAPERSIZE 1 .Os @@ -13,8 +13,8 @@ PAPERSIZE The .Nm utility sets the default paper size for a number of packages. -At the present time, these are the a2ps, ddd, enscript, magicfilter -and psutils packages. +At the present time, these are the a2ps, ddd, enscript, ghostscript, +magicfilter and psutils packages. If no package argument is given, all packages are assumed. The .Ar PAPERSIZE |