--- chm2pdf-0.9.1.orig/debian/compat +++ chm2pdf-0.9.1/debian/compat @@ -0,0 +1 @@ +5 --- chm2pdf-0.9.1.orig/debian/changelog +++ chm2pdf-0.9.1/debian/changelog @@ -0,0 +1,91 @@ +chm2pdf (0.9.1-1.1ubuntu3) lucid; urgency=low + + * Improved verbage in short and long description + * Added README.source to please lintian + * Update standards version to 3.8.4 + + -- Steve Stalcup Thu, 04 Mar 2010 10:17:07 -0700 + +chm2pdf (0.9.1-1.1ubuntu2) karmic; urgency=low + + * Add multi_filename_fix.diff to fix multi name files headache + * Remove patches applied in multi_filename_fix.diff: + - insecure_temp_dirs.diff + - bashisms.diff + + -- Steve Stalcup Thu, 21 May 2009 09:40:13 -0400 + +chm2pdf (0.9.1-1.1ubuntu1) jaunty; urgency=low + + * Merge from debian unstable (LP: #309481), remaining changes: + * debian/control: + - added Homepage field + * Minor manpage fixes + + -- Manny Vindiola Thu, 18 Dec 2008 15:41:50 -0500 + +chm2pdf (0.9.1-1.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/control, debian/rules: use quilt to manage patches + * insecure_temp_dirs.diff (Closes: #501959): + - Don't use static names to create temp dirs. + - Commented out --dontextract from usage info, as it is not very useful now + * bashisms.diff: fix bashism in chm2pdf (Closes: #502044). + + -- Raphael Geissert Sun, 12 Oct 2008 17:54:24 -0500 + +chm2pdf (0.9.1-1) unstable; urgency=low + + * New upstream release + - removed htmldoc.patch + - commented out patch rule in debian/rules + * Bumped Standards version to 3.8.0 + * Added python-beautifulsoup as Suggests in debian/control + + -- Steve Stalcup Sun, 20 Jul 2008 12:17:02 -0400 + +chm2pdf (0.9.1-0ubuntu3) intrepid; urgency=low + + [Raphael Geissert] + * debian/control, debian/rules: use quilt to manage patches + * insecure_temp_dirs.diff (Closes: #501959): + - Don't use static names to create temp dirs. + - Commented out --dontextract from usage info, as it is not very useful now + * bashisms.diff: fix bashism in chm2pdf (Closes: #502044). + + [Steve Stalcup] + * A few bug fixes (LP: #267496) + * debian/control: + - update-maintainer + - added Homepage field + -- Steve Stalcup Tue, 21 Oct 2008 11:38:11 -0400 + +chm2pdf (0.9.1-0ubuntu2) intrepid; urgency=low + + * Minor manpage fixes (LP: #267740) + + -- Steve Stalcup Mon, 08 Sep 2008 21:18:38 -0400 + +chm2pdf (0.9.1-0ubuntu1) intrepid; urgency=low + + * New upstream release + * removed patch for htmldoc error + * bumped standards version to 3.8.0 + + -- Steve Stalcup Tue, 05 Aug 2008 19:39:01 -0400 + +chm2pdf (0.9-2) unstable; urgency=low + + * Added patch for htmldoc error (Closes: #477390) + * Debian/rules: Added simple patchsystem to cdbs + * Added watch file + + -- Steve Stalcup Wed, 07 May 2008 18:22:19 -0400 + +chm2pdf (0.9-1) unstable; urgency=low + + * Initial release (Closes: #469289) + + -- Steve Stalcup Thu, 20 Mar 2008 10:40:47 -0400 + --- chm2pdf-0.9.1.orig/debian/chm2pdf.manpages +++ chm2pdf-0.9.1/debian/chm2pdf.manpages @@ -0,0 +1 @@ +debian/chm2pdf.1 --- chm2pdf-0.9.1.orig/debian/control +++ chm2pdf-0.9.1/debian/control @@ -0,0 +1,21 @@ +Source: chm2pdf +Section: text +Priority: extra +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Steve Stalcup +Build-Depends: cdbs (>= 0.4.49), + debhelper (>= 5), + python, + python-support (>= 0.6.4), + quilt +Standards-Version: 3.8.4 +Homepage: http://code.google.com/p/chm2pdf/ + +Package: chm2pdf +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, libchm-bin, python-chm, htmldoc +Suggests: python-beautifulsoup +Description: A Python script that converts CHM files into PDF files + Convert CHM files to PDF files. This package supports batch conversion, command line, + PDF security options, password protection, and compression modes. The program + has an Explorer-like interface. --- chm2pdf-0.9.1.orig/debian/watch +++ chm2pdf-0.9.1/debian/watch @@ -0,0 +1,6 @@ +version=3 +http://code.google.com/p/chm2pdf/downloads/list \ +http://chm2pdf.googlecode.com/files/chm2pdf-([\d.]+)\.tar\.gz + + + --- chm2pdf-0.9.1.orig/debian/copyright +++ chm2pdf-0.9.1/debian/copyright @@ -0,0 +1,36 @@ +This package was debianized by Steve Stalcup on +Sun, 20 Jan 2008 21:24:15 -0500. + +It was downloaded from http://chm2pdf.googlecode.com/ + +Upstream Authors: + + Author: Massimo Sandal, Chris Karakas + Author-email: devicerandom@gmail.com, chris@karakas-online.de + +Copyright: + + (c)2007 Massimo Sandal, devicerandom@gmail.com + (c)2007 Chris Karakas, chris@karakas-online.de + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. + +The Debian packaging is (C) 2008, Steve Stalcup and +is licensed under the GPL, see above. --- chm2pdf-0.9.1.orig/debian/rules +++ chm2pdf-0.9.1/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM=pysupport + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk +# include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/class/python-distutils.mk + + + --- chm2pdf-0.9.1.orig/debian/pycompat +++ chm2pdf-0.9.1/debian/pycompat @@ -0,0 +1 @@ +2 --- chm2pdf-0.9.1.orig/debian/README.source +++ chm2pdf-0.9.1/debian/README.source @@ -0,0 +1,4 @@ +Please see the quilt README.source: + +/usr/share/doc/quilt/README.source + --- chm2pdf-0.9.1.orig/debian/pyversions +++ chm2pdf-0.9.1/debian/pyversions @@ -0,0 +1 @@ +2.3- --- chm2pdf-0.9.1.orig/debian/chm2pdf.1 +++ chm2pdf-0.9.1/debian/chm2pdf.1 @@ -0,0 +1,335 @@ +.\" Copyright (C) 2008 Steve Stalcup +.\" +.\" This manual page is free software. It is distributed under the +.\" terms of the GNU General Public License as published by the Free +.\" Software Foundation; either version 2 of the License, or (at your +.\" option) any later version. +.\" +.\" This manual page is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this manual page; if not, write to the Free Software +.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +.\" USA +.\" +.TH "chm2pdf" "1" +.if n .ad l +.nh + +.SH "NAME" +chm2pdf \- A tool convert chm to pdf format + +.SH "SYNOPSIS" +.B chm2pdf +.RI [ options ] +\&... + +.SH "DESCRIPTION" +.PP +chm2pdf is a package supports batch conversion, command line, +PDF security options, password protection and compression modes. +.sp + +.SH OPTIONS + +.PP +Actions of +.B chm2pdf: (Usage: /usr/bin/chm2pdf [options] input_filename [output_filename]) + +.TP +.BR \-\-bodycolor color +Specifies the background color for all pages. + +.TP +.BR \-\-bodyfont +{courier,helvetica,monospace,sans,serif,times} + +.TP +.BR \-\-bodyimage +{bmp,gif,jpg,png} + +.TP +.BR \-\-book +Specifies that the HTML sources are structured (headings, chapters, etc.). + +.TP +.BR \-\-bottom margin{in,cm,mm} +Specifies the bottom margin in points (no suffix or ##pt), inches (##in), +centimeters (##cm), or millimeters (##mm). + +.TP +.BR \-\-browserwidth pixels +See http://www.htmldoc.org/newsgroups.php?ghtmldoc.general+v:3465 + +.TP +.BR \-\-charset {cp-874...1258,iso-8859-1...8859-15,koi8-r} +Specifies the ISO character set to use for the output. + +.TP +.BR \-\-color +Specifies that PDF output should be in color. + +.TP +.BR \-\-continuous +Specifies that the HTML sources are unstructured (plain web pages). +No page breaks are inserted between each file or URL in the output. + +.TP +.BR \-\-cookies 'name="value with space"; name=value' + +.TP +.BR \-\-datadir directory +Specifies the location of the HTMLDOC data files, usually /usr/share/htmldoc + +.TP +.BR \-\-duplex +Specifies that the output should be formatted for double-sided printing. + +.TP +.BR \-\-effectduration {0.1..10.0} +Specifies the duration in seconds of PDF page transition effects. + +.TP +.BR \-\-embedfonts +Specifies that fonts should be embedded in PDF output. + +.TP +.BR \-\-encryption +Enables encryption of PDF files. + +.TP +.BR \-\-extract-only +Extract the HTML files from the CHM file and stop. +The extracted files will be found in +CHM2PDF_WORK_DIR/input_filename_without_extension. + +.TP +.BR \-\-firstpage {p1,toc,c1} + +.TP +.BR \-\-fontsize {4.0..24.0} +Specifies the default font size for body text. + +.TP +.BR \-\-headfootsize {6.0..24.0} +Sets the size of the font to use on headers and footers. + +.TP +.BR \-\-headingfont {courier,helvetica,monospace,sans,serif,times} +Sets the typeface to use for headings. + +.TP +.BR \-\-help +Displays a summary of command-line options. + +.TP +.BR \-\-jpeg quality +Sets the JPEG Django_Newbiecompression level to use for large images. A value +of 0 disables JPEG compression. + +.TP +.BR \-\-landscape + +.TP +.BR \-\-left margin{in,cm,mm} +Specifies the left margin in points + +.TP +.BR \-\-linkcolor color +Sets the color of links. You can use well-known color names like blue, +or the usual #RRGGBB notation. + +.TP +.BR \-\-links +Enables generation of links in PDF files (default). + +.TP +.BR \-\-linkstyle {plain,underline} +Sets the style of links. + +.TP +.BR \-\-logoimage filename.{bmp,gif,jpg,png} +Specifies an image to be used as a logo in the header or footer in a PDF document. + +.TP +.BR \-\-logoimage filename.{bmp,gif,jpg,png} +Note that you need to use the header and/or footer options with the l parameter. + +.TP +.BR \-\-no-compression +Disables compression of PDF file. + +.TP +.BR \-\-no-duplex +Disables double-sided printing. + +.TP +.BR \-\-no-embedfonts +Specifies that fonts should not be embedded in PDF and PostScript output. + +.TP +.BR \-\-no-encryption +Disables document encryption. + +.TP +.BR \-\-no-links +Disables generation of links in a PDF document. + +.TP +.BR \-\-no-localfiles + +.TP +.BR \-\-no-numbered +Disables automatic heading numbering. + +.TP +.BR \-\-no-overflow + +.TP +.BR \-\-no-strict +Disables strict HTML input checking. + +.TP +.BR \-\-no-title +Disables generation of a title page. + +.TP +.BR \-\-no-toc +Disables generation of a table of contents. + +.TP +.BR \-\-numbered +Numbers all headings in a document. + +.TP +.BR \-\-nup {1,2,4,6,9,16} +Sets the number of pages that are placed on each output page. +Valid values are 1, 2, 4, 6, 9, and 16. + +.TP +.BR \-\-overflow +Specifies that PDF output should be in color. + +.TP +.BR \-\-owner-password password +Sets the owner password for encrypted PDF files. + +.TP +.BR \-\-pageduration {1.0..60.0} +Sets the view duration of a page in a PDF document. + +.TP +.BR \-\-pageeffect {none,bi,bo,d,gd,gdr,gr,hb,hsi,hso,vb,vsi,vso,wd,wl,wr,wu} +Specifies the page transition effect for all pages; this attribute is ignored by +all Adobe PDF viewers. + +.TP +.BR \-\-pagelayout {single,one,twoleft,tworight} +Specifies the initial layout of pages for a PDF file. + +.TP +.BR \-\-pagemode {document,outline,fullscreen} +Specifies the initial viewing mode for a PDF file. + +.TP +.BR \-\-path "dir1;dir2;dir3;...;dirN" +Specifies a search path for files in a document. + +.TP +.BR \-\-permissions {all,annotate,copy,modify,print,no-annotate,no-copy,no-modify, +no-print,none} Specifies document permissions for encrypted PDF files. Separate +multiple permissions with commas. + +.TP +.BR \-\-portrait + +.TP +.BR \-\-quiet +Suppresses all messages, even error messages. + +.TP +.BR \-\-right margin{in,cm,mm} +Specifies the right margin in points + +.TP +.BR \-\-size {letter,a4,WxH{in,cm,mm},etc} +Specifies the page size using a standard name or in points (no suffix or ##x##pt), +inches (##x##in), centimeters (##x##cm), or millimeters (##x##mm). The standard +sizes that are currently recognized are "letter" (8.5x11in), "legal" (8.5x14in), +"a4" (210x297mm), and "universal" (8.27x11in). + +.TP +.BR \-\-strict +Enables strict HTML input checking. + +.TP +.BR \-\-textcolor color +Specifies the default color of all text. + +.TP +.BR \-\-textfont {courier,helvetica,monospace,sans,serif,times} + +.TP +.BR \-\-title +Enables the generation of a title page. + +.TP +.BR \-\-titlefile filename.{htm,html,shtml} +Specifies the file to use for the title page. If the file is an image then the +title page is automatically generated using the document meta data and image title. + +.TP +.BR \-\-tocheader fff +Sets the page header to use on table-of-contents pages. See below for the format of fff. + +.TP +.BR \-\-tocfooter fff +Sets the page footer to use on table-of-contents pages. See below for the format of fff. + +.TP +.BR \-\-toclevels levels +Sets the number of levels in the table-of-contents. + +.TP +.BR \-\-toctitle string +Sets the title for the table-of-contents. + +.TP +.BR \-\-top margin{in,cm,mm} +Specifies the top margin in points (no suffix or ##pt), inches (##in), centimeters +(##cm), or millimeters (##mm). + +.TP +.BR \-\-user-password password +Specifies the user password for encryption of PDF files. + +.TP +.BR \-\-version +Displays the current version number. + +.TP +.BR \-\-webpage +Specifies that the HTML sources are unstructured (plain web pages). A page +break is inserted between each file or URL in the output. + +.TP +.BR \-\-color +Specifies that PDF output should be in color. + +.SH BUGS +Please report chm2pdf bugs to http://chm2pdf.googlecode.com/ + +.SH SEE ALSO +.BR chm2pdf \-\-help + +.SH AUTHORS +Massimo Sandal +.br +Chris Karakas +.br + +This manual page was written by Steve Stalcup +for the \fBUbuntu GNU/Linux\fP system. --- chm2pdf-0.9.1.orig/debian/patches/multi_filename_fix.diff +++ chm2pdf-0.9.1/debian/patches/multi_filename_fix.diff @@ -0,0 +1,128 @@ +# fix for script fail when file name has more than one word + +diff -Nurp chm2pdf-0.9.1/chm2pdf chm2pdf-0.9.1/chm2pdf +--- chm2pdf-0.9.1/chm2pdf 2008-07-09 06:42:26.000000000 -0400 ++++ chm2pdf-0.9.1/chm2pdf 2009-05-15 12:28:37.000000000 -0400 +@@ -27,6 +27,8 @@ import sgmllib + import os, os.path + import re, glob + import getopt ++import tempfile ++import shutil + # from BeautifulSoup import BeautifulSoup + + global version +@@ -39,8 +41,8 @@ global CHM2PDF_ORIG_DIR + 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() + + + +@@ -110,7 +112,7 @@ def get_objective_urls_list(filename): + takes the list of files inside the chm archive, with the correct urls of each one. + ''' + +- os.system('enum_chmLib '+filename+' > '+CHM2PDF_WORK_DIR+'/urlslist.txt') ++ os.system('enum_chmLib '+filename+' > "'+CHM2PDF_WORK_DIR+'/urlslist.txt"') + flist=open(CHM2PDF_WORK_DIR+'/urlslist.txt','rU') + urls_list=[] + for line in flist.readlines()[3:]: +@@ -299,16 +301,6 @@ def convert_to_pdf(cfile, filename, outp + # ########################### 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) +@@ -377,21 +369,22 @@ def convert_to_pdf(cfile, filename, outp + c+=1 + page_filename=CHM2PDF_ORIG_DIR + url + # Some names contain a '%20' (an HTML code for a space). We substitute with a "real space" +- # otherwise a 'File not found' error will occur. +- page_filename = re.sub('%20',' ',page_filename) ++ # otherwise a 'File not found' error will occur. (addendum: we are escaping spaces at this point) ++ page_filename = re.sub('%20','\ ',page_filename) + + if options['verbose']=='--verbose' and options['verbositylevel']=='high' and options['dontextract'] == '': + print "Correcting " + page_filename + +- +- if os.path.exists(page_filename) and (options['titlefile'] == '' or not options['titlefile'] in url): ++ # the python interpreter handles files with spaces just fine, so we have to unescape ++ # our spaces when passing files as arguments to library functions ++ if os.path.exists(re.sub('\\\\ ', ' ', page_filename)) and (options['titlefile'] == '' or not options['titlefile'] in url): + htmlout_filename=CHM2PDF_WORK_DIR+'/temp'+'%(#)04d' %{"#":c}+'.html' +- htmlout_filename_list+=' '+ htmlout_filename ++ htmlout_filename_list+=' "'+ htmlout_filename + '"' # this "list" is just a string, so we quote the filename + htmlout_filenames.append(htmlout_filename) + + if options['dontextract'] == '': + # Correct image links in file page_filename. +- correct_file(page_filename, htmlout_filename, html_list, objective_urls, options) ++ correct_file(re.sub('\\\\ ', ' ', page_filename), htmlout_filename, html_list, objective_urls, options) + + # Escape slashes in url. + url_filename_escaped = re.sub('/', '\/', os.path.basename(url)) +@@ -620,7 +613,7 @@ def usage (name): + 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,16 +1077,18 @@ def main(argv): + 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) + ++ # Escape spaces here! The library functions should not be passed files with ++ # escaped characters, but most of the library calls involving filenames ++ # have already taken place. Further library calls from here should be passed ++ # unescaped versions of these strings: ++ CHM2PDF_WORK_DIR = re.sub(' ', '\ ', CHM2PDF_WORK_DIR) ++ CHM2PDF_ORIG_DIR = re.sub(' ', '\ ', CHM2PDF_ORIG_DIR) ++ filename = re.sub(' ', '\ ', filename) ++ outputfilename = re.sub(' ', '\ ', outputfilename) ++ + if options['dontextract'] == '--dontextract': + if options['verbose'] == '--verbose': + print '\'--dontextract\' option was given. No files will be extracted from CHM.' +@@ -1102,9 +1097,11 @@ def main(argv): + if options['verbose'] == '--verbose' and options['verbositylevel'] == 'high': + os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR) + else: +- os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '&> /dev/null') ++ os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '> /dev/null 2>&1') + + convert_to_pdf(cfile, filename, outputfilename, options) ++ shutil.rmtree(CHM2PDF_TEMP_WORK_DIR) ++ shutil.rmtree(CHM2PDF_TEMP_ORIG_DIR) + + + if __name__ == '__main__': --- chm2pdf-0.9.1.orig/debian/patches/series +++ chm2pdf-0.9.1/debian/patches/series @@ -0,0 +1 @@ +multi_filename_fix.diff