diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2009-02-26 11:50:50 +0000 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2009-02-26 11:50:50 +0000 |
commit | b0cb18bbe1f9e9bda767b7686b8f99cba7b9f434 (patch) | |
tree | 19a2563e87a3c08890cdebbb5077cc09db30d844 /app-text/chm2pdf | |
parent | Version bump (diff) | |
download | historical-b0cb18bbe1f9e9bda767b7686b8f99cba7b9f434.tar.gz historical-b0cb18bbe1f9e9bda767b7686b8f99cba7b9f434.tar.bz2 historical-b0cb18bbe1f9e9bda767b7686b8f99cba7b9f434.zip |
Initial import of chm2pdf program. Fixes bug #205208
Package-Manager: portage-2.2_rc23/cvs/Linux x86_64
Diffstat (limited to 'app-text/chm2pdf')
-rw-r--r-- | app-text/chm2pdf/ChangeLog | 11 | ||||
-rw-r--r-- | app-text/chm2pdf/Manifest | 5 | ||||
-rw-r--r-- | app-text/chm2pdf/chm2pdf-0.9.1.ebuild | 30 | ||||
-rw-r--r-- | app-text/chm2pdf/files/tempdir.patch | 71 | ||||
-rw-r--r-- | app-text/chm2pdf/metadata.xml | 12 |
5 files changed, 129 insertions, 0 deletions
diff --git a/app-text/chm2pdf/ChangeLog b/app-text/chm2pdf/ChangeLog new file mode 100644 index 000000000000..76122b67b728 --- /dev/null +++ b/app-text/chm2pdf/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for app-text/chm2pdf +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-text/chm2pdf/ChangeLog,v 1.1 2009/02/26 11:50:49 hwoarang Exp $ + +*chm2pdf-0.9.1 (26 Feb 2009) + + 26 Feb 2009; Markos Chandras <hwoarang@gentoo.org> +files/tempdir.patch, + +metadata.xml, +chm2pdf-0.9.1.ebuild: + Initial import of chm2pdf program. Fixes bug #205208 . Thanks to Milan + Nikolic <gen2brain@gmail.com> for the patch + diff --git a/app-text/chm2pdf/Manifest b/app-text/chm2pdf/Manifest new file mode 100644 index 000000000000..4665fdcb4015 --- /dev/null +++ b/app-text/chm2pdf/Manifest @@ -0,0 +1,5 @@ +AUX tempdir.patch 3694 RMD160 392c2c0f3afe8196433550895357b7a3347fc6c8 SHA1 a379b26fc6c1d0bf8ff9239a6a6508f12f2c3de7 SHA256 c3a19bfb3fdc12c416b6ef1ecd8ac9e3f28e85be906a90328acaf90614080f3d +DIST chm2pdf-0.9.1.tar.gz 19955 RMD160 3778083bad1bf8c528b4cbde94e5ca0b511cb9af SHA1 92c3dc39aaa3d5452cc9d37d1d34385e8698888b SHA256 204293c264c94bd17f56925d21d20b9f69a96136836198ba1a5014fe128ec3b0 +EBUILD chm2pdf-0.9.1.ebuild 717 RMD160 a335046525b41bdfd9db19b6d92e5226b1bc7aef SHA1 bfb83cc44dd45882b6d34b36839a366b41d2b45e SHA256 26ba87e1a06189a99a9e78a5c51788f6e878e0e8be64b2e78af4c89cba4d813b +MISC ChangeLog 472 RMD160 fedd4e4f3f8a7951f286e407062a7a0ea1a7a13d SHA1 dc89dea0102b1e9c3063ab5399c1fe1adb6b35cc SHA256 814d73dc5bb2f5ce07c56d7823d9168c76dafa8dba719e332f9cbc8946066769 +MISC metadata.xml 292 RMD160 c3d73718b776b9f6968f6667002be2a3280cb84f SHA1 f22f5662bf6ca077873235dffa3a7d20fa8af54c SHA256 0f7697112b8329f5d5cc9406cd2fe3c9816c8d952f7c3ef217103421f8c3f73e diff --git a/app-text/chm2pdf/chm2pdf-0.9.1.ebuild b/app-text/chm2pdf/chm2pdf-0.9.1.ebuild new file mode 100644 index 000000000000..a2c5a2f5f9c7 --- /dev/null +++ b/app-text/chm2pdf/chm2pdf-0.9.1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-text/chm2pdf/chm2pdf-0.9.1.ebuild,v 1.1 2009/02/26 11:50:49 hwoarang Exp $ + +EAPI="2" + +inherit 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 + dev-lang/python" + +src_prepare(){ + epatch "${FILESDIR}/tempdir.patch" +} + +src_install() { + dobin ${PN} || die "failed to create executable" + dodoc README || die "dodoc failed" +} diff --git a/app-text/chm2pdf/files/tempdir.patch b/app-text/chm2pdf/files/tempdir.patch new file mode 100644 index 000000000000..6bb5fe55d00d --- /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 000000000000..3d43c690d0f6 --- /dev/null +++ b/app-text/chm2pdf/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd></herd> +<maintainer> +<email>hwoarang@gentoo.org</email> +<name>Markos Chandras</name> +</maintainer> +<longdescription lang="en"> +</longdescription> +</pkgmetadata> + |