summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authoraurelien <aurelien@xload.io>2014-05-30 19:59:43 +0200
committeraurelien <aurelien@xload.io>2014-05-30 19:59:43 +0200
commitac7547d79cbb08b0c94b7c60dface7d5c90eb0e3 (patch)
treefa938f6ea28f03a02afa9bc57579035f3c2dcd1e /pcr
parent1268a835f7fb7c40ed82d8be26c05614d1ea3cdc (diff)
htmldoc
Diffstat (limited to 'pcr')
-rw-r--r--pcr/htmldoc/Changelog24
-rw-r--r--pcr/htmldoc/PKGBUILD75
-rw-r--r--pcr/htmldoc/cve-2009-3050.patch41
-rw-r--r--pcr/htmldoc/fortify-fail.patch21
-rw-r--r--pcr/htmldoc/htmldoc.install13
-rw-r--r--pcr/htmldoc/libpng15.patch122
-rw-r--r--pcr/htmldoc/manpage-fixes.patch42
-rw-r--r--pcr/htmldoc/useful-build-info.patch25
8 files changed, 363 insertions, 0 deletions
diff --git a/pcr/htmldoc/Changelog b/pcr/htmldoc/Changelog
new file mode 100644
index 000000000..c24017717
--- /dev/null
+++ b/pcr/htmldoc/Changelog
@@ -0,0 +1,24 @@
+2013-09-17 Mariusz Libera <mariusz.libera@gmail.com>
+
+ 1.8.27-4:
+ * remove htmldoc.ps - it saves us a LOT of space (~150M)
+
+2013-08-27 Mariusz Libera <mariusz.libera@gmail.com>
+
+ 1.8.27-3:
+ * merged htmldoc and htmldoc-patched
+ * surrounded paths with variables with quotation marks
+
+2013-06-17 Mariusz Libera <mariusz.libera@gmail.com>
+
+ 1.8.27-2:
+ * new maintainer
+ * updated PKGBUILD
+ * included patches from Debian and one from Fedora
+ * added documentation
+ * added mime file
+ * fixed dependencies
+ * changed the way icons are installed
+ * added .install file updateing mime,desktop,icons
+ * added Changelog
+
diff --git a/pcr/htmldoc/PKGBUILD b/pcr/htmldoc/PKGBUILD
new file mode 100644
index 000000000..b99e56f0a
--- /dev/null
+++ b/pcr/htmldoc/PKGBUILD
@@ -0,0 +1,75 @@
+# Contributor: Mariusz Libera <mariusz.libera@gmail.com>
+# Contributor: mortdeus <mortdeus@gocos2d.org>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: tobias <tobias@archlinux.org>
+# Contributor: Simon Rutishauser <simon.rutishauser@gmx.ch>
+# Maintainer : Parabola Aurélien DESBRIÈRES <aurelien@hackers.camp>
+
+pkgname=htmldoc
+pkgver=1.8.27
+pkgrel=4
+pkgdesc="Produce PDF or Postscript from HTML documents including TOCs and Indices"
+arch=('i686' 'x86_64')
+url="http://www.htmldoc.org"
+license=('GPL2')
+depends=('libxpm' 'fltk' 'libjpeg' 'openssl' 'shared-mime-info')
+conflicts=('htmldoc-svn')
+changelog=Changelog
+install=$pkgname.install
+source=("http://www.msweet.org/files/project1/htmldoc-${pkgver}-source.tar.gz"
+ 'cve-2009-3050.patch'
+ 'fortify-fail.patch'
+ 'libpng15.patch'
+ 'manpage-fixes.patch'
+ 'useful-build-info.patch')
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # apply patches
+ for patch in ../*.patch ; do
+ patch -Np1 -i $patch
+ done
+
+ # fix desktop file
+ echo "MimeType=application/vnd.htmldoc-book;" >> desktop/htmldoc.desktop
+ sed -i 's/X-Red-Hat.*$//' desktop/htmldoc.desktop
+ sed -i 's/htmldoc.png/htmldoc/' desktop/htmldoc.desktop
+}
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ./configure
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make install \
+ prefix="$pkgdir/usr" \
+ bindir="$pkgdir/usr/bin" \
+ mandir="$pkgdir/usr/share/man"
+
+ # documentation
+ install -m644 \
+ CHANGES.txt \
+ README.txt \
+ "$pkgdir/usr/share/doc/htmldoc"
+
+ # documentation in .ps is way to heavy - this saves ~150M
+ rm "$pkgdir/usr/share/doc/htmldoc/htmldoc.ps"
+
+ # desktop file
+ install -Dm644 desktop/htmldoc.desktop \
+ "$pkgdir/usr/share/applications/htmldoc.desktop"
+
+ # icons
+ for s in 16 24 32 48 64 96 128; do
+ install -Dm644 desktop/htmldoc-${s}.png \
+ "$pkgdir/usr/share/icons/hicolor/${s}x${s}/apps/htmldoc.png"
+ done
+
+ # mime
+ install -Dm644 desktop/htmldoc.xml \
+ "$pkgdir/usr/share/mime/packages/htmldoc.xml"
+}
diff --git a/pcr/htmldoc/cve-2009-3050.patch b/pcr/htmldoc/cve-2009-3050.patch
new file mode 100644
index 000000000..8d0fd173a
--- /dev/null
+++ b/pcr/htmldoc/cve-2009-3050.patch
@@ -0,0 +1,41 @@
+Description: Fix for CVE-2009-3050
+ This patch fixes a buffer overflow when setting custom page output size.
+Author: Giuseppe Iuculano <iuculano@debian.org>
+Bug-Debian: http://bugs.debian.org/537637
+Bug-Gentoo: http://bugs.gentoo.org/show_bug.cgi?id=278186
+Bug: http://www.htmldoc.org/str.php?L214+P0+S0+C0+I0+E0+M1000+Qversion:1.8
+Last-Update: 2011-02-20
+
+--- htmldoc-1.8.27.orig/htmldoc/util.cxx
++++ htmldoc-1.8.27/htmldoc/util.cxx
+@@ -484,7 +484,7 @@ set_page_size(const char *size) /* I - P
+ PageWidth = 595;
+ PageLength = 792;
+ }
+- else if (sscanf(size, "%fx%f%s", &width, &length, units) >= 2)
++ else if (sscanf(size, "%fx%f%254s", &width, &length, units) >= 2)
+ {
+ /*
+ * Custom size...
+--- htmldoc-1.8.27.orig/htmldoc/ps-pdf.cxx
++++ htmldoc-1.8.27/htmldoc/ps-pdf.cxx
+@@ -12512,7 +12512,7 @@ write_type1(FILE *out, /* I - Fil
+ * assigned charset...
+ */
+
+- if (sscanf(line, "%*s%*s%*s%*s%d%*s%*s%s", &width, glyph) != 2)
++ if (sscanf(line, "%*s%*s%*s%*s%d%*s%*s%63s", &width, glyph) != 2)
+ continue;
+
+ for (ch = 0; ch < 256; ch ++)
+--- htmldoc-1.8.27.orig/htmldoc/htmllib.cxx
++++ htmldoc-1.8.27/htmldoc/htmllib.cxx
+@@ -2139,7 +2139,7 @@ htmlLoadFontWidths(void)
+ * assigned charset...
+ */
+
+- if (sscanf(line, "%*s%*s%*s%*s%f%*s%*s%s", &width, glyph) != 2)
++ if (sscanf(line, "%*s%*s%*s%*s%f%*s%*s%63s", &width, glyph) != 2)
+ continue;
+
+ for (ch = 0; ch < 256; ch ++)
diff --git a/pcr/htmldoc/fortify-fail.patch b/pcr/htmldoc/fortify-fail.patch
new file mode 100644
index 000000000..32ec88735
--- /dev/null
+++ b/pcr/htmldoc/fortify-fail.patch
@@ -0,0 +1,21 @@
+diff -ur htmldoc-1.8.27~/htmldoc/ps-pdf.cxx htmldoc-1.8.27/htmldoc/ps-pdf.cxx
+--- htmldoc-1.8.27~/htmldoc/ps-pdf.cxx 2009-08-13 19:32:21.846860508 -0400
++++ htmldoc-1.8.27/htmldoc/ps-pdf.cxx 2009-08-13 19:40:29.185857503 -0400
+@@ -8619,7 +8619,7 @@
+ return (NULL);
+ }
+ // Safe because buffer is allocated...
+- strcpy((char *)r->data.text.buffer, (char *)data);
++ memcpy((char *)r->data.text.buffer, (char *)data, strlen((char *)data));
+ get_color(_htmlTextColor, r->data.text.rgb);
+ break;
+ case RENDER_IMAGE :
+@@ -8640,7 +8640,7 @@
+ return (NULL);
+ }
+ // Safe because buffer is allocated...
+- strcpy((char *)r->data.link, (char *)data);
++ memcpy((char *)r->data.link, (char *)data, strlen((char *)data));
+ break;
+ }
+
diff --git a/pcr/htmldoc/htmldoc.install b/pcr/htmldoc/htmldoc.install
new file mode 100644
index 000000000..f1b73efac
--- /dev/null
+++ b/pcr/htmldoc/htmldoc.install
@@ -0,0 +1,13 @@
+post_install() {
+ update-desktop-database -q
+ update-mime-database /usr/share/mime &> /dev/null
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/pcr/htmldoc/libpng15.patch b/pcr/htmldoc/libpng15.patch
new file mode 100644
index 000000000..02f1d2330
--- /dev/null
+++ b/pcr/htmldoc/libpng15.patch
@@ -0,0 +1,122 @@
+Description: libpng 1.5 fixes
+ This patch fixes incompatibilities with libpng 1.5.
+Bug: http://www.htmldoc.org/str.php?L243+Qversion:1.8
+Origin: http://www.htmldoc.org/str.php?F243+P0+S-2+C0+I0+E0+M10+Qversion%3A1.8
+Forwarded: not-needed
+Last-Update: 2011-12-04
+
+Index: htmldoc-1.8.27/htmldoc/image.cxx
+===================================================================
+--- htmldoc-1.8.27.orig/htmldoc/image.cxx 2011-12-04 22:32:01.000000000 -0500
++++ htmldoc-1.8.27/htmldoc/image.cxx 2011-12-04 22:35:32.000000000 -0500
+@@ -1472,6 +1472,9 @@
+ png_bytep *rows; /* PNG row pointers */
+ uchar *inptr, /* Input pixels */
+ *outptr; /* Output pixels */
++ png_bytep trans_alpha;
++ int num_trans;
++ png_color_16p trans_color;
+
+
+ /*
+@@ -1499,7 +1502,7 @@
+
+ rows = NULL;
+
+- if (setjmp(pp->jmpbuf))
++ if (setjmp(png_jmpbuf(pp)))
+ {
+ progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!");
+
+@@ -1526,7 +1529,7 @@
+
+ png_read_info(pp, info);
+
+- if (info->color_type & PNG_COLOR_MASK_PALETTE)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
+ {
+ png_set_expand(pp);
+
+@@ -1535,15 +1538,15 @@
+ if (Encryption)
+ img->use ++;
+ }
+- else if (info->bit_depth < 8)
++ else if (png_get_bit_depth(pp, info) < 8)
+ {
+ png_set_packing(pp);
+ png_set_expand(pp);
+ }
+- else if (info->bit_depth == 16)
++ else if (png_get_bit_depth(pp, info) == 16)
+ png_set_strip_16(pp);
+
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ {
+ depth = 3;
+ img->depth = gray ? 1 : 3;
+@@ -1554,10 +1557,11 @@
+ img->depth = 1;
+ }
+
+- img->width = info->width;
+- img->height = info->height;
++ img->width = png_get_image_width(pp, info);
++ img->height = png_get_image_height(pp, info);
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ png_get_tRNS(pp, info, &trans_alpha, &num_trans, &trans_color);
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ {
+ if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3)
+ image_need_mask(img, 8);
+@@ -1571,14 +1575,14 @@
+
+ #ifdef DEBUG
+ printf("color_type=0x%04x, depth=%d, img->width=%d, img->height=%d, img->depth=%d\n",
+- info->color_type, depth, img->width, img->height, img->depth);
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
++ png_get_color_type(pp, info), depth, img->width, img->height, img->depth);
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ puts(" COLOR");
+ else
+ puts(" GRAYSCALE");
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ puts(" ALPHA");
+- if (info->color_type & PNG_COLOR_MASK_PALETTE)
++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_PALETTE)
+ puts(" PALETTE");
+ #endif // DEBUG
+
+@@ -1594,9 +1598,9 @@
+ * Allocate pointers...
+ */
+
+- rows = (png_bytep *)calloc(info->height, sizeof(png_bytep));
++ rows = (png_bytep *)calloc(png_get_image_height(pp, info), sizeof(png_bytep));
+
+- for (i = 0; i < (int)info->height; i ++)
++ for (i = 0; i < (int)png_get_image_height(pp, info); i ++)
+ rows[i] = img->pixels + i * img->width * depth;
+
+ /*
+@@ -1610,7 +1614,7 @@
+ * Generate the alpha mask as necessary...
+ */
+
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans)
+ {
+ #ifdef DEBUG
+ for (inptr = img->pixels, i = 0; i < img->height; i ++)
+@@ -1639,7 +1643,7 @@
+ * Reformat the data as necessary for the reader...
+ */
+
+- if (gray && info->color_type & PNG_COLOR_MASK_COLOR)
++ if (gray && png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR)
+ {
+ /*
+ * Greyscale output needed...
diff --git a/pcr/htmldoc/manpage-fixes.patch b/pcr/htmldoc/manpage-fixes.patch
new file mode 100644
index 000000000..8a47b8470
--- /dev/null
+++ b/pcr/htmldoc/manpage-fixes.patch
@@ -0,0 +1,42 @@
+Description: Documentation fixes
+ This patch gives us a complete documentation build, and also fixes
+ some minor inaccuracies in the docs.
+Author: Jeff Licquia <licquia@debian.org>
+Last-Update: 2011-02-20
+
+--- htmldoc-1.8.27.orig/doc/Makefile
++++ htmldoc-1.8.27/doc/Makefile
+@@ -40,7 +40,7 @@ SOURCES = intro.html 1-install.html 2-st
+ d-compile.html
+
+ DOCUMENTS = htmldoc.html htmldoc.pdf htmldoc.ps
+-DOCFILES = help.html htmldoc.pdf
++DOCFILES = help.html htmldoc.pdf htmldoc.html htmldoc.ps
+
+ HTMLDOC = ../htmldoc/htmldoc$(EXEEXT) --datadir .. --strict --verbose
+
+--- htmldoc-1.8.27.orig/doc/htmldoc.man
++++ htmldoc-1.8.27/doc/htmldoc.man
+@@ -80,9 +80,11 @@ Specifies the bottom margin in points (n
+ (##in), centimeters (##cm), or millimeters (##mm).
+
+ .TP 5
+---charset \fI{8859-1...8859-15}\fR
++--charset \fIcharset-id\fR
+ .br
+-Specifies the ISO character set to use for the output.
++Specifies the ISO character set to use for the output. Supported
++charsets include some Windows code pages (cp-###), ISO 8859 sets
++1-9, 14, and 15 (iso8859-##), and koi8-r.
+
+ .TP 5
+ --color
+@@ -579,7 +581,7 @@ program.
+ .SH SEE ALSO
+ HTMLDOC Software Users Manual
+ .LP
+-http://www.easysw.com/htmldoc/
++http://www.htmldoc.org/documentation.php
+ .SH AUTHOR
+ Michael Sweet, Easy Software Products
+ .SH TRADEMARKS
diff --git a/pcr/htmldoc/useful-build-info.patch b/pcr/htmldoc/useful-build-info.patch
new file mode 100644
index 000000000..a6e33d1ef
--- /dev/null
+++ b/pcr/htmldoc/useful-build-info.patch
@@ -0,0 +1,25 @@
+Description: Build system patch
+ This patch makes the build system print useful information in case of
+ a build failure.
+Author: Jeff Licquia <licquia@debian.org>
+Forwarded: not-needed
+Last-Update: 2011-02-20
+
+Index: htmldoc-1.8.27/Makedefs.in
+===================================================================
+--- htmldoc-1.8.27.orig/Makedefs.in 2011-02-20 12:18:13.000000000 -0500
++++ htmldoc-1.8.27/Makedefs.in 2011-02-20 12:18:33.000000000 -0500
+@@ -81,13 +81,10 @@
+ # Rules...
+ #
+
+-.SILENT:
+ .SUFFIXES: .a .c .cxx .h .o
+ .c.o:
+- echo Compiling $<...
+ $(CC) $(CFLAGS) -c $<
+ .cxx.o:
+- echo Compiling $<...
+ $(CXX) $(CXXFLAGS) -c $<
+
+ #