new package for netpbm
authorMike Frysinger <vapier@gentoo.org>
Tue, 27 Sep 2005 00:19:32 +0000 (00:19 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 27 Sep 2005 00:19:32 +0000 (00:19 +0000)
Package-Manager: portage-2.0.52-r1 http://www.bash.org/?136501

media-libs/urt/ChangeLog [new file with mode: 0644]
media-libs/urt/Manifest
media-libs/urt/files/digest-urt-3.1b [new file with mode: 0644]
media-libs/urt/files/gentoo-config [new file with mode: 0644]
media-libs/urt/files/urt-3.1b-compile-updates.patch [new file with mode: 0644]
media-libs/urt/files/urt-3.1b-rle-fixes.patch [new file with mode: 0644]
media-libs/urt/files/urt-3.1b-tempfile.patch [new file with mode: 0644]
media-libs/urt/metadata.xml [new file with mode: 0644]
media-libs/urt/urt-3.1b.ebuild [new file with mode: 0644]

diff --git a/media-libs/urt/ChangeLog b/media-libs/urt/ChangeLog
new file mode 100644 (file)
index 0000000..ab6e5b1
--- /dev/null
@@ -0,0 +1,8 @@
+# ChangeLog for media-libs/urt
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/urt/ChangeLog,v 1.1 2005/09/27 00:19:32 vapier Exp $
+
+*urt-3.1b (26 Sep 2005)
+
+  26 Sep 2005; Mike Frysinger <vapier@gentoo.org> :
+  Initial import.  Ebuild submitted by me.
index fed6a3d02efda809d64de7bf132397d5e2203517..0eb1171ae1483866031cb0f7d53b1ba438b832b9 100644 (file)
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
 MD5 d8c1ee6d286417164c8239d45c00b0b1 urt-3.1b.ebuild 1515
 MD5 5fc54c5d01402d0610fafa96961bb8e0 metadata.xml 161
 MD5 1bbb9456f0a9a6f14ce02a4348b7091b ChangeLog 321
@@ -6,3 +9,10 @@ MD5 17ad983b2b258ee3e633108e342276c1 files/urt-3.1b-rle-fixes.patch 5072
 MD5 3f2cd2217e501f325bdc547781337c5c files/urt-3.1b-compile-updates.patch 3397
 MD5 5cf67043e6b90e68277ec2c02066556f files/gentoo-config 670
 MD5 6f003bc3da29163d55742e87559a3a87 files/digest-urt-3.1b 60
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDOJBKgIKl8Uu19MoRAvCEAJ9HkxHPY1kzfVQ3zaLk8ccOlsTTjQCdEmgr
+8Z/v2y9uea/4pSFHyBFNhq8=
+=maK1
+-----END PGP SIGNATURE-----
diff --git a/media-libs/urt/files/digest-urt-3.1b b/media-libs/urt/files/digest-urt-3.1b
new file mode 100644 (file)
index 0000000..fe0ff33
--- /dev/null
@@ -0,0 +1 @@
+MD5 c9a377284d00c102c1a8af53d95a6b39 urt-3.1b.tar.Z 1016405
diff --git a/media-libs/urt/files/gentoo-config b/media-libs/urt/files/gentoo-config
new file mode 100644 (file)
index 0000000..1680f11
--- /dev/null
@@ -0,0 +1,43 @@
+#define ABEKASA60
+#define ABEKASA62
+#define ALIAS
+##define CGM
+#define CUBICOMP
+##define DVIRLE
+#define GRAYFILES
+#define MACPAINT
+##define PBMPLUS
+##define SUNRASTER
+#define TARGA
+#define VICAR
+#define WASATCH
+#define WAVEFRONT
+
+#define GCC
+
+#define CONST_DECL
+#define NO_MAKE_MAKEFILE
+#define USE_TIME_H
+#define SYS_V_SETPGRP
+#define USE_PROTOTYPES
+#define USE_RANDOM
+#define USE_STDARG
+#define USE_STDLIB_H
+#define USE_UNISTD_H
+#define USE_STRING_H
+#define VOID_STAR
+#define USE_XLIBINT_H
+#define X_SHARED_MEMORY
+
+#defpath DEST bin
+#defpath RI include
+#defpath RL lib
+
+ROFF = nroff
+ROFFOPT = -man
+ROFFPIPE = | lpr
+
+INCTIFF = 
+LIBTIFF = -ltiff
+INCX11 =
+LIBX11 = -lX11
diff --git a/media-libs/urt/files/urt-3.1b-compile-updates.patch b/media-libs/urt/files/urt-3.1b-compile-updates.patch
new file mode 100644 (file)
index 0000000..105f7c4
--- /dev/null
@@ -0,0 +1,141 @@
+--- get/getx11/XGetHClrs.c
++++ get/getx11/XGetHClrs.c
+@@ -1,5 +1,4 @@
+ #ifndef XLIBINT_H_NOT_AVAILABLE
+-#include <X11/copyright.h>
+ 
+ /* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
+ /* Copyright    Massachusetts Institute of Technology    1986 */
+--- tools/mallocNd.c
++++ tools/mallocNd.c
+@@ -67,7 +67,7 @@
+ 
+ /* Imports */
+ #include <stdio.h>
+-extern char *malloc();
++#include <string.h>
+ 
+ /* Forward declarations */
+ char *BuildIndirectionTable();
+--- tools/into.c
++++ tools/into.c
+@@ -40,8 +40,8 @@
+ static char buf[MAXPATHLEN+1];
+ short forceflg;                               /* overwrite an unwritable file? */
+ 
+-extern int errno;
+-extern char *sys_errlist[];
++#include <errno.h>
++#include <string.h>
+ 
+ void
+ main(argc, argv)
+@@ -103,7 +103,7 @@
+     if (ferror(outf))
+     {
+       fprintf(stderr, "into: %s, \"%s\" not modified\n",
+-          sys_errlist[errno], argv[1]);
++          strerror(errno), argv[1]);
+       unlink(buf);
+       exit(1);
+     }
+--- cnv/tex/dvirle2.c
++++ cnv/tex/dvirle2.c
+@@ -55,7 +55,6 @@
+ void DumpTopOfBand(), MoveDown(), WriteBuf(), WriteBlanks();
+ 
+ char  *ProgName;
+-extern int errno;
+ extern char *optarg;
+ extern int optind;
+ 
+--- cnv/wasatchrle.c
++++ cnv/wasatchrle.c
+@@ -32,7 +32,6 @@
+ #include <errno.h>
+ #include "rle.h"
+ 
+-extern int errno;
+ 
+ /* "short" in our world is 16 bits.  Beware of swyte-bopping. */
+ 
+--- get/getx11/x11_stuff.c
++++ get/getx11/x11_stuff.c
+@@ -155,7 +155,6 @@
+                       IPC_CREAT|0777 );
+           if ( img->shm_img.shmid < 0 )
+           {
+-              extern int errno;
+               if ( errno == ENOSPC )
+               {
+                   if ( !no_shared_space )
+@@ -361,7 +360,6 @@ Boolean reallocate;
+           XDestroyImage( image );
+           if ( img->shm_pix.shmid < 0 )
+           {
+-              extern int errno;
+               if ( errno == ENOSPC )
+               {
+                   if ( !no_shared_space )
+--- get/qcr/qcr.h
++++ get/qcr/qcr.h
+@@ -6,8 +6,6 @@
+ #define GREEN 1
+ #define BLUE 2
+ 
+-extern int errno;
+-
+ /* Command defs for QCR-Z Film Recorder */
+ 
+ /* These are for 8 bit Look Up Tables */
+--- get/gettaac.c
++++ get/gettaac.c
+@@ -24,6 +24,7 @@
+  * Send bug fixes and improvements to:  ksp@maxwell.nde.swri.edu
+  */
+ 
++#include <errno.h>
+ #include <stdio.h>
+ #include <strings.h>
+ #include <signal.h>
+@@ -459,7 +460,6 @@ char    *template;
+      char    nonUnique;
+      char    twiddleUserCompletion;
+ 
+-     extern  int         errno;
+      struct  direct     *nameEntry;
+      DIR                *dirChan;
+      struct  passwd     *pwdEntry;
+--- tools/clock/rleClock.c
++++ tools/clock/rleClock.c
+@@ -598,7 +598,7 @@
+     { TRUE,  "-tf", STRING, "Text area format string",                  (char *)&FormatString }, 
+     { FALSE, "-Xm", BOOL,   "Output the alpha channel on RGB",    (char *)&DebugAlpha },
+     { FALSE, "-D",  BOOL,   "Turn on debugging",                (char *)&Debug },
+-    NULL
++    { FALSE, NULL }
+ };
+ 
+ void
+--- tools/to8.c
++++ tools/to8.c
+@@ -175,7 +175,7 @@
+        * Give it a background color of black, since the real background
+        * will be dithered anyway.
+        */
+-      if ( in_hdr.background != NULL )
++      if ( in_hdr.background != 0 )
+       {
+           out_hdr.bg_color = (int *)malloc( sizeof( int ) );
+           RLE_CHECK_ALLOC( cmd_name( argv ), out_hdr.bg_color, 0 );
+--- cnv/rletoabA62/rletoabA62.c
++++ cnv/rletoabA62/rletoabA62.c
+@@ -157,7 +157,7 @@
+       exit(1);
+     }
+     if (optind < argc) {
+-      if ((file = open(argv[optind], 0)) == NULL) {
++      if ((file = open(argv[optind], 0)) == -1) {
+           perror(argv[optind]);
+           exit(1);
+       }
diff --git a/media-libs/urt/files/urt-3.1b-rle-fixes.patch b/media-libs/urt/files/urt-3.1b-rle-fixes.patch
new file mode 100644 (file)
index 0000000..3720806
--- /dev/null
@@ -0,0 +1,203 @@
+Fixes taken from netpbm
+
+--- lib/rle_global.c
++++ lib/rle_global.c
+@@ -76,7 +76,7 @@ rle_hdr rle_dflt_hdr = {
+     8,                                /* cmaplen (log2 of length of color map) */
+     NULL,                     /* pointer to color map */
+     NULL,                     /* pointer to comment strings */
+-    stdout,                   /* output file */
++    NULL,                     /* output file -- must be set dynamically */
+     { 7 },                    /* RGB channels only */
+     0L,                               /* Can't free name and file fields. */
+     "Urt",                    /* Default "program name". */
+--- lib/rle_hdr.c
++++ lib/rle_hdr.c
+@@ -269,6 +273,9 @@
+ {
+     rle_hdr *ret_hdr;
+ 
++    rle_dflt_hdr.rle_file = stdout;
++    /* The rest of rle_dflt_hdr is set by the loader's data initialization */
++
+     if ( the_hdr == &rle_dflt_hdr )
+       return the_hdr;
+ 
+--- lib/dither.c
++++ lib/dither.c
+@@ -38,10 +38,10 @@ void       make_square();
+ #endif
+ 
+ static int magic4x4[4][4] =  {
+-       0, 14,  3, 13,
+-      11,  5,  8,  6,
+-      12,  2, 15,  1,
+-       7,  9,  4, 10
++{      0, 14,  3, 13},
++{     11,  5,  8,  6},
++{     12,  2, 15,  1},
++{      7,  9,  4, 10}
+ };
+ 
+ /* basic dithering macro */
+--- lib/rle_open_f.c
++++ lib/rle_open_f.c
+@@ -9,7 +9,11 @@
+  */
+ 
+ #include "rle_config.h"
++#define _XOPEN_SOURCE  /* Make sure fdopen() is in stdio.h */
++
+ #include <stdio.h>
++#include <unistd.h>
++#include <fcntl.h>
+ 
+ #ifndef NO_OPEN_PIPES
+ /* Need to have a SIGCLD signal catcher. */
+@@ -260,7 +260,6 @@
+     int pipefd[2];
+     int i;
+     char *argv[4];
+-    extern int errno;
+ 
+     /* Check args. */
+     if ( *mode != 'r' && *mode != 'w' )
+--- lib/rle_getcom.c
++++ lib/rle_getcom.c
+@@ -53,11 +53,12 @@
+ {
+     for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
+       ;
+-    if (*n == '\0' || *n == '=')
++    if (*n == '\0' || *n == '=') {
+       if ( *v == '\0' )
+           return v;
+       else if ( *v == '=' )
+           return ++v;
++    }
+ 
+     return NULL;
+ }
+--- lib/scanargs.c
++++ lib/scanargs.c
+@@ -128,10 +130,10 @@
+ va_list argl;
+ {
+ 
+-    register    check;                        /* check counter to be sure all argvs
++    int    check;                     /* check counter to be sure all argvs
+                                          are processed */
+     register CONST_DECL char  *cp;
+-    register    cnt;
++    int    cnt;
+     int           optarg = 0;                 /* where optional args start */
+     int           nopt = 0;
+     char    tmpflg,                   /* temp flag */
+@@ -375,11 +377,12 @@
+                               if ( optarg > 0 ) /* end optional args? */
+                               {
+                                   /* Eat the arg, too, if necessary */
+-                                  if ( list_cnt == 0 )
++                                  if ( list_cnt == 0 ) {
+                                       if ( typchr == 's' )
+                                           (void)va_arg( argl, char * );
+                                       else
+                                           (void)va_arg( argl, ptr );
++                    }
+                                   break;
+                               }
+                               else
+@@ -567,7 +570,7 @@
+                                    * Do conversion for n and N types
+                                    */
+                                   tmpflg = typchr;
+-                                  if (typchr == 'n' || typchr == 'N' )
++                                  if (typchr == 'n' || typchr == 'N' ) {
+                                       if (*argp != '0')
+                                           tmpflg = 'd';
+                                       else if (*(argp+1) == 'x' ||
+@@ -578,6 +581,7 @@
+                                       }
+                                       else
+                                           tmpflg = 'o';
++                    }
+                                   if (typchr == 'N')
+                                       tmpflg = toupper( tmpflg );
+ 
+--- lib/inv_cmap.c
++++ lib/inv_cmap.c
+@@ -42,7 +42,7 @@
+ static long cbinc, cginc, crinc;
+ static unsigned long *gdp, *rdp, *cdp;
+ static unsigned char *grgbp, *rrgbp, *crgbp;
+-static gstride, rstride;
++static long gstride, rstride;
+ static long x, xsqr, colormax;
+ static int cindex;
+ #ifdef INSTRUMENT_IT
+--- lib/rle_getrow.c
++++ lib/rle_getrow.c
+@@ -351,7 +351,7 @@
+           bzero( (char *)scanline[-1] + the_hdr->xmin,
+                  the_hdr->xmax - the_hdr->xmin + 1 );
+       for ( nc = 0; nc < the_hdr->ncolors; nc++ )
+-          if ( RLE_BIT( *the_hdr, nc ) )
++          if ( RLE_BIT( *the_hdr, nc ) ) {
+               /* Unless bg color given explicitly, use 0. */
+               if ( the_hdr->background != 2 || the_hdr->bg_color[nc] == 0 )
+                   bzero( (char *)scanline[nc] + the_hdr->xmin,
+@@ -360,6 +360,7 @@
+                   bfill( (char *)scanline[nc] + the_hdr->xmin,
+                          the_hdr->xmax - the_hdr->xmin + 1,
+                          the_hdr->bg_color[nc] );
++          }
+     }
+ 
+     /* If skipping, then just return */
+@@ -367,7 +368,7 @@
+     {
+       the_hdr->priv.get.vert_skip--;
+       the_hdr->priv.get.scan_y++;
+-      if ( the_hdr->priv.get.vert_skip > 0 )
++      if ( the_hdr->priv.get.vert_skip > 0 ) {
+           if ( the_hdr->priv.get.scan_y >= the_hdr->ymax )
+           {
+               int y = the_hdr->priv.get.scan_y;
+@@ -377,6 +378,7 @@
+           }
+           else
+               return the_hdr->priv.get.scan_y;
++      }
+     }
+ 
+     /* If EOF has been encountered, return also */
+@@ -457,11 +459,12 @@
+           else
+               nc = DATUM(inst);
+           nc++;
+-          if ( debug_f )
++          if ( debug_f ) {
+               if ( RLE_BIT( *the_hdr, channel ) )
+                   fprintf( stderr, "Pixel data %d (to %d):", nc, scan_x+nc );
+               else
+                   fprintf( stderr, "Pixel data %d (to %d)\n", nc, scan_x+nc);
++          }
+           if ( RLE_BIT( *the_hdr, channel ) )
+           {
+               /* Don't fill past end of scanline! */
+--- lib/rle_putcom.c
++++ lib/rle_putcom.c
+@@ -53,11 +53,12 @@
+ {
+     for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
+       ;
+-    if (*n == '\0' || *n == '=')
++    if (*n == '\0' || *n == '=') {
+       if ( *v == '\0' )
+           return v;
+       else if ( *v == '=' )
+           return ++v;
++    }
+ 
+     return NULL;
+ }
diff --git a/media-libs/urt/files/urt-3.1b-tempfile.patch b/media-libs/urt/files/urt-3.1b-tempfile.patch
new file mode 100644 (file)
index 0000000..12acce1
--- /dev/null
@@ -0,0 +1,19 @@
+--- tools/rlecat.c
++++ tools/rlecat.c
+@@ -110,8 +110,14 @@
+           nflag = 0;          /* Not really repeating! */
+       else
+       {
+-          mktemp( temp );     /* Make a temporary file name */
+-          tmpfile = rle_open_f( cmd_name( argv ), temp, "w+" );
++          /* we dont have to use rle_open_f() because all it does in
++           * this case is run fopen() ... we're creating a file so all
++           * the checks for opening an existing file aren't needed */
++          int fd = mkstemp(temp);
++          if (fd == -1 || (tmpfile = fdopen(fd, "w+")) == NULL) {
++              perror("Unable to open tempfile");
++              exit(-1);
++          }
+       }
+     }
+ 
diff --git a/media-libs/urt/metadata.xml b/media-libs/urt/metadata.xml
new file mode 100644 (file)
index 0000000..e770d1b
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>graphics</herd>
+</pkgmetadata>
diff --git a/media-libs/urt/urt-3.1b.ebuild b/media-libs/urt/urt-3.1b.ebuild
new file mode 100644 (file)
index 0000000..19e3d73
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/urt/urt-3.1b.ebuild,v 1.1 2005/09/27 00:19:32 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="the Utah Raster Toolkit is a library for dealing with raster images"
+HOMEPAGE="http://www.cs.utah.edu/gdc/projects/urt/"
+SRC_URI="ftp://ftp.iastate.edu/pub/utah-raster/${P}.tar.Z"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="gif gs tiff X"
+
+DEPEND="X? ( virtual/x11 )
+       gif? ( media-libs/giflib )
+       tiff? ( media-libs/tiff )
+       gs? ( app-text/ghostscript )"
+
+S=${WORKDIR}
+
+urt_config() {
+       use $1 && echo "#define $2" || echo "##define $2"
+}
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+       rm bin/README
+
+       epatch "${FILESDIR}"/${P}-rle-fixes.patch
+       epatch "${FILESDIR}"/${P}-compile-updates.patch
+       epatch "${FILESDIR}"/${P}-tempfile.patch
+
+       sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
+       cp "${FILESDIR}"/gentoo-config config/gentoo
+       cat >> config/gentoo <<-EOF
+       $(urt_config X X11)
+       $(urt_config gif GIF)
+       $(urt_config gs POSTSCRIPT)
+       $(urt_config tiff TIFF)
+       ExtraCFLAGS = ${CFLAGS}
+       MFLAGS = ${MAKEOPTS}
+       EOF
+}
+
+src_compile() {
+       ./Configure config/gentoo || die "config"
+       emake || die "emake"
+}
+
+src_install() {
+       # this just installs it into some local dirs
+       make install || die
+       dobin bin/* || die "dobin"
+       dolib.a lib/librle.a || die "dolib.a"
+       insinto /usr/include/urt
+       doins include/*.h || die "doins include"
+       doman man/man?/*.[135]
+       dodoc *-changes CHANGES* README blurb
+}