summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoris <is>2013-01-05 20:36:58 +0000
committeris <is>2013-01-05 20:36:58 +0000
commiteffc36e61f2ce5ea1c58434ec8f1c372c92cbd04 (patch)
tree91d423dd925727e0990cd95545ce147c821b5dfc
parentb293a0e6cd375b08955ce23961a7912d423dba1f (diff)
downloadpkgsrc-effc36e61f2ce5ea1c58434ec8f1c372c92cbd04.tar.gz
docx to text converter.
-rw-r--r--converters/docx2txt/DESCR8
-rw-r--r--converters/docx2txt/Makefile54
-rw-r--r--converters/docx2txt/PLIST4
-rw-r--r--converters/docx2txt/distinfo6
-rw-r--r--converters/docx2txt/patches/patch-docx2txt.pl13
5 files changed, 85 insertions, 0 deletions
diff --git a/converters/docx2txt/DESCR b/converters/docx2txt/DESCR
new file mode 100644
index 00000000000..292df93eff8
--- /dev/null
+++ b/converters/docx2txt/DESCR
@@ -0,0 +1,8 @@
+docx2txt (http://docx2txt.sourceforge.net/) is a simple tool to
+generate equivalent text files from Microsoft .docx documents, with
+an attempt towards preserving sufficient formatting and document
+information, and appropriate character conversions for a good text
+experience.
+
+PKGSRC NOTE: contrary to the original package, pkgsrc only installs the
+perl script, and without the suffix .pl
diff --git a/converters/docx2txt/Makefile b/converters/docx2txt/Makefile
new file mode 100644
index 00000000000..5de7ad90d78
--- /dev/null
+++ b/converters/docx2txt/Makefile
@@ -0,0 +1,54 @@
+# $NetBSD: Makefile,v 1.1 2013/01/05 20:36:58 is Exp $
+#
+
+DISTNAME= docx2txt-1.2
+PKGREVISION= 1
+CATEGORIES= converters
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=docx2txt/}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= is@NetBSD.org
+HOMEPAGE= http://docx2txt.sourceforge.net/
+COMMENT= Convert Microsoft .docx documents to simple text files
+LICENSE= gnu-gpl-v3
+
+USE_LANGUAGES= # none
+USE_TOOLS+= perl:run unzip:run
+REPLACE_PERL= docx2txt.pl
+
+BINDIR= ${PREFIX}/bin
+EGDIR= ${PREFIX}/share/doc/docx2txt
+CONF_FILES= ${EGDIR}/docx2txt.config ${PKG_SYSCONFDIR}/docx2txt.config
+
+SUBST_CLASSES+= fix-etc
+SUBST_STAGE.fix-etc= pre-configure
+SUBST_MESSAGE.fix-etc= Fixing /etc path.
+SUBST_FILES.fix-etc= *.pl README
+SUBST_SED.fix-etc= -e 's,"/etc,"${PKG_SYSCONFDIR},g'
+SUBST_SED.fix-etc+= -e 's, /etc , ${PKG_SYSCONFDIR} ,g'
+
+SUBST_CLASSES+= unzip
+SUBST_STAGE.unzip= pre-configure
+SUBST_MESSAGE.unzip= Hardcoding unzip path
+SUBST_FILES.unzip= *.pl *.config
+SUBST_SED.unzip= -e 's,/usr/bin/unzip,${TOOLS_PATH.unzip},'
+
+SUBST_CLASSES+= suffix
+SUBST_STAGE.suffix= pre-configure
+SUBST_MESSAGE.suffix= removing .pl suffix
+SUBST_FILES.suffix= README
+SUBST_SED.suffix= -e 's,docx2txt.pl,docx2txt,'
+
+
+
+do-build:
+ mv ${WRKSRC}/docx2txt.pl ${WRKSRC}/docx2txt
+
+do-install:
+ ${INSTALL_PROGRAM_DIR} ${DESTDIR}${BINDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/docx2txt ${DESTDIR}${BINDIR}
+ ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/docx2txt.config ${DESTDIR}${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${EGDIR}
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/converters/docx2txt/PLIST b/converters/docx2txt/PLIST
new file mode 100644
index 00000000000..5c7d9b1d321
--- /dev/null
+++ b/converters/docx2txt/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2013/01/05 20:36:58 is Exp $
+bin/docx2txt
+share/doc/docx2txt/README
+share/doc/docx2txt/docx2txt.config
diff --git a/converters/docx2txt/distinfo b/converters/docx2txt/distinfo
new file mode 100644
index 00000000000..f8b615565aa
--- /dev/null
+++ b/converters/docx2txt/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2013/01/05 20:36:58 is Exp $
+
+SHA1 (docx2txt-1.2.tgz) = 3e1ed8a63f0c6ec05009720b7109f23cb7afe55c
+RMD160 (docx2txt-1.2.tgz) = 47f551dc8671582999262b8c858a26a34d82eddf
+Size (docx2txt-1.2.tgz) = 28483 bytes
+SHA1 (patch-docx2txt.pl) = fa216040d67613cceffce40fdaedd36bf114139e
diff --git a/converters/docx2txt/patches/patch-docx2txt.pl b/converters/docx2txt/patches/patch-docx2txt.pl
new file mode 100644
index 00000000000..7f48f574ca3
--- /dev/null
+++ b/converters/docx2txt/patches/patch-docx2txt.pl
@@ -0,0 +1,13 @@
+$NetBSD: patch-docx2txt.pl,v 1.1 2013/01/05 20:36:58 is Exp $
+
+--- docx2txt.pl.orig 2012-01-14 12:09:40.000000000 +0000
++++ docx2txt.pl
+@@ -129,7 +129,7 @@ if ($ENV{OS} =~ /^Windows/ && !(exists $
+ $userConfigDir = $ENV{HOME};
+ $systemConfigDir = "/etc";
+
+- $config_tempDir = "/tmp";
++ $config_tempDir = $ENV{TMPDIR} || "/tmp";
+ }
+
+