diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-text/pstotext | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-text/pstotext')
-rw-r--r-- | app-text/pstotext/Manifest | 5 | ||||
-rw-r--r-- | app-text/pstotext/files/1.9-flags.patch | 36 | ||||
-rw-r--r-- | app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch | 136 | ||||
-rw-r--r-- | app-text/pstotext/metadata.xml | 8 | ||||
-rw-r--r-- | app-text/pstotext/pstotext-1.9-r4.ebuild | 33 |
5 files changed, 218 insertions, 0 deletions
diff --git a/app-text/pstotext/Manifest b/app-text/pstotext/Manifest new file mode 100644 index 000000000000..81162f9b85bd --- /dev/null +++ b/app-text/pstotext/Manifest @@ -0,0 +1,5 @@ +AUX 1.9-flags.patch 775 BLAKE2B 32634da1338504c985a71dd58a6c5a09e03f07063c4540647e155a3d9f4b17fdc2a2d2a6db39f698c9bb7442b525ba876e7a951ad95e908e6a457699847f583f SHA512 4933522482e76eb9a220da6baf74722318e1b3c818515560f58a2d448b66a5236450c96171e89c8fa899c4e4904fcbde8457e87accbde0b6275c7154e1e9e462 +AUX pstotext-1.9-quote-chars-fix.patch 3491 BLAKE2B 81f284386683222fb8c95f0b2677d05134e578486932b09511ba9fd685ade1b02db1a6c1e60dd90502e558f5ff5bc3a8eefa577c8cc620a89f5a97215e9aaea2 SHA512 c6ffabaf5b5f7261e79e43d0083543b0428cde0d62c1b9e9513905d03dd5174a1ee1a537dfa8d906b7422cc6c9e5606fc7dc6f177d11441fd028355e99c2c4a6 +DIST pstotext-1.9.tar.gz 37461 BLAKE2B ff0c816ff0f57882e6fb36df9a2ba02049526cc0d5a0996e47c32f98a3d3208ca35f59c84605e75c787b80b3a0d8db498afbd4d28e2095be8abd979ecaa6bc22 SHA512 a8148e94d635544a7dfa8c96ff6071717388e4dc6c3db36f2c50939dce96c1f824ee423b1622af9111fffc60cb298215a6ee85d956c81873d71ceac804ee48ca +EBUILD pstotext-1.9-r4.ebuild 659 BLAKE2B 0d75710e224caeb41c97a6a3fcd43c1c11e768a801f152b83742f3e80097e2eb37ce3007afba5938775c8a8e95d174c34d94d93f0f446fed9400d55f8e3b91c2 SHA512 a4654692a85c847ae918547e22ea2837b8ca78a156528fdf485ade26c9d8ce84c7a04a07fac1b4b018955126f3dc514a4590ad00d5d897bb62708ff1002234db +MISC metadata.xml 249 BLAKE2B 1b34ce77c092c0664a18f32525d158d41bf36ab7ab7a4b9d01ed37e1e3dda3d58849d5b1375065c4e5591f6b09b2a93e88a624d399c495a0b1125edb30ec172f SHA512 895325641a176c848988fb5f36cdb567b584d22f6e778b3de674de480cbca30b7cf8f12ecbbe1173a63e3229889e1e0f5efd5afea4f0d4c429ac236598f80f1e diff --git a/app-text/pstotext/files/1.9-flags.patch b/app-text/pstotext/files/1.9-flags.patch new file mode 100644 index 000000000000..6f3c9b68d82c --- /dev/null +++ b/app-text/pstotext/files/1.9-flags.patch @@ -0,0 +1,36 @@ +diff --git a/Makefile b/Makefile +index 551e3b8..1d55ebe 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,7 +9,7 @@ + # commenting out the includes of ptotdll.h in ptotdll.c and main.c. + # PMcJ 6 Sep 96 + +-CC=gcc ++CC ?= gcc + #CC=cc -std + + BUNDLE = ocr.h rot270.h rot90.h +@@ -17,18 +17,18 @@ BUNDLE = ocr.h rot270.h rot90.h + all: pstotext + + main.o: main.c ptotdll.h bundle.h ocr.h rot270.h rot90.h +- $(CC) -c $*.c ++ $(CC) $(CFLAGS) -c $*.c + + ptotdll.o: ptotdll.c ptotdll.h +- $(CC) -c $*.c ++ $(CC) $(CFLAGS) -c $*.c + + pstotext: bundle.o main.o ptotdll.o +- $(CC) -o pstotext main.o bundle.o ptotdll.o -lm ++ $(CC) $(CFLAGS) $(LDFLAGS) -o pstotext main.o bundle.o ptotdll.o -lm + + .SUFFIXES: .ps + + .c.o: +- $(CC) -c $*.c ++ $(CC) $(CFLAGS) -c $*.c + + # "Bundle" an Ascii file. + .ps.h: diff --git a/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch b/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch new file mode 100644 index 000000000000..177d3726e659 --- /dev/null +++ b/app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch @@ -0,0 +1,136 @@ +diff -urN pstotext-1.9.orig/main.c pstotext-1.9/main.c +--- pstotext-1.9.orig/main.c 2004-01-09 11:17:38.000000000 +0100 ++++ pstotext-1.9/main.c 2006-05-19 11:43:52.000000000 +0200 +@@ -126,12 +126,14 @@ + static int cleanup(void) { + int gsstatus, status = 0; + pstotextExit(instance); +- if (gs!=NULL) { + #ifdef VMS ++ if (gs!=NULL) { + gsstatus = fclose(gs); ++ } + #else +- gsstatus = pclose(gs); ++ waitpid(-1, &gsstatus, 0); + #endif ++ if (gsstatus) { + if (WIFEXITED(gsstatus)) { + if (WEXITSTATUS(gsstatus)!=0) status = 3; + else if (WIFSIGNALED(gsstatus)) status = 4; +@@ -166,8 +168,13 @@ + + static int do_it(char *path) { + /* If "path" is NULL, then "stdin" should be processed. */ +- char *gs_cmdline; +- char *input; ++ char *gs_argv[32]; ++ int gs_argc=0; ++#ifdef DEBUG ++ int i; ++#endif ++ int fd[2]; ++ pid_t p; + int status; + char norotate[] = ""; + FILE *fileout; +@@ -201,47 +208,31 @@ + exit(1); + } + +- if (path==NULL) { +- input = (char*)malloc(2); +- if (input == NULL) { +- fprintf(stderr,"No memory available\n"); +- cleanup(); +- exit(1); +- } +- strcpy(input, "-"); +- } else { +- input = (char*)malloc(strlen(path) + 6); +- if (input == NULL) { +- fprintf(stderr,"No memory available\n"); +- cleanup(); +- exit(1); +- } +- strcpy(input, "-- '"); strcat(input, path); strcat(input, "'"); ++ gs_argv[gs_argc++] = "gs"; ++ gs_argv[gs_argc++] = "-r72"; ++ gs_argv[gs_argc++] = "-dNODISPLAY"; ++ gs_argv[gs_argc++] = "-dFIXEDMEDIA"; ++ gs_argv[gs_argc++] = "-dDELAYBIND"; ++ gs_argv[gs_argc++] = "-dWRITESYSTEMDICT"; ++ if (!debug) { ++ gs_argv[gs_argc++] = "-q"; ++ } ++ gs_argv[gs_argc++] = "-dNOPAUSE"; ++ gs_argv[gs_argc++] = "-dSAFER"; ++ if (rotate_path && strcmp(rotate_path, "")) { ++ gs_argv[gs_argc++] = rotate_path; ++ } ++ if (ocr_path && strcmp(ocr_path, "")) { ++ gs_argv[gs_argc++] = ocr_path; ++ } ++ if (path == NULL ) { ++ gs_argv[gs_argc++] = "-"; ++ } ++ else { ++ gs_argv[gs_argc++] = "--"; ++ gs_argv[gs_argc++] = path; + } +- +- gs_cmdline = (char*)malloc(strlen(gs_cmd)+strlen(rotate_path)+ +- strlen(ocr_path) + strlen(input) + 128); +- +- if (gs_cmdline == NULL) { +- fprintf(stderr, "No memory available\n"); +- cleanup(); +- exit(1); +- } +- +- sprintf( +- gs_cmdline, +-#ifdef VMS +- "%s -r72 \"-dNODISPLAY\" \"-dFIXEDMEDIA\" \"-dDELAYBIND\" \"-dWRITESYSTEMDICT\" %s \"-dNOPAUSE\" %s %s %s", +-#else +- "%s -r72 -dNODISPLAY -dFIXEDMEDIA -dDELAYBIND -dWRITESYSTEMDICT %s -dNOPAUSE %s %s %s", +-#endif +- gs_cmd, +- (debug ? "" : "-q"), +- rotate_path, +- ocr_path, +- input +- ); +- if (debug) fprintf(stderr, "%s\n", gs_cmdline); ++ gs_argv[gs_argc++] = NULL; + #ifdef VMS + cmdfile = tempnam("SYS$SCRATCH:","PS2TGS"); + gsoutfile = tempnam("SYS$SCRATCH:","GSRES"); +@@ -259,8 +250,25 @@ + exit(1); + } + #else +- gs = popen(gs_cmdline, "r"); +- if (gs==0) {perror(cmd); exit(1);} ++ if (pipe(fd)) { ++ perror("pipe failed: "); exit(1); ++ }; ++ p = fork(); ++ if (p == -1) { ++ perror("fork failed: "); exit(1); ++ } ++ if (p == 0) { /* child */ ++ close(fd[0]); ++ dup2(fd[1], 1); /* Redirect stdout into pipe to parent */ ++ execvp("/usr/bin/gs", gs_argv); ++ perror("execvp: "); status=cleanup(); exit(1); ++ } else { /* parent */ ++ close(fd[1]); ++ gs = fdopen(fd[0], "r"); ++ if (gs == NULL) { ++ perror("fdopen: "); status=cleanup(); exit(1); ++ } ++ } + #endif + status = pstotextInit(&instance); + if (status!=0) { diff --git a/app-text/pstotext/metadata.xml b/app-text/pstotext/metadata.xml new file mode 100644 index 000000000000..7b4a61aab741 --- /dev/null +++ b/app-text/pstotext/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>tex@gentoo.org</email> + <name>Gentoo TeX Project</name> + </maintainer> +</pkgmetadata> diff --git a/app-text/pstotext/pstotext-1.9-r4.ebuild b/app-text/pstotext/pstotext-1.9-r4.ebuild new file mode 100644 index 000000000000..f08483acb74d --- /dev/null +++ b/app-text/pstotext/pstotext-1.9-r4.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils toolchain-funcs + +DESCRIPTION="Extract ASCII text from a PostScript or PDF file" +HOMEPAGE="http://www.cs.wisc.edu/~ghost/doc/pstotext.htm" +SRC_URI="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/contrib/${P}.tar.gz" + +LICENSE="PSTT" +SLOT="0" +KEYWORDS="amd64 hppa ppc ppc64 x86" +IUSE="" + +DEPEND="app-arch/ncompress" +RDEPEND="app-text/ghostscript-gpl" + +PATCHES=( + "${FILESDIR}"/${P}-quote-chars-fix.patch + "${FILESDIR}"/${PV}-flags.patch +) + +src_prepare() { + default + tc-export CC +} + +src_install () { + dobin pstotext + doman pstotext.1 +} |