summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Nelson <jnelson@gentoo.org>2002-04-28 18:40:09 +0000
committerJon Nelson <jnelson@gentoo.org>2002-04-28 18:40:09 +0000
commit4cf890cb8f8cc1531681d92a8cf5f4ac1e4113c6 (patch)
treee944aa8f6670fa6b9a3efd4064e28bbca3d8b881 /app-text/ghostscript
parentnew version (diff)
downloadgentoo-2-4cf890cb8f8cc1531681d92a8cf5f4ac1e4113c6.tar.gz
gentoo-2-4cf890cb8f8cc1531681d92a8cf5f4ac1e4113c6.tar.bz2
gentoo-2-4cf890cb8f8cc1531681d92a8cf5f4ac1e4113c6.zip
fix bug 2010, remove dependency on static zlib and libpng, patch ghostscript with a few additional patches, and update to gimp-print 4.2.1
Diffstat (limited to 'app-text/ghostscript')
-rw-r--r--app-text/ghostscript/ChangeLog12
-rw-r--r--app-text/ghostscript/files/digest-ghostscript-6.53-r24
-rw-r--r--app-text/ghostscript/files/ghostscript-6.53-hpdj_margins.patch16
-rw-r--r--app-text/ghostscript/files/ghostscript-6.53-missquotes.patch90
-rw-r--r--app-text/ghostscript/files/ghostscript-6.53-r2-gimpprint-gentoo.diff12
-rw-r--r--app-text/ghostscript/files/ghostscript-6.53-setuid.patch82
-rw-r--r--app-text/ghostscript/ghostscript-6.53-r2.ebuild125
7 files changed, 340 insertions, 1 deletions
diff --git a/app-text/ghostscript/ChangeLog b/app-text/ghostscript/ChangeLog
index c164b6501012..4a3821858e4f 100644
--- a/app-text/ghostscript/ChangeLog
+++ b/app-text/ghostscript/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for app-text/ghostscript
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ChangeLog,v 1.5 2002/04/04 06:37:10 spider Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ChangeLog,v 1.6 2002/04/28 18:40:09 jnelson Exp $
+
+*ghostscript-6.53-r2 (28 Apr 2002)
+ 28 Apr 2002; Jon Nelson <jnelson@gentoo.org>: ghostscript-6.53-r2.ebuild
+
+ Remove dependency on downloading zlib and png - use shared versions!
+ (Can't do that for libjpeg - see ghostscript docs)
+ Update to gimp-print 4.2.1
+ Use shared zlib and libpng
+ Patch ghostscript with a few additional patches
+ Closes #2010
*ghostscript-6.53 (04 Apr 2002)
04 Apr 2002 Spider <spider@gentoo.org>
diff --git a/app-text/ghostscript/files/digest-ghostscript-6.53-r2 b/app-text/ghostscript/files/digest-ghostscript-6.53-r2
new file mode 100644
index 000000000000..1541c6b91453
--- /dev/null
+++ b/app-text/ghostscript/files/digest-ghostscript-6.53-r2
@@ -0,0 +1,4 @@
+MD5 fc61954bddd6252f992b8bc1f4cc8761 ghostscript-6.53.tar.bz2 3899811
+MD5 8250132d6fcc6eb1419f505f06c7690b ghostscript-fonts-std-6.0.tar.gz 1881034
+MD5 62f59f0bf0b4d2843cc9953f3b4f894f gimp-print-4.2.1.tar.gz 4691313
+MD5 dbd5f3b47ed13132f04c685d608a7547 jpegsrc.v6b.tar.gz 613261
diff --git a/app-text/ghostscript/files/ghostscript-6.53-hpdj_margins.patch b/app-text/ghostscript/files/ghostscript-6.53-hpdj_margins.patch
new file mode 100644
index 000000000000..81f75b08a258
--- /dev/null
+++ b/app-text/ghostscript/files/ghostscript-6.53-hpdj_margins.patch
@@ -0,0 +1,16 @@
+diff -ur ghostscript-6.53.orig/src/gdevijs.c ghostscript-6.53/src/gdevijs.c
+--- ghostscript-6.53.orig/src/gdevijs.c 2002-04-28 13:10:09.000000000 -0500
++++ ghostscript-6.53/src/gdevijs.c 2002-04-28 13:10:46.000000000 -0500
+@@ -401,10 +401,10 @@
+
+ if (code == 0) {
+ m[0] = printable_left;
+- m[1] = printable_top;
++ m[3] = printable_top;
+ m[2] = ijsdev->MediaSize[0] * (1.0 / 72) -
+ printable_left - printable_width;
+- m[3] = ijsdev->MediaSize[1] * (1.0 / 72) -
++ m[1] = ijsdev->MediaSize[1] * (1.0 / 72) -
+ printable_top - printable_height;
+ gx_device_set_margins((gx_device *)ijsdev, m, true);
+ sprintf (buf, "%gx%g", printable_left, printable_top);
diff --git a/app-text/ghostscript/files/ghostscript-6.53-missquotes.patch b/app-text/ghostscript/files/ghostscript-6.53-missquotes.patch
new file mode 100644
index 000000000000..9370f85ba998
--- /dev/null
+++ b/app-text/ghostscript/files/ghostscript-6.53-missquotes.patch
@@ -0,0 +1,90 @@
+diff -Nur gs7.00.orig/lib/dvipdf gs7.00/lib/dvipdf
+--- gs7.00.orig/lib/dvipdf Thu Mar 9 09:40:39 2000
++++ gs7.00/lib/dvipdf Sun Apr 15 23:31:36 2001
+@@ -22,7 +22,7 @@
+ exit 1
+ fi
+
+-infile=$1;
++infile="$1";
+
+ if [ $# -eq 1 ]
+ then
+@@ -33,7 +33,7 @@
+ esac
+ outfile="${base}.pdf"
+ else
+- outfile=$2
++ outfile="$2"
+ fi
+
+ # Doing an initial 'save' helps keep fonts from being flushed between pages.
+diff -Nur gs7.00.orig/lib/pdf2dsc gs7.00/lib/pdf2dsc
+--- gs7.00.orig/lib/pdf2dsc Fri Dec 29 06:03:49 2000
++++ gs7.00/lib/pdf2dsc Sun Apr 15 23:32:43 2001
+@@ -20,7 +20,7 @@
+
+ pdffile=$1
+ dscfile=$2
+-: ${dscfile:=`echo $pdffile | sed 's,\.[^/.]*,,'`.dsc}
++: ${dscfile:=`echo "$pdffile" | sed 's,\.[^/.]*,,'`.dsc}
+
+ exec gs -q -dNODISPLAY -dSAFER -dDELAYSAFER\
+ -sPDFname="$pdffile" -sDSCname="$dscfile" pdf2dsc.ps -c quit
+diff -Nur gs7.00.orig/lib/pdf2ps gs7.00/lib/pdf2ps
+--- gs7.00.orig/lib/pdf2ps Fri May 19 08:38:25 2000
++++ gs7.00/lib/pdf2ps Sun Apr 15 23:33:20 2001
+@@ -14,7 +14,7 @@
+
+ if [ $# -eq 2 ]
+ then
+- outfile=$2
++ outfile="$2"
+ elif [ $# -eq 1 ]
+ then
+ outfile=`basename "$1" \.pdf`.ps
+diff -Nur gs7.00.orig/lib/pfbtopfa gs7.00/lib/pfbtopfa
+--- gs7.00.orig/lib/pfbtopfa Wed Apr 12 19:41:41 2000
++++ gs7.00/lib/pfbtopfa Sun Apr 15 23:33:52 2001
+@@ -4,7 +4,7 @@
+
+ if [ $# -eq 2 ]
+ then
+- outfile=$2
++ outfile="$2"
+ elif [ $# -eq 1 ]
+ then
+ outfile=`basename "$1" \.pfb`.pfa
+diff -Nur gs7.00.orig/lib/ps2epsi gs7.00/lib/ps2epsi
+--- gs7.00.orig/lib/ps2epsi Wed Apr 4 23:05:00 2001
++++ gs7.00/lib/ps2epsi Sun Apr 15 23:36:15 2001
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # $Id: ghostscript-6.53-missquotes.patch,v 1.1 2002/04/28 18:40:09 jnelson Exp $
+
+-tmpfile=/tmp/ps2epsi$$
++tmpfile=`mktemp /tmp/$0.XXXXXX` || exit 1
+
+ export outfile
+
+@@ -10,7 +10,7 @@
+ exit 1
+ fi
+
+-infile=$1;
++infile="$1";
+
+ if [ $# -eq 1 ]
+ then
+@@ -22,9 +22,9 @@
+ *.epsf) base=`basename "${infile}" .epsf` ;;
+ *) base=`basename "${infile}"` ;;
+ esac
+- outfile=${base}.epsi
++ outfile="${base}.epsi"
+ else
+- outfile=$2
++ outfile="$2"
+ fi
+
+ ls -l "${infile}" |
diff --git a/app-text/ghostscript/files/ghostscript-6.53-r2-gimpprint-gentoo.diff b/app-text/ghostscript/files/ghostscript-6.53-r2-gimpprint-gentoo.diff
new file mode 100644
index 000000000000..b99f38d13c8b
--- /dev/null
+++ b/app-text/ghostscript/files/ghostscript-6.53-r2-gimpprint-gentoo.diff
@@ -0,0 +1,12 @@
+--- ghostscript-6.53/src/unixlink.mak_orig 2002-03-07 13:40:11.000000000 +0100
++++ ghostscript-6.53/src/unixlink.mak 2002-03-07 13:40:22.000000000 +0100
+@@ -67,6 +67,9 @@
+ $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(LDFLAGS) -o $(GS_XE)
+ $(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gs.$(OBJ) -s
+ cat $(ld_tr) >>$(ldt_tr)
++ cp $(ldt_tr) $(ldt_tr)_orig
++ sed -e "s#-lXt#-L${BUILD_PREFIX}/ghostscript-6.53-r2/work/gimp-print-4.2.1/src/main/.libs/ -lgimpprint -lXt#g" \
++ $(ldt_tr)_orig > $(ldt_tr)
+ $(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
+ if [ x$(XLIBDIR) != x ]; then LD_RUN_PATH=$(XLIBDIR); export LD_RUN_PATH; fi; \
+ XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
diff --git a/app-text/ghostscript/files/ghostscript-6.53-setuid.patch b/app-text/ghostscript/files/ghostscript-6.53-setuid.patch
new file mode 100644
index 000000000000..09afeee093dd
--- /dev/null
+++ b/app-text/ghostscript/files/ghostscript-6.53-setuid.patch
@@ -0,0 +1,82 @@
+--- gs/src/imainarg.c.orig Mon Dec 6 08:11:52 1999
++++ gs/src/imainarg.c Thu Mar 30 23:01:34 2000
+@@ -48,6 +48,18 @@
+ #include "iutil.h"
+ #include "ivmspace.h"
+
++/* Change by Torsten Landschoff <torsten@debian.org>:
++ * We need to store the original rights when run with setuid so we can
++ * regain privileges when opening the vga library for instance.
++ * -- Thu, 30 Mar 2000 22:47:22 +0200 */
++
++#include <unistd.h>
++
++uid_t privileged_uid;
++gid_t privileged_gid;
++
++/* --- end change --- */
++
+ /* Import operator procedures */
+ extern int zflush(P1(i_ctx_t *));
+ extern int zflushpage(P1(i_ctx_t *));
+@@ -127,6 +139,20 @@
+ arg_list args;
+ FILE *stdfiles[3];
+ int code;
++
++ /* Change by Torsten Landschoff <torsten@debian.org>:
++ * We want to give up privileges as soon as possible when running suid.
++ * Right, you would not want to run a piece of software as complex as
++ * Ghostscript with setuid but you need to if you want to use the
++ * svgalib as ordinary user.
++ * -- Thu, 30 Mar 2000 22:46:19 +0200 */
++
++ /* save privileges */
++ privileged_uid = geteuid(); privileged_gid = getegid();
++ /* give up privileges */
++ seteuid( getuid() ); setegid( getgid() );
++
++ /* --- end change --- */
+
+ gs_get_real_stdio(stdfiles);
+ arg_init(&args, (const char **)argv, argc,
+--- gs/src/gdevl256.c.orig Mon Jan 11 07:38:07 1999
++++ gs/src/gdevl256.c Thu Mar 30 23:03:57 2000
+@@ -38,6 +38,17 @@
+ #include <vga.h>
+ #include <vgagl.h>
+
++/* Change by Torsten Landschoff <torsten@debian.org>:
++ * I changed imainarg.c to drop privileges as soon as possible when
++ * running setuid. We need to get back elevated rights when we want
++ * to open the vga library. Declare the two variables from imainarg.c
++ * holding the privileges and include unistd.h for user management.
++ * -- Thu, 30 Mar 2000 22:59:53 +0200 */
++
++#include <unistd.h>
++extern uid_t privileged_uid;
++extern gid_t privileged_gid;
++
+ /* The color map for dynamically assignable colors. */
+ #define first_dc_index 64
+ private int next_dc_index;
+@@ -107,7 +118,19 @@
+ int vgamode;
+ int width, height;
+
++ /* Change by Torsten Landschoff <torsten@debian.org>:
++ * We need to restore the privileges we gave up in imainarg.c to open
++ * the vga device.
++ * -- Thu, 30 Mar 2000 23:03:12 +0200 */
++
++ /* re-obtain privileges */
++ seteuid( privileged_uid ); setegid( privileged_gid );
+ vga_init();
++ /* give away privileges */
++ seteuid( getuid() ); setegid( getgid() );
++
++ /* --- end change --- */
++
+ vgamode = vga_getdefaultmode();
+ if (vgamode == -1)
+ vgamode = G320x200x256;
diff --git a/app-text/ghostscript/ghostscript-6.53-r2.ebuild b/app-text/ghostscript/ghostscript-6.53-r2.ebuild
new file mode 100644
index 000000000000..33ece56d9fcd
--- /dev/null
+++ b/app-text/ghostscript/ghostscript-6.53-r2.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Maintainer: Achim Gottinger <achim@gentoo.org>, Daniel Robbins <drobbins@gentoo.org>, Geert Bevin <gbevin@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ghostscript-6.53-r2.ebuild,v 1.1 2002/04/28 18:40:09 jnelson Exp $
+
+GPV="4.2.1"
+
+JPEG=jpegsrc.v6b.tar.gz
+S=${WORKDIR}/${P}
+DESCRIPTION="GNU Ghostscript"
+SRC_URI="http://download.sourceforge.net/ghostscript/${P}.tar.bz2
+ http://download.sourceforge.net/gs-fonts/ghostscript-fonts-std-6.0.tar.gz
+ http://download.sourceforge.net/gimp-print/gimp-print-${GPV}.tar.gz
+ ftp://ftp.uu.net/graphics/jpeg/${JPEG}"
+
+# NOTES:
+# Why aren't we using configure (for ghostscript)?
+
+# When I run configure (for gimp-print), there are some questions:
+#
+# Which of the following do we want to say 'yes'?
+# checking whether to build CUPS driver... no
+# checking whether to build translated CUPS PPD files... yes
+# checking whether to use level 3 PostScript... no
+# checking whether to build ghostscript driver... no
+# checking whether to build foomatic data files... no
+# checking whether to build GIMP plugin... no
+#
+# and no?
+# checking whether to build escputil... yes
+# checking whether to build libgimpprint... yes
+
+DEPEND="virtual/glibc
+ virtual/x11
+ sys-libs/zlib
+ media-libs/libpng
+ media-libs/jpeg"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+
+ unpack ${A}
+
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${P}-gdi-gentoo.diff || die
+ patch -p1 < ${FILESDIR}/${P}-r2-gimpprint-gentoo.diff || die
+ cp ${FILESDIR}/gdevgdi.c ${S}/src || die
+
+ # additional patches taken from the PLD SRPM
+ # fix some shellscripts to wrap their filename arguments in double-quotes
+ patch -p1 < ${FILESDIR}/${P}-missquotes.patch || die
+ # when using svga output, save and restore the uid because
+ # ghostscript needs to be setuid. This make gs only be suid
+ # only as long as necessary.
+ patch -p1 < ${FILESDIR}/${P}-setuid.patch || die
+
+ # a patch right from HP to fix some margin issues with deskjets
+ patch -p1 < ${FILESDIR}/${P}-hpdj_margins.patch || die
+
+ local tmpdir=${JPEG/src.v/-}
+ tmpdir=${tmpdir/.tar.gz/}
+ mv ${WORKDIR}/${tmpdir} ${S}/jpeg || die
+
+# tmpdir=${ZLIB/.tar.bz2/}
+# mv ${WORKDIR}/${tmpdir} ${S}/zlib || die
+
+# tmpdir=${LIBPNG/.tar.bz2/}
+# mv ${WORKDIR}/${tmpdir} ${S}/libpng || die
+
+ cd ${WORKDIR}/gimp-print-${GPV}
+ ./configure --without-gimp --enable-static --disable-shared || die
+ cd ${WORKDIR}/gimp-print-${GPV}/src/ghost
+ cp *.c ${S}/src || die
+ cd ${WORKDIR}/gimp-print-${GPV}/include/gimp-print
+ mkdir ${S}/src/gimp-print
+ cp *.h ${S}/src/gimp-print || die
+ cat contrib.mak.addon >> ${S}/src/contrib.mak
+
+ cd ${S}/src
+ cp unix-gcc.mak unix-gcc.mak.orig
+ sed -e "s:^DEVICE_DEVS6=:DEVICE_DEVS6=\$\(DD\)stp\.dev :" \
+ -e "s:SHARE_LIBPNG=0:SHARE_LIBPNG=1:" \
+ -e "s:SHARE_ZLIB=0:SHARE_ZLIB=1:" \
+ -e "s:CFLAGS_STANDARD=-O2:CFLAGS_STANDARD=${CFLAGS}:" \
+ -e "s:XLIBDIRS=-L/usr/X11/lib:XLIBDIRS=-L/usr/X11R6/lib:" \
+ -e "s:XLIBS=Xt Xext X11:XLIBS=Xt SM ICE Xext X11:" \
+ unix-gcc.mak.orig > unix-gcc.mak
+}
+
+src_compile() {
+
+ cd ${WORKDIR}/gimp-print-${GPV}
+ emake || die
+
+ cd ${S}
+ ln -sf src/unix-gcc.mak Makefile
+ emake prefix=/usr || die
+}
+
+src_install() {
+
+ dodir /usr/{bin,share/man/man1}
+ make prefix=${D}/usr \
+ mandir=${D}/usr/share/man \
+ install || die
+
+ mv ${D}/usr/bin/gs ${D}/usr/bin/gs-${PV}
+ dosym /usr/bin/gs-${PV} /usr/bin/gs
+
+ cd ${WORKDIR}
+ cp -a fonts ${D}/usr/share/ghostscript
+ cd ${S}
+
+ dodir /usr/share/doc/${PF}
+ rm -rf ${D}/usr/share/ghostscript/${PV}/doc
+ dodoc doc/README doc/PUBLIC doc/COPYING*
+ dohtml doc/*
+ insinto /usr/share/emacs/site-lisp
+ doins doc/gsdoc.el
+
+ cd ${WORKDIR}/gimp-print-${GPV}
+ dobin src/escputil/escputil
+ docinto stp
+ dodoc README* COPYING ChangeLog
+}