summaryrefslogtreecommitdiff
path: root/app-text/pstotext
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-text/pstotext
reinit the tree, so we can have metadata
Diffstat (limited to 'app-text/pstotext')
-rw-r--r--app-text/pstotext/Manifest7
-rw-r--r--app-text/pstotext/files/1.9-flags.patch36
-rw-r--r--app-text/pstotext/files/pstotext-1.9-quote-chars-fix.patch136
-rw-r--r--app-text/pstotext/metadata.xml8
-rw-r--r--app-text/pstotext/pstotext-1.9-r4.ebuild33
5 files changed, 220 insertions, 0 deletions
diff --git a/app-text/pstotext/Manifest b/app-text/pstotext/Manifest
new file mode 100644
index 000000000000..4351a1d6d60b
--- /dev/null
+++ b/app-text/pstotext/Manifest
@@ -0,0 +1,7 @@
+AUX 1.9-flags.patch 775 SHA256 fff20b702f82c3b81d4a9c8c0d58047f02f2ca64c5371a509f713bfdf4395fe7 SHA512 4933522482e76eb9a220da6baf74722318e1b3c818515560f58a2d448b66a5236450c96171e89c8fa899c4e4904fcbde8457e87accbde0b6275c7154e1e9e462 WHIRLPOOL cd3b078a79e081697a932a7126d78794dea4de24dbfa35fa41dabcf2c696bbee04c06c0aa64ebdca52ce4a9acf0c71b3c19717a1e0dbb5f8abf992dc2b168f3e
+AUX pstotext-1.9-quote-chars-fix.patch 3491 SHA256 86a031cba40e1d5ffc7cb17970a2af25c2816d274215f0aa7ade367ae8f41ce4 SHA512 c6ffabaf5b5f7261e79e43d0083543b0428cde0d62c1b9e9513905d03dd5174a1ee1a537dfa8d906b7422cc6c9e5606fc7dc6f177d11441fd028355e99c2c4a6 WHIRLPOOL 6338e4a016638fa4232f44034feafd4277e12554fbc0e8fc594fb751c4bf0f7a957a960da57093ce247d55b8c231d20d7d4f0e14269cded5d772a670f3e80753
+DIST pstotext-1.9.tar.gz 37461 SHA256 cfe0a251d0d43982a7d3bdf1d1670c854432739d00cb593c9beaca4b2cc36c27 SHA512 a8148e94d635544a7dfa8c96ff6071717388e4dc6c3db36f2c50939dce96c1f824ee423b1622af9111fffc60cb298215a6ee85d956c81873d71ceac804ee48ca WHIRLPOOL 2e2bec427d230c007687af13425ff6ac366e8b868950d8338855451c63ecc0ff401e14d5ddc6ee645e4dc209d4a5af5d772dcf1f8e2299917c1c3ce8d234017e
+EBUILD pstotext-1.9-r4.ebuild 659 SHA256 32900f941dcc691241c7bb00aae09d62b4ce87f486fd2c234dcd321cfeb836f8 SHA512 a4654692a85c847ae918547e22ea2837b8ca78a156528fdf485ade26c9d8ce84c7a04a07fac1b4b018955126f3dc514a4590ad00d5d897bb62708ff1002234db WHIRLPOOL 9d3d46f214096f1222c6b5a5573a58e83c9151fe20c4c142da24f2112a85cdb664c67461bf3d51b3f994e317f0ec3244df1db6e040b4f443affb72bfa7f3c1f3
+MISC ChangeLog 2501 SHA256 eb2067bfc043dc4bcb547be20f50f93311af726c16894bd92b3bb8fcfae27b3b SHA512 c5036261f837a60b27009333e596c98a067a7591465ad44d1ae144431742d025ecdc98653931b8263397fc7b65967dc2ec20ac41e74ef0b0a8ae1dcef914f159 WHIRLPOOL 54c29a9f2248e4e8552629c4b7c64d2b3c4f218082092e697a14d7e597fc71d03b4a999f874fd2cc7680479c9e96edcc747ab23094ab42747b3ccd08fd608f4f
+MISC ChangeLog-2015 5200 SHA256 2be58038043a4ec058a62d28c4b9084f896ee4d1cf5466c9c9a88fb0e4f91401 SHA512 f6c28d05f9762f890464c3843e28548852b075d040a94b0292e0dc359726707adf073db9f2d6439e5cf3bb86b1834307b1797bec3d13339c9adbc280ec44215f WHIRLPOOL 9f5a6c80008775e405c2d79329e25c81b1772b83628aa83c1ecdb88702c0bbc3cfd93a17f89597911f7970d410a86c44c00b0957b750efe1a2a91ef4e21d41f9
+MISC metadata.xml 249 SHA256 1c23b6a75de713ca6f4316742ebb0884fd6cbe80d7b97bcab4f467131a3506f0 SHA512 895325641a176c848988fb5f36cdb567b584d22f6e778b3de674de480cbca30b7cf8f12ecbbe1173a63e3229889e1e0f5efd5afea4f0d4c429ac236598f80f1e WHIRLPOOL 79f461d266db8e176661a5c24527780598eb751a1fbdbc05871a0207ed5b5dde38767357e4e0c5bdad4f609a7e11d7c9ec5c3a404274c83d4a5c3910f9305c1c
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
+}