summaryrefslogtreecommitdiff
path: root/app-text/chm2pdf
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-text/chm2pdf
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-text/chm2pdf')
-rw-r--r--app-text/chm2pdf/Manifest1
-rw-r--r--app-text/chm2pdf/chm2pdf-0.9.1-r1.ebuild35
-rw-r--r--app-text/chm2pdf/chm2pdf-0.9.1-r2.ebuild40
-rw-r--r--app-text/chm2pdf/files/tempdir.patch71
-rw-r--r--app-text/chm2pdf/metadata.xml15
5 files changed, 162 insertions, 0 deletions
diff --git a/app-text/chm2pdf/Manifest b/app-text/chm2pdf/Manifest
new file mode 100644
index 00000000000..b987daf6720
--- /dev/null
+++ b/app-text/chm2pdf/Manifest
@@ -0,0 +1 @@
+DIST chm2pdf-0.9.1.tar.gz 19955 SHA256 204293c264c94bd17f56925d21d20b9f69a96136836198ba1a5014fe128ec3b0 SHA512 1d1997b17750f371e60cc6bf9693a8e4316deadd63247700f6ebd1bf02340f2e0524766a6be846d0f6349416b8551609da63fbf60ecd62766cf0d9b4f0c886d3 WHIRLPOOL 15607e84628ea2395b0f55ce0e1c2ab8c41f087e348e453a39db101f21c7e32f533d1537ad79957cf02b4c91f8dc7bf1afa883bf083067f09bbfb0012a373943
diff --git a/app-text/chm2pdf/chm2pdf-0.9.1-r1.ebuild b/app-text/chm2pdf/chm2pdf-0.9.1-r1.ebuild
new file mode 100644
index 00000000000..80aa73116f8
--- /dev/null
+++ b/app-text/chm2pdf/chm2pdf-0.9.1-r1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+PYTHON_DEPEND="2"
+inherit python eutils
+
+DESCRIPTION="A script that converts a CHM file into a single PDF file"
+HOMEPAGE="http://code.google.com/p/chm2pdf/"
+SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-python/pychm
+ app-text/htmldoc
+ || ( >=dev-libs/chmlib-0.40-r1[examples]
+ <dev-libs/chmlib-0.40-r1 )"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare(){
+ epatch "${FILESDIR}/tempdir.patch"
+ python_convert_shebangs 2 ${PN}
+}
+
+src_install() {
+ dobin ${PN} || die "failed to create executable"
+ dodoc README || die "dodoc failed"
+}
diff --git a/app-text/chm2pdf/chm2pdf-0.9.1-r2.ebuild b/app-text/chm2pdf/chm2pdf-0.9.1-r2.ebuild
new file mode 100644
index 00000000000..fa7ec2babc0
--- /dev/null
+++ b/app-text/chm2pdf/chm2pdf-0.9.1-r2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+DESCRIPTION="A script that converts a CHM file into a single PDF file"
+HOMEPAGE="http://code.google.com/p/chm2pdf/"
+SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-python/pychm[${PYTHON_USEDEP}]
+ app-text/htmldoc
+ >=dev-libs/chmlib-0.40-r1[examples]
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+PATCHES=( "${FILESDIR}/tempdir.patch" )
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare(){
+ python_fix_shebang .
+}
+
+src_install() {
+ default
+ python_doscript ${PN} || die "failed to create executable"
+}
diff --git a/app-text/chm2pdf/files/tempdir.patch b/app-text/chm2pdf/files/tempdir.patch
new file mode 100644
index 00000000000..6bb5fe55d00
--- /dev/null
+++ b/app-text/chm2pdf/files/tempdir.patch
@@ -0,0 +1,71 @@
+--- chm2pdf-0.9.1.orig/chm2pdf 2008-07-09 12:42:26.000000000 +0200
++++ chm2pdf-0.9.1/chm2pdf 2009-02-25 20:58:53.000000000 +0100
+@@ -27,6 +27,8 @@
+ import os, os.path
+ import re, glob
+ import getopt
++import tempfile
++import shutil
+ # from BeautifulSoup import BeautifulSoup
+
+ global version
+@@ -39,8 +41,8 @@
+ global filename #the input filename
+
+ version = '0.9.1'
+-CHM2PDF_TEMP_WORK_DIR='/tmp/chm2pdf/work'
+-CHM2PDF_TEMP_ORIG_DIR='/tmp/chm2pdf/orig'
++CHM2PDF_TEMP_WORK_DIR=tempfile.mkdtemp()
++CHM2PDF_TEMP_ORIG_DIR=tempfile.mkdtemp()
+
+
+
+@@ -299,16 +301,6 @@
+ # ########################### File extraction and correction: START ############################
+ #
+ if options['dontextract'] == '':
+-
+- try:
+- os.mkdir(CHM2PDF_TEMP_WORK_DIR)
+- except OSError: # The directory already exists.
+- pass
+-
+- try:
+- os.mkdir(CHM2PDF_TEMP_ORIG_DIR)
+- except OSError: # The directory already exists.
+- pass
+
+ try:
+ os.mkdir(CHM2PDF_ORIG_DIR)
+@@ -620,7 +612,7 @@
+ print '\t--continuous\n\t\tSpecifies that the HTML sources are unstructured (plain web pages).\n\t\tNo page breaks are inserted between each file or URL in the output.'
+ print '\t--cookies \'name="value with space"; name=value\'\n\t\t'
+ print '\t--datadir directory\n\t\tSpecifies the location of the HTMLDOC data files, usually /usr/share/htmldoc or C:\Program Files\HTMLDOC '
+- print "\t--dontextract \n\t\tIf given, %s will not extract the HTML files from the given CHM file, but will use previously extracted copies from the temporary directory " %name + '(i.e. ' + CHM2PDF_TEMP_ORIG_DIR + ' and ' + CHM2PDF_TEMP_WORK_DIR + '). Usually you will use this option after you have used the \'--extract-only\' option to extract the files in order to correct them manually (in ' + CHM2PDF_TEMP_WORK_DIR + '). After the correction, a call with \'--dontextract\' will not overwrite your changes, but will use the corrected files instead.'
++# print "\t--dontextract \n\t\tIf given, %s will not extract the HTML files from the given CHM file, but will use previously extracted copies from the temporary directory " %name + '(i.e. ' + CHM2PDF_TEMP_ORIG_DIR + ' and ' + CHM2PDF_TEMP_WORK_DIR + '). Usually you will use this option after you have used the \'--extract-only\' option to extract the files in order to correct them manually (in ' + CHM2PDF_TEMP_WORK_DIR + '). After the correction, a call with \'--dontextract\' will not overwrite your changes, but will use the corrected files instead.'
+ print '\t--duplex\n\t\tSpecifies that the output should be formatted for double-sided printing.'
+ print '\t--effectduration {0.1..10.0}\n\t\tSpecifies the duration in seconds of PDF page transition effects.'
+ print '\t--embedfonts\n\t\tSpecifies that fonts should be embedded in PDF output.'
+@@ -1084,13 +1076,6 @@
+ print 'CHM file "' + filename + '" not found!'
+ return
+
+- #remove temporary files
+- if options['dontextract'] == '':
+- if options['verbose']=='--verbose' and options['verbositylevel']=='high':
+- print 'Removing any previous temporary files...'
+- os.system('rm -r '+CHM2PDF_ORIG_DIR+'/*')
+- os.system('rm -r '+CHM2PDF_WORK_DIR+'/*')
+-
+ cfile = chm.CHMFile()
+ cfile.LoadCHM(filename)
+
+@@ -1105,6 +1090,8 @@
+ os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '&> /dev/null')
+
+ convert_to_pdf(cfile, filename, outputfilename, options)
++ shutil.rmtree(CHM2PDF_TEMP_WORK_DIR)
++ shutil.rmtree(CHM2PDF_TEMP_ORIG_DIR)
+
+
+ if __name__ == '__main__':
diff --git a/app-text/chm2pdf/metadata.xml b/app-text/chm2pdf/metadata.xml
new file mode 100644
index 00000000000..5751fc881e4
--- /dev/null
+++ b/app-text/chm2pdf/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <maintainer>
+ <email>rhill@gentoo.org</email>
+ <name>Ryan Hill</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">chm2pdf</remote-id>
+ </upstream>
+</pkgmetadata>