Browse Source

mupdf package update

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 7 years ago
parent
commit
40c6d9c508
  1. 27
      SOURCES/0001-Fix-699271-skip-space-correctly.patch
  2. 122
      SOURCES/0001-fix-build-on-big-endian.patch
  3. 25
      SOURCES/mupdf-1.13-openjpeg.patch
  4. 262
      SPECS/mupdf.spec

27
SOURCES/0001-Fix-699271-skip-space-correctly.patch

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
From 6f3535a520674b757548c1c84a48150e12cbb739 Mon Sep 17 00:00:00 2001
Message-Id: <6f3535a520674b757548c1c84a48150e12cbb739.1528633460.git.mjg@fedoraproject.org>
From: Michael J Gruber <mjg@fedoraproject.org>
Date: Sun, 10 Jun 2018 14:22:50 +0200
Subject: [PATCH] Fix 699271: skip space correctly

Terminate skipping spaces when there is no more space or no more char.
---
source/pdf/pdf-xref.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 8515090d..68a8783b 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -647,7 +647,7 @@ fz_skip_space(fz_context *ctx, fz_stream *stm)
do
{
int c = fz_peek_byte(ctx, stm);
- if (c > 32 && c != EOF)
+ if (c > 32 || c == EOF)
return;
(void)fz_read_byte(ctx, stm);
}
--
2.18.0.rc1.265.g7dd663a68f

122
SOURCES/0001-fix-build-on-big-endian.patch

@ -0,0 +1,122 @@ @@ -0,0 +1,122 @@
From 5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602 Mon Sep 17 00:00:00 2001
Message-Id: <5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602.1528041417.git.mjg@fedoraproject.org>
From: Michael J Gruber <mjg@fedoraproject.org>
Date: Sun, 3 Jun 2018 17:55:46 +0200
Subject: [PATCH] fix build on big endian

0dc1153 ("Spread of context into all procedures and removal from
structures", 2017-04-26) missed a few spots that are relevant on big
endian only.

Add the missing ContextIDs in the call chain so that the build succeeds
again.

Signed-off-by: Michael J Gruber <mjg@fedoraproject.org>
---
src/cmsmd5.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/cmsmd5.c b/src/cmsmd5.c
index 4b8f7f9..dd0925a 100644
--- a/src/cmsmd5.c
+++ b/src/cmsmd5.c
@@ -29,7 +29,7 @@
#ifdef CMS_USE_BIG_ENDIAN
static
-void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
+void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number longs)
{
do {
@@ -42,7 +42,7 @@ void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
}
#else
-#define byteReverse(buf, len)
+#define byteReverse(ContextID, buf, len)
#endif
@@ -172,7 +172,7 @@ cmsHANDLE MD5alloc(cmsContext ContextID)
static
-void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+void MD5add(cmsContext ContextID, cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
{
_cmsMD5* ctx = (_cmsMD5*) Handle;
cmsUInt32Number t;
@@ -196,7 +196,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
}
memmove(p, buf, t);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
buf += t;
@@ -205,7 +205,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
while (len >= 64) {
memmove(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
buf += 64;
len -= 64;
@@ -216,7 +216,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
// Destroy the object and return the checksum
static
-void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle)
+void MD5finish(cmsContext ContextID, cmsProfileID* ProfileID, cmsHANDLE Handle)
{
_cmsMD5* ctx = (_cmsMD5*) Handle;
cmsUInt32Number count;
@@ -232,21 +232,21 @@ void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle)
if (count < 8) {
memset(p, 0, count);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
memset(ctx->in, 0, 56);
} else {
memset(p, 0, count - 8);
}
- byteReverse(ctx->in, 14);
+ byteReverse(ContextID, ctx->in, 14);
((cmsUInt32Number *) ctx->in)[14] = ctx->bits[0];
((cmsUInt32Number *) ctx->in)[15] = ctx->bits[1];
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
- byteReverse((cmsUInt8Number *) ctx->buf, 4);
+ byteReverse(ContextID, (cmsUInt8Number *) ctx->buf, 4);
memmove(ProfileID ->ID8, ctx->buf, 16);
_cmsFree(ctx ->ContextID, ctx);
@@ -291,7 +291,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
if (MD5 == NULL) goto Error;
// Add all bytes
- MD5add(MD5, Mem, BytesNeeded);
+ MD5add(ContextID,MD5, Mem, BytesNeeded);
// Temp storage is no longer needed
_cmsFree(ContextID, Mem);
@@ -300,7 +300,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
memmove(Icc, &Keep, sizeof(_cmsICCPROFILE));
// And store the ID
- MD5finish(&Icc ->ProfileID, MD5);
+ MD5finish(ContextID, &Icc ->ProfileID, MD5);
return TRUE;
Error:
--
2.18.0.rc0.294.g786209a621

25
SOURCES/mupdf-1.13-openjpeg.patch

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
diff --git i/source/fitz/load-jpx.c w/source/fitz/load-jpx.c
index a1c39f9f..056209a4 100644
--- i/source/fitz/load-jpx.c
+++ w/source/fitz/load-jpx.c
@@ -444,6 +444,10 @@ fz_load_jpx_info(fz_context *ctx, const unsigned char *data, size_t size, int *w
}
#else /* HAVE_LURATECH */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
#include <openjpeg.h>
@@ -924,6 +928,9 @@ fz_load_jpx_info(fz_context *ctx, const unsigned char *data, size_t size, int *w
}
#endif /* HAVE_LURATECH */
+#ifdef __cplusplus
+}
+#endif
#else /* FZ_ENABLE_JPX */

262
SPECS/mupdf.spec

@ -0,0 +1,262 @@ @@ -0,0 +1,262 @@
Name: mupdf
Version: 1.13.0
Release: 8%{?dist}
Summary: A lightweight PDF viewer and toolkit
Group: Applications/Publishing
License: AGPLv3+
URL: http://mupdf.com/
Source0: http://mupdf.com/downloads/%{name}-%{version}-source.tar.gz
Source1: %{name}.desktop
BuildRequires: gcc make binutils desktop-file-utils coreutils
BuildRequires: openjpeg2-devel jbig2dec-devel desktop-file-utils
BuildRequires: libjpeg-devel freetype-devel libXext-devel curl-devel
BuildRequires: harfbuzz-devel
BuildRequires: mesa-libGL-devel mesa-libGLU-devel libXi-devel libXrandr-devel
# We need to build against the Artifex fork of lcms2 so that we are thread safe
# (see bug #1553915). Artifex make sure to rebase against upstream, who refuse
# to integrate Artifex's changes.
Provides: bundled(lcms2-devel) = 2.9
# We need to build against the Artifex fork of freeglut so that we are unicode safe.
Provides: bundled(freeglut)-devel) = 3.0.0
Patch0: %{name}-1.13-openjpeg.patch
Patch1: 0001-fix-build-on-big-endian.patch
Patch2: 0001-Fix-699271-skip-space-correctly.patch

%description
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
The renderer in MuPDF is tailored for high quality anti-aliased
graphics. MuPDF renders text with metrics and spacing accurate to
within fractions of a pixel for the highest fidelity in reproducing
the look of a printed page on screen.
MuPDF has a small footprint. A binary that includes the standard
Roman fonts is only one megabyte. A build with full CJK support
(including an Asian font) is approximately five megabytes.
MuPDF has support for all non-interactive PDF 1.7 features, and the
toolkit provides a simple API for accessing the internal structures of
the PDF document. Example code for navigating interactive links and
bookmarks, encrypting PDF files, extracting fonts, images, and
searchable text, and rendering pages to image files is provided.

%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release}

