SHA256
1
0
forked from pool/htmldoc

Accepting request 287778 from home:benoit_monin:branches:Publishing

- update to version 1.8.28
- add source url
- drop the following patches after upstream fix:
  * htmldoc_CVE-2009-3050_535943.diff
  * htmldoc-fortify.diff
  * htmldoc-libpng15.diff
  * htmldoc-link-x11.patch
- refresh patch htmldoc-docpath.diff
- add patch htmldoc-cups_rand.patch to work around a build error
  (upstream bug #510)
- remove now unused --with-fltk configure options
- set datadir for make install
- do not package doc/ source directory: documentation is already
  provided by htmldoc.pdf
- remove COMPILE.txt from doc: useless in a rpm
- add -q to %setup to avoid spamming the build log

OBS-URL: https://build.opensuse.org/request/show/287778
OBS-URL: https://build.opensuse.org/package/show/Publishing/htmldoc?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal 2015-03-02 14:34:58 +00:00 committed by Git OBS Bridge
parent d015178ff0
commit 859e1a4643
10 changed files with 76 additions and 219 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:89ffd223734268375dc959c200622dc5f167576c5cad9d7ce4bd7567faeb9613
size 3960271

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a688bd820ad6f7bdebb274716102dafbf4d5fcfa20a5b8d87a56b030d184732
size 4026568

20
htmldoc-cups_rand.patch Normal file
View File

@ -0,0 +1,20 @@
bug#510: Fix undefined symbols CUPS_SRAND and CUPS_RAND
https://www.msweet.org/bugs.php?U510
Index: htmldoc-1.8.28/htmldoc/http.c
===================================================================
--- htmldoc-1.8.28.orig/htmldoc/http.c
+++ htmldoc-1.8.28/htmldoc/http.c
@@ -1229,10 +1229,10 @@ httpInitialize(void)
* it is the best we can do (on others, this seed isn't even used...)
*/
- CUPS_SRAND(time(NULL));
+ srand(time(NULL));
for (i = 0; i < sizeof(data); i ++)
- data[i] = CUPS_RAND();
+ data[i] = rand();
RAND_seed(data, sizeof(data));
#endif /* HAVE_GNUTLS */

View File

@ -5,7 +5,7 @@ Index: config.h.in
===================================================================
--- config.h.in.orig
+++ config.h.in
@@ -54,7 +54,7 @@
@@ -42,7 +42,7 @@
* Locations of files...
*/
@ -14,36 +14,23 @@ Index: config.h.in
#define HTML_DATA "/usr/share/htmldoc"
Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -316,7 +316,7 @@ if test "$bindir" = "\${exec_prefix}/bin
bindir="$exec_prefix/bin"
fi
-AC_DEFINE_UNQUOTED(DOCUMENTATION, "$prefix/share/doc/htmldoc")
+AC_DEFINE_UNQUOTED(DOCUMENTATION, "$prefix/share/doc/packages/htmldoc/doc")
AC_DEFINE_UNQUOTED(HTML_DATA, "$prefix/share/htmldoc")
dnl Update compiler options...
Index: doc/Makefile
===================================================================
--- doc/Makefile.orig
+++ doc/Makefile
@@ -57,11 +57,11 @@ all: $(DOCUMENTS)
@@ -44,11 +44,11 @@ all: $(DOCUMENTS)
#
install: $(DOCUMENTS)
- if [ ! -d $(datadir)/doc/htmldoc ]; then\
- if test ! -d $(datadir)/doc/htmldoc; then\
- $(MKDIR) $(datadir)/doc/htmldoc;\
+ if [ ! -d $(datadir)/doc/packages/htmldoc ]; then\
+ if test ! -d $(datadir)/doc/packages/htmldoc; then\
+ $(MKDIR) $(datadir)/doc/packages/htmldoc;\
fi
- $(CP) $(DOCFILES) $(datadir)/doc/htmldoc
- $(CHMOD) ugo+r $(datadir)/doc/htmldoc/*
+ $(CP) $(DOCFILES) $(datadir)/doc/packages/htmldoc
+ $(CHMOD) ugo+r $(datadir)/doc/packages/htmldoc/*
if [ ! -d $(mandir)/man1 ]; then\
if test ! -d $(mandir)/man1; then\
$(MKDIR) $(mandir)/man1;\
fi

View File

@ -1,11 +0,0 @@
--- ./htmldoc/ps-pdf.cxx.orig 2010-02-15 11:13:11.000000000 +0100
+++ ./htmldoc/ps-pdf.cxx 2010-02-15 11:17:02.000000000 +0100
@@ -8615,7 +8615,7 @@
return (NULL);
}
// Safe because buffer is allocated...
- strcpy((char *)r->data.text.buffer, (char *)data);
+ memcpy((char *)r->data.text.buffer, data, strlen ((char *)data) + 1);
get_color(_htmlTextColor, r->data.text.rgb);
break;
case RENDER_IMAGE :

View File

@ -1,114 +0,0 @@
http://lists.pld-linux.org/mailman/pipermail/pld-cvs-commit/Week-of-Mon-20120206/332669.html
--- htmldoc/image.cxx.orig Wed May 31 13:00:02 2006
+++ htmldoc/image.cxx Wed Jul 6 15:22:43 2011
@@ -1472,6 +1472,9 @@ image_load_png(image_t *img, /* I - Image pointer */
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 @@ image_load_png(image_t *img, /* I - Image pointer */
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 @@ image_load_png(image_t *img, /* I - Image pointer */
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 @@ image_load_png(image_t *img, /* I - Image pointer */
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 @@ image_load_png(image_t *img, /* I - Image pointer */
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 @@ image_load_png(image_t *img, /* I - Image pointer */
#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 @@ image_load_png(image_t *img, /* I - Image pointer */
* 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 @@ image_load_png(image_t *img, /* I - Image pointer */
* 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 @@ image_load_png(image_t *img, /* I - Image pointer */
* 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...

View File

@ -1,12 +0,0 @@
Index: htmldoc-1.8.27/configure.in
===================================================================
--- htmldoc-1.8.27.orig/configure.in
+++ htmldoc-1.8.27/configure.in
@@ -294,6 +294,7 @@ if test "x$with_gui" != xno; then
POST="$FLTKCONFIG --post"
AC_CHECK_LIB(Xpm,XpmCreatePixmapFromData)
+ AC_CHECK_LIB(X11,XCreateBitmapFromData)
else
AC_MSG_WARN(FLTK not available so no GUI will be built.)
fi

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Wed Feb 25 19:49:30 UTC 2015 - benoit.monin@gmx.fr
- update to version 1.8.28:
* Updated default PDF version to 1.4.
* SECURITY: Fixed three buffer overflow issues when reading AFM
files and parsing page sizes.
* Fixed incompatibility with Fortify's version of strcpy, which
does not work properly with variable-length arrays (STR #235)
* Fixed compilation against PNG library 1.5 or later (STR #243)
* Fixed documentation errors (PR #6593, PR #6595)
* Marked Zapf-Dingbats as a standard font (STR #198)
* Fixed GPL license text in GUI (STR #222)
* Fixed a table formatting problem when a column has multiple
colspan values (PR #6709)
* Fixed parsing of HTML comments (STR #181)
* Fixed potential out-of-bounds read in table-of-contents
rendering code (STR #183)
* Fixed handling of image URLs with ampersands in them (STR #186)
* Fixed top/bottom margins for logo and header/footer images
(STR #174)
* Fixed image alignment bug (Bug #231)
* Fixed X11 build problem (Bug #243)
- add source url
- drop the following patches after upstream fix:
* htmldoc_CVE-2009-3050_535943.diff
* htmldoc-fortify.diff
* htmldoc-libpng15.diff
* htmldoc-link-x11.patch
- refresh patch htmldoc-docpath.diff
- add patch htmldoc-cups_rand.patch to work around a build error
(upstream bug #510)
- remove now unused --with-fltk configure options
- set datadir for make install
- do not package doc/ source directory: documentation is already
provided by htmldoc.pdf
- remove COMPILE.txt from doc: useless in a rpm
- add -q to %setup to avoid spamming the build log
-------------------------------------------------------------------
Fri Apr 19 22:57:21 UTC 2013 - dimstar@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package htmldoc
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -26,18 +26,15 @@ BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: openssl-devel
Url: http://htmldoc.org/
Version: 1.8.27
Version: 1.8.28
Release: 0
Summary: HTML Processor that Generates HTML, PostScript, and PDF Files
License: LGPL-2.1+
Group: Productivity/Publishing/HTML/Tools
Source: %{name}-%{version}-source.tar.bz2
Source: http://www.msweet.org/files/project1/%{name}-%{version}-source.tar.bz2
Patch: %{name}-docpath.diff
Patch1: htmldoc_CVE-2009-3050_535943.diff
Patch2: htmldoc-fortify.diff
# link to libpng15.patch sent to mike@easysw.com
Patch3: htmldoc-libpng15.diff
Patch4: htmldoc-link-x11.patch
# PATCH-FIX-UPSTREAM htmldoc-cups_rand.patch upstream bug #510
Patch1: htmldoc-cups_rand.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define DOCDIR %{_datadir}/doc/packages/%{name}
@ -47,12 +44,9 @@ Portable Document Format (PDF) files that can be viewed online or
printed.
%prep
%setup
%setup -q
%patch
%patch1 -p1
%patch2
%patch3
%patch4 -p1
%build
export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
@ -61,28 +55,23 @@ autoconf
--bindir=%{_bindir} \
--prefix=%{_usr} \
--mandir=%{_mandir} \
--with-fltk-libs=/usr/X11R6/lib \
--with-fltk-includes=/usr/X11R6/include \
--with-gui
make
%install
[ x"${RPM_BUILD_ROOT}" = x"/" ] && ( echo "your buildroot is /" && exit 0) || rm -rf "${RPM_BUILD_ROOT}"
mkdir -p \
${RPM_BUILD_ROOT}/%{_bindir} \
${RPM_BUILD_ROOT}/%{_mandir}
make \
bindir=${RPM_BUILD_ROOT}/%{_bindir} \
prefix=${RPM_BUILD_ROOT}/%{_usr} \
mandir=${RPM_BUILD_ROOT}/%{_mandir} \
install
rm -v doc/Makefile
datadir=${RPM_BUILD_ROOT}/%{_datadir} \
install
%files
%defattr(-,root,root)
%{_bindir}/htmldoc
%{_datadir}/htmldoc
%doc %{_mandir}/man1/htmldoc.1.gz
%doc doc/ cgi-bin/ CHANGES.txt COMPILE.txt COPYING.txt README.txt
%doc cgi-bin/ CHANGES.txt COPYING.txt README.txt
%changelog

View File

@ -1,41 +0,0 @@
Fix several insecure calls to sscanf(), bug 278186.
Index: htmldoc-1.8.27/htmldoc/htmllib.cxx
===================================================================
--- 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 ++)
Index: htmldoc-1.8.27/htmldoc/ps-pdf.cxx
===================================================================
--- 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 ++)
Index: htmldoc-1.8.27/htmldoc/util.cxx
===================================================================
--- 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...