diff options
author | Brian Bidulock | 2015-07-08 23:43:29 -0600 |
---|---|---|
committer | Brian Bidulock | 2015-07-08 23:43:29 -0600 |
commit | ab903464290694b376cccc24b1495111c0766a88 (patch) | |
tree | 96fc9effa26099afd8bc9c15fa633864e7c1ccfe | |
download | aur-ab903464290694b376cccc24b1495111c0766a88.tar.gz |
initial version
-rw-r--r-- | .SRCINFO | 37 | ||||
-rw-r--r-- | PKGBUILD | 81 | ||||
-rw-r--r-- | evince2.install | 26 | ||||
-rw-r--r-- | fixups.patch | 12 | ||||
-rw-r--r-- | security_issues_in_dvi-backend.patch | 97 | ||||
-rw-r--r-- | update_to_poppler_api.patch | 58 |
6 files changed, 311 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..df2224d96761 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,37 @@ +pkgbase = evince2 + pkgdesc = Simply a document viewer. Gtk2 version. + pkgver = 2.32.0 + pkgrel = 3 + url = http://projects.gnome.org/evince/ + install = evince2.install + arch = i686 + arch = x86_64 + license = GPL + makedepends = pkgconfig + makedepends = intltool + makedepends = gobject-introspection + makedepends = gtk-doc + makedepends = gnome-common + depends = gtk2 + depends = libspectre>=0.2.6 + depends = gsfonts + depends = poppler-glib>=0.16.2 + depends = libdjvu>=3.5.22 + depends = gnome-icon-theme>=2.31.0 + depends = t1lib + depends = desktop-file-utils + depends = dconf + depends = gconf + provides = evince=2.32.0 + options = !libtool + source = http://ftp.gnome.org/pub/gnome/sources/evince/2.32/evince-2.32.0.tar.bz2 + source = update_to_poppler_api.patch + source = security_issues_in_dvi-backend.patch + source = fixups.patch + sha256sums = 2a4c91ae38f8b5028cebb91b9da9ddc50ea8ae3f3d429df89ba351da2d787ff7 + sha256sums = 2990c789c8cfd50e46f4dfa7a2406499b3ee26f4db9840c8b9a6e1dee40f61f4 + sha256sums = 49d1ed8adc734a005d4d8fdc1912bb115d97f734071d64bcae0aae60f2b5626a + sha256sums = 4cd393d57a0587eeb11f9efd4c5099d3fc0078f2566729f002165db4aae40891 + +pkgname = evince2 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..21d18cbfce4b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,81 @@ +# Maintainer : SpepS <dreamspepser at yahoo dot it> +# Contributor: Jan de Groot <jgc@archlinux.org> + +_p=evince +pkgname=evince2 +pkgver=2.32.0 +pkgrel=3 +pkgdesc="Simply a document viewer. Gtk2 version." +url="http://projects.gnome.org/evince/" +arch=('i686' 'x86_64') +license=('GPL') +depends=('gtk2' 'libspectre>=0.2.6' 'gsfonts' 'poppler-glib>=0.16.2' 'libdjvu>=3.5.22' + 'gnome-icon-theme>=2.31.0' 't1lib' 'desktop-file-utils' 'dconf' 'gconf') +makedepends=('pkgconfig' 'intltool' 'gobject-introspection' 'gtk-doc' 'gnome-common') +provides=("$_p=$pkgver") +install="$pkgname.install" +options=('!libtool') +source=("http://ftp.gnome.org/pub/gnome/sources/$_p/2.32/$_p-$pkgver.tar.bz2" + "update_to_poppler_api.patch" + "security_issues_in_dvi-backend.patch" + "fixups.patch") +sha256sums=('2a4c91ae38f8b5028cebb91b9da9ddc50ea8ae3f3d429df89ba351da2d787ff7' + '2990c789c8cfd50e46f4dfa7a2406499b3ee26f4db9840c8b9a6e1dee40f61f4' + '49d1ed8adc734a005d4d8fdc1912bb115d97f734071d64bcae0aae60f2b5626a' + '4cd393d57a0587eeb11f9efd4c5099d3fc0078f2566729f002165db4aae40891') + +build() { + cd "$srcdir/$_p-$pkgver" + + # THIS DOES NOT CONFLICT WITH EVINCE IN [EXTRA] + + # patches + patch -Np1 -b -z .orig -i "$srcdir/update_to_poppler_api.patch" + patch -Np1 -b -z .orig -i "$srcdir/security_issues_in_dvi-backend.patch" + patch -Np2 -b -z .orig -i "$srcdir/fixups.patch" + + # rename all to [eE]vince2 to prevent conflicts with evince gtk3 + _f=`find . -name "*[eE]vince*"` + for _l in $_f; do + mv $_l `echo $_l | sed "s|\([eE]\)\(vince2\{0,1\}\)|\1vince2|g"` + done + sed -i "s|\([eE]\)\(vince2\{0,1\}\)|\1vince2|g" `grep -rl "[eE]vince" .` + + # DSO link fix + export LIBS=" -lICE" + + ./autogen.sh \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir=/usr/lib/$pkgname \ + --disable-static \ + --disable-nautilus \ + --enable-pdf \ + --enable-tiff \ + --enable-djvu \ + --disable-dvi \ + --enable-t1lib \ + --enable-pixbuf \ + --enable-comics \ + --enable-impress \ + --enable-introspection \ + --disable-scrollkeeper \ + --disable-schemas-compile \ + --with-gconf-schema-file-dir=/usr/share/gconf/schemas \ + --without-keyring \ + --with-gconf + make +} + +package() { + cd "$srcdir/$_p-$pkgver" + + make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="$pkgdir" install + + # gconf + install -d "$pkgdir/usr/share/gconf/schemas" + gconf-merge-schema "$pkgdir/usr/share/gconf/schemas/$pkgname.schemas" \ + --domain $pkgname "$pkgdir"/usr/share/gconf/schemas/*.schemas + rm -f "$pkgdir"/usr/share/gconf/schemas/$pkgname-* +} diff --git a/evince2.install b/evince2.install new file mode 100644 index 000000000000..807c9fb99df3 --- /dev/null +++ b/evince2.install @@ -0,0 +1,26 @@ +pkgname=evince2 + +post_install() { + usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas + usr/sbin/gconfpkg --install ${pkgname} + gtk-update-icon-cache -q -f -t usr/share/icons/hicolor + update-desktop-database -q +} + +pre_upgrade() { + pre_remove $1 +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + usr/sbin/gconfpkg --uninstall ${pkgname} + usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas +} + +post_remove() { + update-desktop-database -q + gtk-update-icon-cache -q -f -t usr/share/icons/hicolor +} diff --git a/fixups.patch b/fixups.patch new file mode 100644 index 000000000000..f91f75aff43f --- /dev/null +++ b/fixups.patch @@ -0,0 +1,12 @@ +diff -up src/evince-2.32.0/backend/tiff/tiff2ps.c.orig src/evince-2.32.0/backend/tiff/tiff2ps.c +--- src/evince-2.32.0/backend/tiff/tiff2ps.c.orig 2015-06-06 19:55:51.000000000 -0600 ++++ src/evince-2.32.0/backend/tiff/tiff2ps.c 2015-06-06 20:53:56.000000000 -0600 +@@ -1127,7 +1127,7 @@ PS_Lvl2page(TIFF2PSContext* ctx, TIFF* t + } + buf_data = (unsigned char *)_TIFFmalloc(chunk_size); + if (!buf_data) { +- TIFFError(ctx->filename, "Can't alloc %u bytes for %s.", ++ TIFFError(ctx->filename, "Can't alloc %lu bytes for %s.", + chunk_size, tiled_image ? "tiles" : "strips"); + return(FALSE); + } diff --git a/security_issues_in_dvi-backend.patch b/security_issues_in_dvi-backend.patch new file mode 100644 index 000000000000..691ee4190a76 --- /dev/null +++ b/security_issues_in_dvi-backend.patch @@ -0,0 +1,97 @@ +From 8e473c9796b9a61b811213e7892fd36fd570303a Mon Sep 17 00:00:00 2001 +From: José Aliste <jaliste@src.gnome.org> +Date: Tue, 07 Dec 2010 18:56:47 +0000 +Subject: backends: Fix several security issues in the dvi-backend. + +See CVE-2010-2640, CVE-2010-2641, CVE-2010-2642 and CVE-2010-2643. +--- +diff --git a/backend/dvi/mdvi-lib/afmparse.c b/backend/dvi/mdvi-lib/afmparse.c +index 164366b..361e23d 100644 +--- a/backend/dvi/mdvi-lib/afmparse.c ++++ b/backend/dvi/mdvi-lib/afmparse.c +@@ -160,7 +160,7 @@ static char *token(FILE *stream) + + idx = 0; + while (ch != EOF && ch != ' ' && ch != lineterm +- && ch != '\t' && ch != ':' && ch != ';') ++ && ch != '\t' && ch != ':' && ch != ';' && idx < MAX_NAME) + { + ident[idx++] = ch; + ch = fgetc(stream); +diff --git a/backend/dvi/mdvi-lib/dviread.c b/backend/dvi/mdvi-lib/dviread.c +index 97b7b84..ac98068 100644 +--- a/backend/dvi/mdvi-lib/dviread.c ++++ b/backend/dvi/mdvi-lib/dviread.c +@@ -1537,6 +1537,10 @@ int special(DviContext *dvi, int opcode) + Int32 arg; + + arg = dugetn(dvi, opcode - DVI_XXX1 + 1); ++ if (arg <= 0) { ++ dvierr(dvi, _("malformed special length\n")); ++ return -1; ++ } + s = mdvi_malloc(arg + 1); + dread(dvi, s, arg); + s[arg] = 0; +diff --git a/backend/dvi/mdvi-lib/pk.c b/backend/dvi/mdvi-lib/pk.c +index a579186..08377e6 100644 +--- a/backend/dvi/mdvi-lib/pk.c ++++ b/backend/dvi/mdvi-lib/pk.c +@@ -469,6 +469,15 @@ static int pk_load_font(DviParams *unused, DviFont *font) + } + if(feof(p)) + break; ++ ++ /* Although the PK format support bigger char codes, ++ * XeTeX and other extended TeX engines support charcodes up to ++ * 65536, while normal TeX engine supports only charcode up to 255.*/ ++ if (cc < 0 || cc > 65536) { ++ mdvi_error (_("%s: unexpected charcode (%d)\n"), ++ font->fontname,cc); ++ goto error; ++ } + if(cc < loc) + loc = cc; + if(cc > hic) +@@ -512,7 +521,7 @@ static int pk_load_font(DviParams *unused, DviFont *font) + } + + /* resize font char data */ +- if(loc > 0 || hic < maxch-1) { ++ if(loc > 0 && hic < maxch-1) { + memmove(font->chars, font->chars + loc, + (hic - loc + 1) * sizeof(DviFontChar)); + font->chars = xresize(font->chars, +diff --git a/backend/dvi/mdvi-lib/tfmfile.c b/backend/dvi/mdvi-lib/tfmfile.c +index 73ebf26..8c2a30b 100644 +--- a/backend/dvi/mdvi-lib/tfmfile.c ++++ b/backend/dvi/mdvi-lib/tfmfile.c +@@ -172,7 +172,8 @@ int tfm_load_file(const char *filename, TFMInfo *info) + /* We read the entire TFM file into core */ + if(fstat(fileno(in), &st) < 0) + return -1; +- if(st.st_size == 0) ++ /* according to the spec, TFM files are smaller than 16K */ ++ if(st.st_size == 0 || st.st_size >= 16384) + goto bad_tfm; + + /* allocate a word-aligned buffer to hold the file */ +diff --git a/backend/dvi/mdvi-lib/vf.c b/backend/dvi/mdvi-lib/vf.c +index fb49847..a5ae3bb 100644 +--- a/backend/dvi/mdvi-lib/vf.c ++++ b/backend/dvi/mdvi-lib/vf.c +@@ -165,6 +165,12 @@ static int vf_load_font(DviParams *params, DviFont *font) + cc = fuget1(p); + tfm = fuget3(p); + } ++ if (cc < 0 || cc > 65536) { ++ /* TeX engines do not support char codes bigger than 65535 */ ++ mdvi_error(_("(vf) %s: unexpected character %d\n"), ++ font->fontname, cc); ++ goto error; ++ } + if(loc < 0 || cc < loc) + loc = cc; + if(hic < 0 || cc > hic) +-- +cgit v0.8.3.1 diff --git a/update_to_poppler_api.patch b/update_to_poppler_api.patch new file mode 100644 index 000000000000..29bcad6b948b --- /dev/null +++ b/update_to_poppler_api.patch @@ -0,0 +1,58 @@ +From f77e6cf4fd7fef49ac91d8c62b6a9a993529adb8 Mon Sep 17 00:00:00 2001 +From: Carlos Garcia Campos <carlosgc@gnome.org> +Date: Fri, 17 Sep 2010 11:21:16 +0000 +Subject: [pdf] Update to poppler api changes + +Linearized PopplerDocument property is now boolean rather than string. +--- +diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc +index aa080e6..ced3ef7 100644 +--- a/backend/pdf/ev-poppler.cc ++++ b/backend/pdf/ev-poppler.cc +@@ -722,6 +722,9 @@ pdf_document_get_info (EvDocument *document) + PopplerPermissions permissions; + EvPage *page; + char *metadata; ++#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED ++ gboolean linearized; ++#endif + + info = g_new0 (EvDocumentInfo, 1); + +@@ -758,7 +761,11 @@ pdf_document_get_info (EvDocument *document) + "producer", &(info->producer), + "creation-date", &(info->creation_date), + "mod-date", &(info->modified_date), ++#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED ++ "linearized", &linearized, ++#else + "linearized", &(info->linearized), ++#endif + "metadata", &metadata, + NULL); + +@@ -864,6 +871,10 @@ pdf_document_get_info (EvDocument *document) + info->security = g_strdup (_("No")); + } + ++#ifdef HAVE_POPPLER_DOCUMENT_IS_LINEARIZED ++ info->linearized = linearized ? g_strdup (_("Yes")) : g_strdup (_("No")); ++#endif ++ + return info; + } + +diff --git a/configure.ac b/configure.ac +index 0faa16e..9619349 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -512,6 +512,7 @@ if test "x$enable_pdf" = "xyes"; then + AC_CHECK_FUNCS(poppler_page_get_text_layout) + AC_CHECK_FUNCS(poppler_page_get_selected_text) + AC_CHECK_FUNCS(poppler_page_add_annot) ++ AC_CHECK_FUNCS(poppler_document_is_linearized) + LIBS=$evince_save_LIBS + PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no) + if test x$enable_cairo_pdf = xyes; then +-- +cgit v0.8.3.1 |