- Update to 0.12

- Add LICENSE_FILE
- Convert to new options helper
- Convert to new options target helper
- Convert to new test framework
- Remove EXTRACT_AFTER_ARGS
- Sort USES
- Use USES=shebangfix
- Repack test tarball
- Cosmetic change
- Split and rename patch files
- Regenerate patch files with makepatch:
- Update WWW
- Add git repository to WWW
- Take maintainership

Changes:	http://git.ghostscript.com/?p=jbig2dec.git;a=blob;f=CHANGES;hb=HEAD
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2015-12-04 12:32:58 +00:00
parent bc2a4109b1
commit 76bfabb776
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=402944
12 changed files with 128 additions and 120 deletions

View File

@ -1,61 +1,46 @@
# $FreeBSD$
PORTNAME= jbig2dec
PORTVERSION= 0.11
PORTREVISION= 4
PORTVERSION= 0.12
CATEGORIES= graphics devel
MASTER_SITES= SF
MASTER_SITES= http://downloads.ghostscript.com/public/${PORTNAME}/ \
LOCAL/sunpoet:tests
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= ports@FreeBSD.org
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Decoder implementation of the JBIG2 image compression format
LICENSE= GPLv3
USES= tar:xz libtool
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
INSTALL_TARGET= install-strip
LICENSE_FILE= ${WRKSRC}/COPYING
OPTIONS_DEFINE= PNG TESTS
OPTIONS_DEFAULT= PNG
OPTIONS_DEFAULT=PNG
TESTS_DESC= Download and use test-images for post-build testing
EXTRACT_AFTER_ARGS+= --exclude sha1.h --exclude 'getopt*'
CONFIGURE_ENV= ac_cv_func_getopt_long=yes
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USE_LDCONFIG= yes
USES= autoreconf libtool
PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png
SHEBANG_FILES= test_jbig2dec.py
python_CMD= ${PYTHON_CMD}
PNG_CONFIGURE_OFF= --without-libpng
PNG_CONFIGURE_ON= --with-libpng=${LOCALBASE}
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MTESTS}
MASTER_SITES+= http://jbig2dec.sourceforge.net/ubc/:tests
DISTFILES+= jb2streams.zip:tests
USES+= python:build
KNOWN_BAD_JB2S= 042_11 042_13 042_14 042_24 042_25 amb_1 amb_2
post-extract:
@${MKDIR} ${WRKDIR}/ubc
@${TAR} -C ${WRKDIR}/ubc/ -xpf ${DISTDIR}/jb2streams.zip \
${KNOWN_BAD_JB2S:S/$/.jb2/:S/^/--exclude /}
.else
EXTRA_PATCHES= ${FILESDIR}/simpler-test-patch
.endif
PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png
TESTS_DISTFILES= jb2streams${EXTRACT_SUFX}:tests
TESTS_TEST_TARGET= check-TESTS
TESTS_USES= python:build shebangfix
post-patch:
.if ${PORT_OPTIONS:MPNG}
@${REINPLACE_CMD} 's/png_check_sig/png_sig_cmp/g' ${WRKSRC}/configure
.endif
@${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' \
${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c
@${REINPLACE_CMD} -e '1 s|${SETENV} python|${PYTHON_CMD}|' \
${WRKSRC}/test_jbig2dec.py
@${RM} ${WRKSRC}/getopt* ${WRKSRC}/sha1.h
@${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' ${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c
test check regression-test:
${MAKE} -C ${WRKSRC} check-TESTS
post-patch-PNG-on:
@${REINPLACE_CMD} 's|png_check_sig|png_sig_cmp|g' ${WRKSRC}/configure
post-build: test
post-patch-TESTS-off:
@${REINPLACE_CMD} -e '/^TESTS = / s| test_jbig2dec.py||' ${WRKSRC}/Makefile.in
.include <bsd.port.mk>

View File

@ -1,4 +1,4 @@
SHA256 (jbig2dec-0.11.tar.xz) = 016bf8148c850736c19e5e0336c43912d98d68f90c9171912c4f67f5c060adf5
SIZE (jbig2dec-0.11.tar.xz) = 258908
SHA256 (jb2streams.zip) = 3d1e5c79054b59d061cabdb1d7ba2d1b3f84700f5c517ba4306f7047660016f7
SIZE (jb2streams.zip) = 1285838
SHA256 (jbig2dec-0.12.tar.gz) = bcc5f2cc75ee46e9a2c3c68d4a1b740280c772062579a5d0ceda24bee2e5ebf0
SIZE (jbig2dec-0.12.tar.gz) = 330935
SHA256 (jb2streams.tar.gz) = 1b070a15468d186010047b5525b2eb99cdcda655576600d2d8a0d008b80a5ba2
SIZE (jb2streams.tar.gz) = 1000034

View File

@ -0,0 +1,27 @@
--- Makefile.am.orig 2014-10-31 21:30:04.000000000 +0800
+++ Makefile.am 2015-12-04 15:46:33.248995991 +0800
@@ -26,10 +26,10 @@
bin_PROGRAMS = jbig2dec
noinst_PROGRAMS = test_sha1 test_huffman test_arith
-jbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \
- jbig2.h jbig2_image.h getopt.h \
+jbig2dec_SOURCES = jbig2dec.c \
+ jbig2.h jbig2_image.h \
os_types.h config_types.h config_win32.h
-jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS)
+jbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS) -lmd
dist_man_MANS = jbig2dec.1
@@ -39,8 +39,9 @@
TESTS = test_sha1 test_jbig2dec.py test_huffman test_arith
-test_sha1_SOURCES = sha1.c sha1.h
+test_sha1_SOURCES = sha1.c
test_sha1_CFLAGS = -DTEST
+test_sha1_LDADD = -lmd
test_arith_SOURCES = jbig2_arith.c
test_arith_CFLAGS = -DTEST