%description devel
The mupdf-devel package contains header files for developing
applications that use mupdf and static libraries

%prep
%setup -q -n %{name}-%{version}-source
for d in $(ls thirdparty | grep -v -e freeglut -e lcms2)
do
rm -rf thirdparty/$d
done
%patch0 -p1
%patch1 -p1 -d thirdparty/lcms2
%patch2 -p1

%build
export XCFLAGS="%{optflags} -fPIC -DJBIG_NO_MEMENTO -DTOFU -DTOFU_CJK"

make %{?_smp_mflags} build=debug verbose=yes
%install
make DESTDIR=%{buildroot} install prefix=%{_prefix} libdir=%{_libdir} build=debug verbose=yes HAVE_GLUT=yes
## handle docs on our own
rm -rf %{buildroot}/%{_docdir}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -p -m644 docs/logo/mupdf-logo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/mupdf.svg
## fix strange permissons
chmod 0644 %{buildroot}%{_libdir}/*.a
find %{buildroot}/%{_mandir} -type f -exec chmod 0644 {} \;
find %{buildroot}/%{_includedir} -type f -exec chmod 0644 {} \;
cd %{buildroot}/%{_bindir} && ln -s %{name}-x11 %{name}


%post
update-desktop-database &> /dev/null || :

%postun
update-desktop-database &> /dev/null || :

%files
%license COPYING
%doc README CHANGES docs/*
%{_bindir}/*
%{_datadir}/applications/mupdf.desktop
%{_datadir}/icons/hicolor/*/apps/*
%{_mandir}/man1/*.1.gz

%files devel
%{_includedir}/%{name}
%{_libdir}/lib%{name}*.a

%changelog
* Sun Jun 10 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-8
- CVE-2018-10289 (rh bz #1573050) (gs bz #699271)

* Wed Jun 06 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-7
- fix license field (bug #1586328)

* Sun Jun 03 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-6
- fix lcms2art build on big endian

* Fri May 18 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-5
- fix BR (pulled in by freeglut-devel before)

* Mon Apr 23 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-4
- bundle unicode safe freeglut

* Mon Apr 23 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-3
- include (now non-empty) libmupdfthird.a again (fixes bug #1553915 for zathura-pdf-mupdf)

* Fri Apr 20 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-2
- bundle thread-safe lcms2 (fixes bug #1553915)

* Fri Apr 20 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.13.0-1
- rebase to 1.13.0 (rh bz #1569993)

* Fri Apr 13 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-6
- install svg icon

* Fri Apr 13 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-6
- install svg icon

* Wed Feb 14 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-5
- CVE-2018-6192 (rh bz #1539845 #1539846) (gs bz #698916)
- CVE-2018-6544 (rh bz #1542264 #1542265) (gs bz #698830 #698965)
- CVE-2018-1000051 (rh bz #1544847 #1544848) (gs bz #698825 #698873)

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Feb 06 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-4
- CVE-2018-6187 (rh bz #1538432 #1538433) (gs bz #698908)

* Wed Jan 24 2018 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-2
- CVE-2017-17858 (rh bz #1537952) (gs bz #698819)
- CVE-2018-5686 (gs bz #698860)

* Thu Dec 14 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.12.0-1
- rebase to 1.12
- follow switch from GLFW to GLUT
- follow switch to new version scheme

* Sun Nov 26 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.12rc1-1
- rc test

* Sat Nov 11 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.11-9
- CVE-2017-15369
- CVE-2017-15587

* Sat Nov 11 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.11-8
- repair FTBFS from version specific patch in 412e729 ("New release 1.11", 2017-04-11)

* Sat Nov 11 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.11-7
- rebuild with jbig2dec 0.14 (#1456731)

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue May 09 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.11-4
- Rebuild with new jbig2dec (#1443933)

* Fri Apr 14 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.11-3
- Fix mupdf-gl build (#1442384)

* Tue Apr 11 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.11-1
- New release 1.11 (#1441186)

* Thu Apr 6 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.10a-5
- Fix stack consumption CVE (#1439643)

* Thu Mar 2 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.10a-4
- fix buffer overflow (#1425338)

* Thu Mar 02 2017 Michael J Gruber <mjg@fedoraproject.org> - 1.10a-3
- Several packaging fixes

* Thu Feb 23 2017 Pavel Zhukov <landgraf@fedoraproject.org> - 1.10a-2
- Add comment with explanation of disabled debuginfo
- Fix make verbose output

* Sat Feb 11 2017 Pavel Zhukov <pzhukov@redhat.com> - 1.10a-1
- New release (1.10a)

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Nov 28 2015 Pavel Zhukov <landgraf@fedoraproject.org> -1.8-1
- New release (#1280518)

* Sat Nov 28 2015 Pavel Zhukov <landgraf@fedoraproject.org> -1.7a-4
- Disable memento

* Wed Nov 18 2015 Petr Šabata <contyk@redhat.com> - 1.7a-3
- Package the license text with the %%license macro
- Don't use the %%version macro in filenames, it's not helpful
- Added extra handling for the docs; %%_docdir is no longer autopackaged,
plus we want to install the license text elsewhere

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7a-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 01 2015 Pavel Zhukov <landgraf@fedoraproject.org> - 1.7a-1
- New release 1.7a (#1219482)
* Wed May 06 2015 Pavel Zhukov <landgraf@fedoraproject.org> - 1.7-1
- New release 1.7 (#1210318)
- Fix segfault in obj_close routine (#1202137, #1215752)

* Wed May 06 2015 Pavel Zhukov <landgraf@fedoraproject.org> - 1.5-6
- Fix executable name in desktop file

* Sat Oct 11 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.5-5
- Add missed curl-devel

* Fri Jul 04 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.5-3
- Add fPIC flag (#1109589)
- Add curl-devel to BR (#1114566)

* Sun Jun 15 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.5-2
- Add fix for new openjpeg2

* Sun Jun 15 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.5-1
- New release 1.5 (#1108710)

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 6 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.4-1
- New release 1.4 (#1087287)

* Fri Jan 24 2014 Pavel Zhukov <landgraf@fedoraproject.org> - 1.1-5
- Fix stack overflow (#1056699)

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.1-2
- rebuild due to "jpeg8-ABI" feature drop

* Wed Jan 09 2013 Pavel Zhukov <landgraf@fedoraproject.org> - 1.1-1
- New release

* Sun May 20 2012 Pavel Zhukov <landgraf@fedoraproject.org> - 1.0-1
- New release

* Wed Mar 14 2012 Pavel Zhukov <landgraf@fedoraproject.org> - 0.9-2
- Fix buffer overflow (#752388)

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
Loading…
Cancel
Save