aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2019-10-17 11:46:52 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2019-10-24 18:56:33 +0000
commit44f09f98c5e4c349dcc6b25edde778f864f4ca5a (patch)
tree8a07a6c786e1c1d32c5e7c72f2f875ab9438022d /community
parente687ca43f002b7469d415bc786ba072459057f1f (diff)
downloadaports-44f09f98c5e4c349dcc6b25edde778f864f4ca5a.tar.bz2
aports-44f09f98c5e4c349dcc6b25edde778f864f4ca5a.tar.xz
community/a2ps: move from main
Closes !509
Diffstat (limited to 'community')
-rw-r--r--community/a2ps/APKBUILD92
-rw-r--r--community/a2ps/CVE-2001-1593.patch65
-rw-r--r--community/a2ps/CVE-2014-0466.patch30
-rw-r--r--community/a2ps/a2ps-4.13-manpage-chmod.patch12
-rw-r--r--community/a2ps/a2ps-4.13c-emacs.patch10
-rw-r--r--community/a2ps/a2ps-4.13c-fnmatch-replacement.patch43
-rw-r--r--community/a2ps/a2ps-4.14-check-mempcpy.patch12
-rw-r--r--community/a2ps/a2ps-4.14-fix-stpcpy-proto.patch17
-rw-r--r--community/a2ps/a2ps-automake-1.12.patch43
-rw-r--r--community/a2ps/automake.patch30
-rw-r--r--community/a2ps/fix-redeclarations.patch20
11 files changed, 374 insertions, 0 deletions
diff --git a/community/a2ps/APKBUILD b/community/a2ps/APKBUILD
new file mode 100644
index 0000000000..d8960c8e6e
--- /dev/null
+++ b/community/a2ps/APKBUILD
@@ -0,0 +1,92 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=a2ps
+pkgver=4.14
+pkgrel=7
+pkgdesc="a2ps is an Any to PostScript filter"
+url="https://www.gnu.org/software/a2ps/"
+arch="all"
+license="GPL-3.0"
+depends="ghostscript imagemagick perl"
+makedepends="gperf autoconf automake libtool"
+install=
+subpackages="$pkgname-dev $pkgname-doc"
+source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz
+ $pkgname-4.13c-fnmatch-replacement.patch
+ $pkgname-4.13c-emacs.patch
+ $pkgname-4.13-manpage-chmod.patch
+ $pkgname-$pkgver-check-mempcpy.patch
+ $pkgname-$pkgver-fix-stpcpy-proto.patch
+ fix-redeclarations.patch
+ a2ps-automake-1.12.patch
+ automake.patch
+ CVE-2001-1593.patch
+ CVE-2014-0466.patch
+ "
+
+prepare() {
+ cd "$srcdir"/$pkgname-$pkgver
+ update_config_sub || return 1
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ sed -i -e 's/__mempcpy/mempcpy/g' lib/strftime.c src/regex.c \
+ || return 1
+ rm -f aclocal.m4 */aclocal.m4
+ libtoolize --force --copy || return 1
+ aclocal -I m4 && automake --add-missing && autoreconf -I m4 || return 1
+}
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc/a2ps \
+ --includedir=/usr/include \
+ --disable-nls \
+ || return 1
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make -j1 DESTDIR="$pkgdir" install || return 1
+ sed -i "s:^countdictstack: \0:" "$pkgdir"/usr/bin/psset || return 1
+}
+
+md5sums="781ac3d9b213fa3e1ed0d79f986dc8c7 a2ps-4.14.tar.gz
+93011b58e9f20a7fafa31287a51884a4 a2ps-4.13c-fnmatch-replacement.patch
+2e493d0bc00d71eb3e8a9b6febc52b69 a2ps-4.13c-emacs.patch
+09cc5ed4d3d8ff1b2103e519191e8286 a2ps-4.13-manpage-chmod.patch
+42aa39b74f6da8cf6e94185c4fc3e601 a2ps-4.14-check-mempcpy.patch
+4b4fbc19a6b79fa64df7e26945fcdcf9 a2ps-4.14-fix-stpcpy-proto.patch
+2161408fcb532ac22dba95eb6e60ace6 fix-redeclarations.patch
+72e8f0a6cd234945df92549d8a5451f8 a2ps-automake-1.12.patch
+868217fde7f9a4c1350c99431b0c1671 automake.patch
+fa3c5f09f47619fbee347256e940fcce CVE-2001-1593.patch
+f1c0a955f604ccf7d592b92d67c7d255 CVE-2014-0466.patch"
+sha256sums="f3ae8d3d4564a41b6e2a21f237d2f2b104f48108591e8b83497500182a3ab3a4 a2ps-4.14.tar.gz
+5d1b8a8791fa2a36c23f43ef153a724cce1f8eec8fb92ab886f52fae7f8f3be3 a2ps-4.13c-fnmatch-replacement.patch
+943739a788db47f10942477754f42c8c9b22cdaad4463bea4103c31a330de76a a2ps-4.13c-emacs.patch
+032c4698c1dabb1a72978b9aefef7a8895098fb5a7e46e81d861fedfef3b11ab a2ps-4.13-manpage-chmod.patch
+7ec2164888d1621a8406d431ed3accd137ec8f92e0ca885175bc1c17010519a1 a2ps-4.14-check-mempcpy.patch
+547a50e7bd577222fac71ce1ab7fd25db2096a8874ae667bd09e118fb39bf5a9 a2ps-4.14-fix-stpcpy-proto.patch
+49532bc45d91f198791063f5c0438c163399f8dd8e497e660b2099f24c8914c1 fix-redeclarations.patch
+167a4639b008c123b54fe627a6fcbb1db12c37023f5c37a9994f2eeb212b1d55 a2ps-automake-1.12.patch
+ded40b73e44729ebf3cf4777eaea92915dde0429ab8a137ca53358333474f515 automake.patch
+fbfeb3d421e81540839e25f7a3efdab977e86e3c5748442eefe4560c85816a12 CVE-2001-1593.patch
+458601076b6e3cc241d121602cc455d2d3ae5fce47eeb57dd56c9acb9995db02 CVE-2014-0466.patch"
+sha512sums="fd6ac8ab47d789114c283e8ca508f7f56feabd1a189f4ac772cad9e6be7e3791e210892cfffd04ad1d39efe4b15386b2e61bf4cd56b70ed581c0554f36bfe06f a2ps-4.14.tar.gz
+5509ae1277ff1f1f487fb106ed6673eb67fa7d1531a35bfa087f78a0bdb4dc0bf38c69b7fab95161a19406fc1acaef09b22b8a05ef603c6d43a8d7a8c3077b56 a2ps-4.13c-fnmatch-replacement.patch
+0ef1a215ecb757e249c4d4bdf9a789419c6cd433f7e330783fef13a0158c57c5c5e6a22526d8abcca0919bdb1dc08337869fdd3f0fe192284ca087eafad322a3 a2ps-4.13c-emacs.patch
+f3dc2698ee989928b3179b65b01bf12d828f4428bd860f6f1a3811daaa9d6256b353c2acb5cd4bf392dd89b040f8e9c15420ab4373f3d54b8b60652aaf23f864 a2ps-4.13-manpage-chmod.patch
+6835f5e9205cb549da52c4a3c13aad601c9e9d294f0f35ebe4d8cc6f8bd8b5f6fe77b857f8c92f552a43c02eb6de812021c078ce597c319bde176f0e91cd167b a2ps-4.14-check-mempcpy.patch
+605385c355b15f2f8142b4a05390ce131d3f2b7a8d56bf37b70457db64c0ce458778daf05ef015c9059482483907a629f12d210bcaa91cc007af4f708b66b765 a2ps-4.14-fix-stpcpy-proto.patch
+08382d49982190779f3070e06af773c0dd730e8f1a81310a537c149a438954e5c4b360c72a908fb50b1fb95fcf4b556c28ffd90932bae81140cab30b3419f364 fix-redeclarations.patch
+422dba4b43fb14d68263361dd917a866a9ff033d4a5f60faf668385b80093f7f3f6025de149810f9287790acc07ed5f5feb15c7b23ff083ab74eb21c22bf0f05 a2ps-automake-1.12.patch
+4336ad6b40ecfd16ac01304a4d27b7715e5c19ef3777b57f0ea152fa1a57db476605c330b5c0091dfbf95705e4345806c8393e6c3f3e89d528bd94cc91a9beb9 automake.patch
+22b9e23d74a914a3332615b911c655cf5e63ce445073e2cd7faa353c16b3e9c813cc4f3b20db68795f09da8b5a8952effe4727e6d1a429699ad66487bd2cab32 CVE-2001-1593.patch
+1816c8c98c8902801c5376ed86821b60d67c18fe9f5534936e3fa9ffaae01f1b1f5b4cf84fa176ba30ee7350737fffa3c2e4b60cf03cb9e64bc93487a6448bb1 CVE-2014-0466.patch"
diff --git a/community/a2ps/CVE-2001-1593.patch b/community/a2ps/CVE-2001-1593.patch
new file mode 100644
index 0000000000..cff6225355
--- /dev/null
+++ b/community/a2ps/CVE-2001-1593.patch
@@ -0,0 +1,65 @@
+--- a2ps-4.13/lib/routines.c.security Sat Oct 16 05:46:37 1999
++++ a2ps-4.13/lib/routines.c Mon Feb 12 17:45:15 2001
+@@ -242,3 +242,50 @@
+ /* Don't complain if you can't unlink. Who cares of a tmp file? */
+ unlink (filename);
+ }
++
++/*
++ * Securely generate a temp file, and make sure it gets
++ * deleted upon exit.
++ */
++static char ** tempfiles;
++static unsigned ntempfiles;
++
++static void
++cleanup_tempfiles()
++{
++ while (ntempfiles--)
++ unlink(tempfiles[ntempfiles]);
++}
++
++char *
++safe_tempnam(const char *pfx)
++{
++ char *dirname, *filename;
++ int fd;
++
++ if (!(dirname = getenv("TMPDIR")))
++ dirname = "/tmp";
++
++ tempfiles = (char **) realloc(tempfiles,
++ (ntempfiles+1) * sizeof(char *));
++ if (tempfiles == NULL)
++ return NULL;
++
++ filename = malloc(strlen(dirname) + strlen(pfx) + sizeof("/XXXXXX"));
++ if (!filename)
++ return NULL;
++
++ sprintf(filename, "%s/%sXXXXXX", dirname, pfx);
++
++ if ((fd = mkstemp(filename)) < 0) {
++ free(filename);
++ return NULL;
++ }
++ close(fd);
++
++ if (ntempfiles == 0)
++ atexit(cleanup_tempfiles);
++ tempfiles[ntempfiles++] = filename;
++
++ return filename;
++}
+--- a2ps-4.13/lib/routines.h.security Mon Oct 18 21:24:41 1999
++++ a2ps-4.13/lib/routines.h Mon Feb 12 17:39:30 2001
+@@ -255,7 +255,8 @@
+ /* If _STR_ is not defined, give it a tempname in _TMPDIR_ */
+ #define tempname_ensure(Str) \
+ do { \
+- (Str) = (Str) ? (Str) : tempnam (NULL, "a2_"); \
++ (Str) = (Str) ? (Str) : safe_tempnam("a2_"); \
+ } while (0)
++char * safe_tempnam(const char *);
+
+ #endif
diff --git a/community/a2ps/CVE-2014-0466.patch b/community/a2ps/CVE-2014-0466.patch
new file mode 100644
index 0000000000..85199e35b0
--- /dev/null
+++ b/community/a2ps/CVE-2014-0466.patch
@@ -0,0 +1,30 @@
+Description: CVE-2014-0466: fixps does not invoke gs with -dSAFER
+ A malicious PostScript file could delete files with the privileges of
+ the invoking user.
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/742902
+Author: Salvatore Bonaccorso <carnil@debian.org>
+Last-Update: 2014-03-28
+
+--- a/contrib/fixps.in
++++ b/contrib/fixps.in
+@@ -389,7 +389,7 @@
+ eval "$command" ;;
+ gs)
+ $verbose "$program: making a full rewrite of the file ($gs)." >&2
+- $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
++ $gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ esac
+ )
+ fi
+--- a/contrib/fixps.m4
++++ b/contrib/fixps.m4
+@@ -307,7 +307,7 @@
+ eval "$command" ;;
+ gs)
+ $verbose "$program: making a full rewrite of the file ($gs)." >&2
+- $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
++ $gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ esac
+ )
+ fi
diff --git a/community/a2ps/a2ps-4.13-manpage-chmod.patch b/community/a2ps/a2ps-4.13-manpage-chmod.patch
new file mode 100644
index 0000000000..e0c61124e9
--- /dev/null
+++ b/community/a2ps/a2ps-4.13-manpage-chmod.patch
@@ -0,0 +1,12 @@
+diff -ur a2ps-4.13.orig/man/Makefile.maint a2ps-4.13/man/Makefile.maint
+--- a2ps-4.13.orig/man/Makefile.maint 2002-03-04 20:46:26.000000000 +0200
++++ a2ps-4.13/man/Makefile.maint 2007-02-19 21:50:29.000000000 +0200
+@@ -20,7 +20,7 @@
+ --include=$(basename $@).x \
+ --include=common.x \
+ $(executable) > $@-t || exit 1; \
+- chmod -w $@-t || exit 1; \
++ chmod a-w $@-t || exit 1; \
+ rm -f $@ || exit 1; \
+ mv $@-t $@ || exit 1; \
+ else \
diff --git a/community/a2ps/a2ps-4.13c-emacs.patch b/community/a2ps/a2ps-4.13c-emacs.patch
new file mode 100644
index 0000000000..f1cd5d9ebd
--- /dev/null
+++ b/community/a2ps/a2ps-4.13c-emacs.patch
@@ -0,0 +1,10 @@
+--- a2ps-4.13/contrib/emacs/a2ps-print.el.orig 2005-12-05 08:03:48.000000000 +0100
++++ a2ps-4.13/contrib/emacs/a2ps-print.el 2005-12-06 16:38:14.000000000 +0100
+@@ -93,6 +93,7 @@
+ (concat "--center-title=" name)
+ (concat "--footer=" (concat name " Emacs buffer"))
+ (concat "--pretty-print=" filetype)
++ (concat "-d")
+ ;Uncommenting the following gives a print preview (only):
+ ; (concat "--output=/tmp/foo.ps")
+ )
diff --git a/community/a2ps/a2ps-4.13c-fnmatch-replacement.patch b/community/a2ps/a2ps-4.13c-fnmatch-replacement.patch
new file mode 100644
index 0000000000..c49ab78c93
--- /dev/null
+++ b/community/a2ps/a2ps-4.13c-fnmatch-replacement.patch
@@ -0,0 +1,43 @@
+diff -Naurp a2ps-4.13.orig/lib/fnmatch.c a2ps-4.13/lib/fnmatch.c
+--- a2ps-4.13.orig/lib/fnmatch.c 2002-03-04 12:46:25 -0600
++++ a2ps-4.13/lib/fnmatch.c 2006-05-27 11:41:15 -0500
+@@ -27,18 +27,6 @@
+ #include <fnmatch.h>
+ #include <ctype.h>
+
+-
+-/* Comment out all this code if we are using the GNU C Library, and are not
+- actually compiling the library itself. This code is part of the GNU C
+- Library, but also included in many other GNU distributions. Compiling
+- and linking in this code is a waste when using the GNU C library
+- (especially if it is a shared library). Rather than having every GNU
+- program understand `configure --with-gnu-libc' and omit the object files,
+- it is simpler to just do this in the source for each such file. */
+-
+-#if defined _LIBC || !defined __GNU_LIBRARY__
+-
+-
+ # if defined STDC_HEADERS || !defined isascii
+ # define ISASCII(c) 1
+ # else
+@@ -52,10 +40,13 @@
+ extern int errno;
+ # endif
+
++/* fnmatch replacement taken from the GNU C Library for systems that
++ provide a broken implementation. */
++
+ /* Match STRING against the filename pattern PATTERN, returning zero if
+ it matches, nonzero if not. */
+ int
+-fnmatch (const char *pattern, const char *string, int flags)
++rpl_fnmatch (const char *pattern, const char *string, int flags)
+ {
+ register const char *p = pattern, *n = string;
+ register char c;
+@@ -233,5 +224,3 @@ fnmatch (const char *pattern, const char
+
+ # undef FOLD
+ }
+-
+-#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/community/a2ps/a2ps-4.14-check-mempcpy.patch b/community/a2ps/a2ps-4.14-check-mempcpy.patch
new file mode 100644
index 0000000000..7b820cead0
--- /dev/null
+++ b/community/a2ps/a2ps-4.14-check-mempcpy.patch
@@ -0,0 +1,12 @@
+--- a2ps-4.14-orig/configure.in 2008-04-16 08:36:03.000000000 +0200
++++ a2ps-4.14/configure.in 2008-04-16 08:36:29.000000000 +0200
+@@ -137,7 +137,8 @@
+ ad_REPLACE_FUNC_STRCASECMP
+ ad_REPLACE_FUNC_STRNCASECMP
+ ad_REPLACE_FUNC_RENAME
+-AC_CHECK_FUNCS(uname strchr strerror strerror_r getcwd bcopy bzero tempnam strsignal psignal setlocale)
++AC_CHECK_FUNCS(uname strchr strerror strerror_r getcwd bcopy bzero \
++ tempnam strsignal psignal setlocale mempcpy)
+ ad_FUNC_SYSTEMPAPERNAME
+ ad_FUNC_ATEXIT
+ ad_FUNC_STRFTIME
diff --git a/community/a2ps/a2ps-4.14-fix-stpcpy-proto.patch b/community/a2ps/a2ps-4.14-fix-stpcpy-proto.patch
new file mode 100644
index 0000000000..c5bdfc57cd
--- /dev/null
+++ b/community/a2ps/a2ps-4.14-fix-stpcpy-proto.patch
@@ -0,0 +1,17 @@
+=== modified file 'lib/xstrrpl.c'
+--- a/lib/xstrrpl.c 2008-04-14 18:04:50 +0000
++++ b/lib/xstrrpl.c 2008-04-14 18:20:20 +0000
+@@ -20,12 +20,10 @@
+
+ #include "system.h"
+ #include <assert.h>
+ #include "xstrrpl.h"
+
+-extern char * stpcpy();
+-
+ /* Perform subsitutions in string. Result is malloc'd
+ E.g., result = xstrrrpl ("1234", subst) gives result = "112333"
+ where subst = { {"1", "11"}, {"3", "333"}, { "4", ""}}
+ */
+ char *
+
diff --git a/community/a2ps/a2ps-automake-1.12.patch b/community/a2ps/a2ps-automake-1.12.patch
new file mode 100644
index 0000000000..b0b4cbaff4
--- /dev/null
+++ b/community/a2ps/a2ps-automake-1.12.patch
@@ -0,0 +1,43 @@
+--- ./configure.in.orig
++++ ./configure.in
+@@ -43,7 +43,6 @@
+ AC_ISC_POSIX
+ AC_PROG_CPP
+ AM_PROG_CC_STDC
+-AM_C_PROTOTYPES
+ AC_PROG_YACC
+ fp_PROG_ECHO
+ AC_PROG_GPERF
+--- ./lib/Makefile.am.orig
++++ ./lib/Makefile.am
+@@ -17,7 +17,6 @@
+
+ ## Process this file with automake to produce Makefile.in.
+ ## This seems to make problems with some makes
+-AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr
+
+ #
+ # Definition of the local target
+--- ./src/Makefile.am.orig
++++ ./src/Makefile.am
+@@ -23,9 +23,6 @@
+
+ ## Process this file with automake to produce Makefile.in
+
+-## Since this package is written in ansi, be ready to un-ansify
+-AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr
+-
+ bin_PROGRAMS = a2ps
+
+ DEFS = @DEFS@ -DLOCALEDIR=\"$(datadir)/locale\"
+--- ./contrib/sample/Makefile.am.orig
++++ ./contrib/sample/Makefile.am
+@@ -25,8 +25,6 @@
+
+ ## Process this file with automake to produce Makefile.in
+
+-## Since this package is written in ansi, be ready to un-ansify
+-AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr
+ localedir = $(datadir)/locale
+
+ noinst_PROGRAMS = sample
diff --git a/community/a2ps/automake.patch b/community/a2ps/automake.patch
new file mode 100644
index 0000000000..5a76359367
--- /dev/null
+++ b/community/a2ps/automake.patch
@@ -0,0 +1,30 @@
+--- ./configure.in.orig 2012-12-31 09:32:06.411787207 +0000
++++ ./configure.in 2012-12-31 09:33:15.672384454 +0000
+@@ -12,7 +12,7 @@
+ # Initialize automake
+ AM_INIT_AUTOMAKE
+
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADER(config.h)
+
+ # Specify the liba2ps version number
+ LIBVERSION=1:0:0
+@@ -42,7 +42,6 @@
+ AC_MINIX
+ AC_ISC_POSIX
+ AC_PROG_CPP
+-AM_PROG_CC_STDC
+ AC_PROG_YACC
+ fp_PROG_ECHO
+ AC_PROG_GPERF
+--- ./m4/protos.m4.orig 2012-12-31 09:43:24.994398048 +0000
++++ ./m4/protos.m4 2012-12-31 09:43:57.681443768 +0000
+@@ -6,7 +6,7 @@
+ # serial 1
+
+ AC_DEFUN([AM_C_PROTOTYPES],
+-[AC_REQUIRE([AM_PROG_CC_STDC])
++[AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_MSG_CHECKING([for function prototypes])
+ if test "$am_cv_prog_cc_stdc" != no; then
diff --git a/community/a2ps/fix-redeclarations.patch b/community/a2ps/fix-redeclarations.patch
new file mode 100644
index 0000000000..170df701b6
--- /dev/null
+++ b/community/a2ps/fix-redeclarations.patch
@@ -0,0 +1,20 @@
+--- a2ps-4.14.orig/lib/options.c
++++ a2ps-4.14/lib/options.c
+@@ -57,7 +57,6 @@
+
+ #define MAN_LINES 66 /* no lines for a man */
+ extern char *program_name;
+-extern const char *program_invocation_name;
+
+ /*
+ * Hooks used
+--- a2ps-4.14.orig/src/main.c
++++ a2ps-4.14/src/main.c
+@@ -104,7 +104,6 @@
+ defined twice, see lib/confg.gperf, handling of `Options:'. */
+
+ char *program_name;
+-const char *program_invocation_name;
+
+ /* Stores the data of liba2ps. */
+