View File

@ -0,0 +1,11 @@
--- configure.ac.orig 2014-10-31 21:30:04.000000000 +0800
+++ configure.ac 2015-12-04 15:15:55.027124992 +0800
@@ -140,8 +140,6 @@
AC_DEFINE(HAVE_GETOPT_LONG,,
[Define if the local libc includes getopt_long()]
),[
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
])
# generate output

View File

@ -1,6 +1,14 @@
--- jbig2_image_png.c
--- jbig2_image_png.c.orig 2014-10-31 13:30:04 UTC
+++ jbig2_image_png.c
@@ -33,7 +33,7 @@
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <png.h>
-#include <pngstruct.h>
#define CVT_PTR(ptr) (ptr)
#include "jbig2.h"
@@ -40,7 +39,7 @@ jbig2_png_write_data(png_structp png_ptr
{
png_size_t check;
@ -9,7 +17,7 @@
if (check != length) {
png_error(png_ptr, "Write Error");
}
@@ -43,7 +43,7 @@
@@ -50,7 +49,7 @@ static void
jbig2_png_flush(png_structp png_ptr)
{
png_FILE_p io_ptr;

View File

@ -0,0 +1,14 @@
--- jbig2dec.c.orig 2014-10-31 13:30:04 UTC
+++ jbig2dec.c
@@ -41,7 +41,10 @@
#endif
#include "os_types.h"
-#include "sha1.h"
+#include <sha.h>
+#ifndef SHA1_DIGEST_SIZE
+# define SHA1_DIGEST_SIZE 20
+#endif
#include "jbig2.h"
#include "jbig2_priv.h"

View File

@ -1,52 +0,0 @@
--- Makefile.in 2010-02-02 14:13:56.000000000 -0500
+++ Makefile.in 2010-08-03 13:47:07.000000000 -0400
@@ -214,8 +214,8 @@
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am_jbig2dec_OBJECTS = jbig2dec.$(OBJEXT) sha1.$(OBJEXT)
+am_jbig2dec_OBJECTS = jbig2dec.$(OBJEXT)
jbig2dec_OBJECTS = $(am_jbig2dec_OBJECTS)
jbig2dec_DEPENDENCIES = libjbig2dec.la @LIBOBJS@
-jbig2dec_LDFLAGS =
+jbig2dec_LDFLAGS = -lmd
am_test_arith_OBJECTS = test_arith-jbig2_arith.$(OBJEXT)
test_arith_OBJECTS = $(am_test_arith_OBJECTS)
@@ -228,5 +228,5 @@
am_test_sha1_OBJECTS = test_sha1-sha1.$(OBJEXT)
test_sha1_OBJECTS = $(am_test_sha1_OBJECTS)
-test_sha1_LDADD = $(LDADD)
+test_sha1_LDADD = -lmd
test_sha1_DEPENDENCIES =
test_sha1_LDFLAGS =
--- jbig2dec.c 2010-02-02 14:02:55.000000000 -0500
+++ jbig2dec.c 2010-08-03 13:36:41.000000000 -0400
@@ -37,5 +37,8 @@
#include "os_types.h"
-#include "sha1.h"
+#include <sha.h>
+#ifndef SHA1_DIGEST_SIZE
+# define SHA1_DIGEST_SIZE 20
+#endif
#include "jbig2.h"
--- sha1.c 2009-07-16 00:44:49.000000000 -0400
+++ sha1.c 2010-08-03 13:45:09.000000000 -0400
@@ -87,4 +87,11 @@
#include "os_types.h"
+
+#include <sha.h>
+#ifndef SHA1_DIGEST_SIZE
+# define SHA1_DIGEST_SIZE 20
+#endif
+
+#if 0
#include "sha1.h"
@@ -261,5 +268,4 @@
/*************************************************************/
-#if 0
int main(int argc, char** argv)
{

View File

@ -0,0 +1,24 @@
--- sha1.c.orig 2014-10-31 13:30:04 UTC
+++ sha1.c
@@ -86,6 +86,13 @@ A million repetitions of "a"
#include <string.h>
#include "os_types.h"
+
+#include <sha.h>
+#ifndef SHA1_DIGEST_SIZE
+# define SHA1_DIGEST_SIZE 20
+#endif
+
+#if 0
#include "sha1.h"
void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
@@ -260,7 +267,6 @@ void SHA1_Final(SHA1_CTX* context, uint8
/*************************************************************/
-#if 0
int main(int argc, char** argv)
{
int i, j;

View File

@ -0,0 +1,10 @@
--- test_jbig2dec.py.orig 2015-12-01 15:52:01 UTC
+++ test_jbig2dec.py
@@ -52,6 +52,7 @@ class SelfTestSuite:
(len(self.fails),len(self.tests)))
else:
self.stream.write('PASSED all %d tests\n' % len(self.tests))
+ return 1
class KnownFileHash(SelfTest):
'self test to check for correct decode of known test files'

View File

@ -1,8 +0,0 @@
--- test_jbig2dec.py 2009-07-16 00:44:49.000000000 -0400
+++ test_jbig2dec.py 2010-08-03 14:59:23.000000000 -0400
@@ -53,4 +53,5 @@
else:
self.stream.write('PASSED all %d tests\n' % len(self.tests))
+ return 1
class KnownFileHash(SelfTest):

View File

@ -1,12 +0,0 @@
The test_jbig2dec.py requires Python and thus not be
suitable for some installations.
--- Makefile.in 2010-02-02 14:13:56.000000000 -0500
+++ Makefile.in 2010-08-03 13:47:07.000000000 -0400
@@ -182,5 +182,5 @@
MAINTAINERCLEANFILES = config_types.h.in
-TESTS = test_sha1 test_jbig2dec.py test_huffman test_arith
+TESTS = test_sha1 test_huffman test_arith
test_sha1_SOURCES = sha1.c sha1.h

View File

@ -4,4 +4,5 @@ images at moderately high resolution, and in particular scanned paper documents.
In this domain it is very efficient, offering compression ratios on the order of
100:1.
WWW: http://jbig2dec.sourceforge.net/
WWW: http://www.ghostscript.com/jbig2dec.html
WWW: http://git.ghostscript.com/?p=jbig2dec.git