aboutsummaryrefslogtreecommitdiff
path: root/textproc/htmldoc
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2014-01-29 20:18:52 +0000
committerMatthias Andree <mandree@FreeBSD.org>2014-01-29 20:18:52 +0000
commit01abf783d2fc93e5ebc4c473b9680bb445b2aafd (patch)
treeb79f92667f13a655fa2a0ae2ae1ff9b79c413481 /textproc/htmldoc
parent0d6a9109e8f8bfaa006edfe4b1fa2d7d450d751e (diff)
downloadports-01abf783d2fc93e5ebc4c473b9680bb445b2aafd.tar.gz
ports-01abf783d2fc93e5ebc4c473b9680bb445b2aafd.zip
Upgrade to HTMLDOC 1.8.28, fixing security-relevant bugs.
Support staging, and modernize LIB_DEPENDS. Tweak build environment to get proper detection of png/jpeg libs. Switch to using BZIP2 tarballs. PR: ports/186024 Approved by: jose@diasfernandes.pt (maintainer) Security: 6d08fa63-83bf-11e3-bdba-080027ef73ec
Notes
Notes: svn path=/head/; revision=341774
Diffstat (limited to 'textproc/htmldoc')
-rw-r--r--textproc/htmldoc/Makefile30
-rw-r--r--textproc/htmldoc/distinfo4
-rw-r--r--textproc/htmldoc/files/patch-htmldoc__http-private.h25
-rw-r--r--textproc/htmldoc/files/patch-htmldoc__http.c11
-rw-r--r--textproc/htmldoc/files/patch-htmldoc__image.cxx10
-rw-r--r--textproc/htmldoc/files/patch-htmldoc__ps-pdf.cxx (renamed from textproc/htmldoc/files/patch-openssl)120
-rw-r--r--textproc/htmldoc/files/patch-image.cxx19
-rw-r--r--textproc/htmldoc/pkg-plist1
8 files changed, 140 insertions, 80 deletions
diff --git a/textproc/htmldoc/Makefile b/textproc/htmldoc/Makefile
index 51c7b3682336..79ffdb62e933 100644
--- a/textproc/htmldoc/Makefile
+++ b/textproc/htmldoc/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= htmldoc
-PORTVERSION= 1.8.27
-PORTREVISION= 7
+PORTVERSION= 1.8.28
CATEGORIES= textproc
MASTER_SITES= http://www.msweet.org/files/project1/ \
${MASTER_SITE_EASYSW}
@@ -13,25 +12,27 @@ DISTNAME= ${PORTNAME}-${PORTVERSION}-source
MAINTAINER= jose@diasfernandes.pt
COMMENT= Converts HTML to PDF and/or PostScript
-LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg \
- png15:${PORTSDIR}/graphics/png
+LICENSE= GPLv2
+
+LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \
+ libpng15.so:${PORTSDIR}/graphics/png
OPTIONS_DEFINE= HTMLDOCGUI
HTMLDOCGUI_DESC= Build GUI front-end
-# .bz2 file is available since Aug 2, but we don't want to
-# start mirroring _in addition to_ the .gz variant. When the
-# vendor's release is updated again, we should switch to .bz2
-#USE_BZIP2= yes
+USE_BZIP2= yes
GNU_CONFIGURE= yes
-NO_STAGE= yes
# Configure seems broken and ignores these ATM:
-CONFIGURE_ARGS+=--enable-localjpeg --enable-localzlib --enable-localpng
+CONFIGURE_ARGS+=--disable-localjpeg --disable-localzlib --disable-localpng
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
EXCLUDE= png jpeg zlib htmldoc/md5* htmldoc/rc4* htmldoc/snprintf*
EXTRACT_AFTER_ARGS=${EXCLUDE:S,^,--exclude ,}
+INSTALL_TARGET= install \
+ bindir=${STAGEDIR}${PREFIX}/bin \
+ datadir=${STAGEDIR}${PREFIX}/share \
+ mandir=${STAGEDIR}${MANPREFIX}/man
+LDFLAGS+= -L${LOCALBASE}/lib
-MAN1= htmldoc.1
post-patch:
${REINPLACE_CMD} -e 's,@JPEG@ @ZLIB@ @PNG@ ,,' ${WRKSRC}/Makefile.in
${REINPLACE_CMD} -e 's|@LDFLAGS@|-L${LOCALBASE}/lib @LDFLAGS@|' \
@@ -40,13 +41,18 @@ post-patch:
# Remove redundant code:
${REINPLACE_CMD} -Ee 's,(md5|snprintf|rc4)\.o,,g' \
${WRKSRC}/htmldoc/Makefile
+ ${REINPLACE_CMD} -Ee 's,md5-private\.h,,;s,rc4\.h,,' \
+ ${WRKSRC}/htmldoc/Dependencies
post-configure:
${REINPLACE_CMD} -e \
's|../png/libpng.a ../zlib/libz.a ../jpeg/libjpeg.a|-ljpeg -lpng -lz|' ${WRKSRC}/Makedefs
-.include <bsd.port.pre.mk>
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/htmldoc
+
.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MHTMLDOCGUI}
LIB_DEPENDS+= fltk:${PORTSDIR}/x11-toolkits/fltk
diff --git a/textproc/htmldoc/distinfo b/textproc/htmldoc/distinfo
index 1174bcc74c96..fb53132c104d 100644
--- a/textproc/htmldoc/distinfo
+++ b/textproc/htmldoc/distinfo
@@ -1,2 +1,2 @@
-SHA256 (htmldoc-1.8.27-source.tar.gz) = 64f6d9f40f00f9cc68df6508123e88ed30fef924881fd28dca45358ecd79d320
-SIZE (htmldoc-1.8.27-source.tar.gz) = 4462252
+SHA256 (htmldoc-1.8.28-source.tar.bz2) = 2a688bd820ad6f7bdebb274716102dafbf4d5fcfa20a5b8d87a56b030d184732
+SIZE (htmldoc-1.8.28-source.tar.bz2) = 4026568
diff --git a/textproc/htmldoc/files/patch-htmldoc__http-private.h b/textproc/htmldoc/files/patch-htmldoc__http-private.h
new file mode 100644
index 000000000000..56f45d65a166
--- /dev/null
+++ b/textproc/htmldoc/files/patch-htmldoc__http-private.h
@@ -0,0 +1,25 @@
+--- ./htmldoc/http-private.h.orig 2011-12-30 08:41:10.000000000 +0100
++++ ./htmldoc/http-private.h 2014-01-28 04:47:41.000000000 +0100
+@@ -83,12 +83,12 @@
+ # endif /* __sgi || (__APPLE__ && !_SOCKLEN_T) */
+
+ # include "http.h"
+-# include "md5-private.h"
+
+ # if defined HAVE_LIBSSL
+ # include <openssl/err.h>
+ # include <openssl/rand.h>
+ # include <openssl/ssl.h>
++# include <openssl/md5.h>
+ # elif defined HAVE_GNUTLS
+ # include <gnutls/gnutls.h>
+ # include <gnutls/x509.h>
+@@ -276,7 +276,7 @@
+ char buffer[HTTP_MAX_BUFFER];
+ /* Buffer for incoming data */
+ int auth_type; /* Authentication in use */
+- _cups_md5_state_t md5_state; /* MD5 state */
++ MD5_CTX md5_state; /* MD5 state */
+ char nonce[HTTP_MAX_VALUE];
+ /* Nonce value */
+ int nonce_count; /* Nonce count */
diff --git a/textproc/htmldoc/files/patch-htmldoc__http.c b/textproc/htmldoc/files/patch-htmldoc__http.c
new file mode 100644
index 000000000000..642469c2303e
--- /dev/null
+++ b/textproc/htmldoc/files/patch-htmldoc__http.c
@@ -0,0 +1,11 @@
+--- ./htmldoc/http.c.orig 2014-01-05 21:41:32.000000000 +0100
++++ ./htmldoc/http.c 2014-01-28 04:47:07.000000000 +0100
+@@ -1228,6 +1228,8 @@
+ * Using the current time is a dubious random seed, but on some systems
+ * it is the best we can do (on others, this seed isn't even used...)
+ */
++#define CUPS_RAND() arc4random()
++#define CUPS_SRAND(v) arc4random_stir()
+
+ CUPS_SRAND(time(NULL));
+
diff --git a/textproc/htmldoc/files/patch-htmldoc__image.cxx b/textproc/htmldoc/files/patch-htmldoc__image.cxx
new file mode 100644
index 000000000000..36d253bf3852
--- /dev/null
+++ b/textproc/htmldoc/files/patch-htmldoc__image.cxx
@@ -0,0 +1,10 @@
+--- ./htmldoc/image.cxx.orig 2013-08-09 04:53:39.000000000 +0200
++++ ./htmldoc/image.cxx 2014-01-28 04:47:41.000000000 +0100
+@@ -44,6 +44,7 @@
+ }
+
+ #include <png.h> /* Portable Network Graphics (PNG) definitions */
++#include <pngpriv.h>
+
+
+ /*
diff --git a/textproc/htmldoc/files/patch-openssl b/textproc/htmldoc/files/patch-htmldoc__ps-pdf.cxx
index d624d5c324b4..07483c9f04ff 100644
--- a/textproc/htmldoc/files/patch-openssl
+++ b/textproc/htmldoc/files/patch-htmldoc__ps-pdf.cxx
@@ -1,20 +1,23 @@
-Don't build/use our own (Alladin's rather) MD5 and RC4 code. Use
-OpenSSL's -- we link with OpenSSL anyway...
-
- -mi
-
---- htmldoc/ps-pdf.cxx Tue Aug 1 12:58:50 2006
-+++ htmldoc/ps-pdf.cxx Tue Apr 3 00:26:54 2007
-@@ -136,6 +136,6 @@
+--- ./htmldoc/ps-pdf.cxx.orig 2014-01-06 04:42:43.000000000 +0100
++++ ./htmldoc/ps-pdf.cxx 2014-01-28 04:47:41.000000000 +0100
+@@ -120,13 +120,9 @@
+
/*#define DEBUG*/
#include "htmldoc.h"
--#include "md5.h"
+-#include "md5-private.h"
+-#define md5_append _cupsMD5Append
+-#define md5_finish _cupsMD5Finish
+-#define md5_init _cupsMD5Init
+ typedef unsigned char md5_byte_t;
+-#define md5_state_t _cups_md5_state_t
-#include "rc4.h"
+#include <openssl/md5.h>
+#include <openssl/rc4.h>
#include <stdarg.h>
#include <ctype.h>
-@@ -342,6 +342,6 @@
+ #include <time.h>
+@@ -331,8 +327,8 @@
+ static uchar comp_buffer[8192];
static uchar encrypt_key[16];
static int encrypt_len;
-static rc4_context_t encrypt_state;
@@ -23,14 +26,18 @@ OpenSSL's -- we link with OpenSSL anyway...
+static unsigned char file_id[16];
-@@ -10582,5 +10582,5 @@
+ /*
+@@ -10545,7 +10541,7 @@
+ {
// Encrypt the colormap...
encrypt_init();
- rc4_encrypt(&encrypt_state, cmap[0], cmap[0], ncolors * 3);
+ RC4(&encrypt_state, ncolors * 3, cmap[0], cmap[0]);
}
-@@ -11203,7 +11203,7 @@
+ fprintf(out, "/ColorSpace[/Indexed/DeviceRGB %d<", ncolors - 1);
+@@ -11166,9 +11162,9 @@
+ int font_desc[TYPE_MAX][STYLE_MAX];
/* Font descriptor objects */
char temp[1024]; /* Temporary string */
- md5_state_t md5; /* MD5 state */
@@ -41,7 +48,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ RC4_KEY rc4; /* RC4 context */
uchar owner_pad[32], /* Padded owner password */
owner_key[32], /* Owner key */
-@@ -11604,8 +11604,8 @@
+ user_pad[32], /* Padded user password */
+@@ -11568,10 +11564,10 @@
+ * Compute the file ID...
*/
- md5_init(&md5);
@@ -54,7 +63,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(file_id, &md5);
/*
-@@ -11663,7 +11663,7 @@
+ * Setup encryption stuff as necessary...
+@@ -11627,18 +11623,18 @@
+ * Compute the owner key...
*/
- md5_init(&md5);
@@ -65,7 +76,8 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(digest, &md5);
if (encrypt_len > 5)
-@@ -11672,7 +11672,7 @@
+ {
+ // MD5 the result 50 more times...
for (i = 0; i < 50; i ++)
{
- md5_init(&md5);
@@ -76,7 +88,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(digest, &md5);
}
-@@ -11687,12 +11687,12 @@
+ // Copy the padded user password...
+@@ -11651,14 +11647,14 @@
+ for (j = 0; j < encrypt_len; j ++)
encrypt_key[j] = digest[j] ^ i;
- rc4_init(&rc4, encrypt_key, encrypt_len);
@@ -93,7 +107,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ RC4(&rc4, 32, user_pad, owner_key);
}
-@@ -11716,7 +11716,7 @@
+ /*
+@@ -11680,27 +11676,27 @@
+ * Compute the encryption key...
*/
- md5_init(&md5);
@@ -104,7 +120,8 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Update(&md5, owner_key, 32);
perm_bytes[0] = perm_value;
-@@ -11725,7 +11725,7 @@
+ perm_bytes[1] = perm_value >> 8;
+ perm_bytes[2] = perm_value >> 16;
perm_bytes[3] = perm_value >> 24;
- md5_append(&md5, perm_bytes, 4);
@@ -115,7 +132,8 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(digest, &md5);
if (encrypt_len > 5)
-@@ -11734,7 +11734,7 @@
+ {
+ // MD5 the result 50 times..
for (i = 0; i < 50; i ++)
{
- md5_init(&md5);
@@ -126,7 +144,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(digest, &md5);
}
}
-@@ -11748,8 +11748,8 @@
+
+@@ -11712,10 +11708,10 @@
+
if (encrypt_len > 5)
{
- md5_init(&md5);
@@ -139,7 +159,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(user_key, &md5);
memset(user_key + 16, 0, 16);
-@@ -11762,12 +11762,12 @@
+
+@@ -11726,14 +11722,14 @@
+ for (j = 0; j < encrypt_len; j ++)
digest[j] = encrypt_key[j] ^ i;
- rc4_init(&rc4, digest, encrypt_len);
@@ -156,28 +178,36 @@ OpenSSL's -- we link with OpenSSL anyway...
+ RC4(&rc4, 32, pad, user_key);
}
-@@ -11956,5 +11956,5 @@
+ /*
+@@ -11920,7 +11916,7 @@
+ else
bytes = len;
- rc4_encrypt(&encrypt_state, s, news, bytes);
+ RC4(&encrypt_state, bytes, s, news);
for (i = 0; i < bytes; i ++)
-@@ -12619,5 +12619,5 @@
+ fprintf(out, "%02x", news[i]);
+@@ -12585,7 +12581,7 @@
+ unicode[0] = 0xfe; // Start with BOM
unicode[1] = 0xff;
- rc4_encrypt(&encrypt_state, unicode, enicode, 2);
+ RC4(&encrypt_state, 2, unicode, enicode);
fprintf(out, "%02x%02x", enicode[0], enicode[1]);
-@@ -12629,5 +12629,5 @@
+
+@@ -12595,7 +12591,7 @@
+ unicode[0] = ch >> 8;
unicode[1] = ch;
- rc4_encrypt(&encrypt_state, unicode, enicode, 2);
+ RC4(&encrypt_state, 2, unicode, enicode);
fprintf(out, "%02x%02x", enicode[0], enicode[1]);
-@@ -12661,6 +12661,6 @@
+ }
+@@ -12627,8 +12623,8 @@
+ int i; /* Looping var */
uchar data[21], /* Key data */
*dataptr; /* Pointer to key data */
- md5_state_t md5; /* MD5 state */
@@ -186,7 +216,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ unsigned char digest[16]; /* MD5 digest value */
-@@ -12682,7 +12682,7 @@
+ /*
+@@ -12648,18 +12644,18 @@
+ * Hash it...
*/
- md5_init(&md5);
@@ -197,7 +229,8 @@ OpenSSL's -- we link with OpenSSL anyway...
+ MD5_Final(digest, &md5);
/*
-@@ -12691,7 +12691,7 @@
+ * Initialize the RC4 context using the first N+5 bytes of the digest...
+ */
if (encrypt_len > 11)
- rc4_init(&encrypt_state, digest, 16);
@@ -207,7 +240,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ RC4_set_key(&encrypt_state, encrypt_len + 5, digest);
}
-@@ -12761,6 +12761,6 @@
+
+@@ -12727,8 +12723,8 @@
+ else
{
if (Encryption)
- rc4_encrypt(&encrypt_state, comp_buffer, comp_buffer,
@@ -216,7 +251,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ comp_buffer, comp_buffer);
fwrite(comp_buffer, (uchar *)compressor.next_out - (uchar *)comp_buffer,
-@@ -12785,6 +12785,6 @@
+ 1, out);
+@@ -12751,8 +12747,8 @@
+ else
{
if (Encryption)
- rc4_encrypt(&encrypt_state, comp_buffer, comp_buffer,
@@ -225,7 +262,9 @@ OpenSSL's -- we link with OpenSSL anyway...
+ comp_buffer, comp_buffer);
fwrite(comp_buffer, (uchar *)compressor.next_out - (uchar *)comp_buffer,
-@@ -12878,6 +12878,6 @@
+ 1, out);
+@@ -12844,8 +12840,8 @@
+ else
{
if (Encryption)
- rc4_encrypt(&encrypt_state, comp_buffer, comp_buffer,
@@ -234,26 +273,13 @@ OpenSSL's -- we link with OpenSSL anyway...
+ comp_buffer, comp_buffer);
fwrite(comp_buffer,
-@@ -12912,5 +12912,5 @@
+ (uchar *)compressor.next_out - (uchar *)comp_buffer, 1, out);
+@@ -12878,7 +12874,7 @@
+ if ((bytes = length - i) > (int)sizeof(newbuf))
bytes = sizeof(newbuf);
- rc4_encrypt(&encrypt_state, buf + i, newbuf, bytes);
+ RC4(&encrypt_state, bytes, buf + i, newbuf);
fwrite(newbuf, bytes, 1, out);
}
---- htmldoc/http.h Mon Apr 3 11:41:08 2006
-+++ htmldoc/http.h Tue Apr 3 00:24:01 2007
-@@ -61,5 +61,5 @@
- # endif /* WIN32 */
-
--# include "md5.h"
-+# include <openssl/md5.h>
-
- /*
-@@ -345,5 +345,5 @@
- /* Buffer for incoming data */
- int auth_type; /* Authentication in use */
-- md5_state_t md5_state; /* MD5 state */
-+ MD5_CTX md5_state; /* MD5 state */
- char nonce[HTTP_MAX_VALUE];
- /* Nonce value */
+ }
diff --git a/textproc/htmldoc/files/patch-image.cxx b/textproc/htmldoc/files/patch-image.cxx
deleted file mode 100644
index 7aba1dfbf53b..000000000000
--- a/textproc/htmldoc/files/patch-image.cxx
+++ /dev/null
@@ -1,19 +0,0 @@
---- htmldoc/image.cxx.orig 2006-05-31 21:00:02.000000000 +0200
-+++ htmldoc/image.cxx 2012-05-06 15:44:04.000000000 +0200
-@@ -56,6 +56,7 @@
- }
-
- #include <png.h> /* Portable Network Graphics (PNG) definitions */
-+#include <pngpriv.h>
-
-
- /*
-@@ -1499,7 +1500,7 @@
-
- rows = NULL;
-
-- if (setjmp(pp->jmpbuf))
-+ if (setjmp(png_jmpbuf(pp)))
- {
- progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!");
-
diff --git a/textproc/htmldoc/pkg-plist b/textproc/htmldoc/pkg-plist
index 6b5594389fac..346918bf9fac 100644
--- a/textproc/htmldoc/pkg-plist
+++ b/textproc/htmldoc/pkg-plist
@@ -1,4 +1,5 @@
bin/htmldoc
+man/man1/htmldoc.1.gz
%%DOCSDIR%%/help.html
%%DOCSDIR%%/htmldoc.pdf
%%DATADIR%%/fonts/Courier-Bold.afm