summaryrefslogtreecommitdiffstats
path: root/app-text
diff options
context:
space:
mode:
Diffstat (limited to 'app-text')
-rw-r--r--app-text/a2ps/Manifest22
-rw-r--r--app-text/a2ps/a2ps-4.14-r4.ebuild155
-rw-r--r--app-text/a2ps/files/50a2ps-gentoo.el5
-rw-r--r--app-text/a2ps/files/a2ps-4.13-manpage-chmod.patch12
-rw-r--r--app-text/a2ps/files/a2ps-4.13-select-freebsd.patch57
-rw-r--r--app-text/a2ps/files/a2ps-4.13-stdout.diff13
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-emacs.patch10
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-fixps.patch19
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-fnmatch-replacement.patch43
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-locale-gentoo.diff25
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-psmandup.diff19
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-psset.patch11
-rw-r--r--app-text/a2ps/files/a2ps-4.13c-stdarg.patch74
-rw-r--r--app-text/a2ps/files/a2ps-4.14-check-mempcpy.patch12
-rw-r--r--app-text/a2ps/files/a2ps-4.14-cleanup.patch106
-rw-r--r--app-text/a2ps/files/a2ps-4.14-fix-stpcpy-proto.patch17
-rw-r--r--app-text/a2ps/files/a2ps-4.14-ja-cleanup.patch122
-rw-r--r--app-text/a2ps/files/a2ps-4.14-psset.patch21
-rw-r--r--app-text/a2ps/files/a2ps-4.14-ptrdiff_t.patch14
-rw-r--r--app-text/a2ps/files/a2ps-ds2.patch53
-rwxr-xr-xapp-text/a2ps/files/cyr2ps49
21 files changed, 859 insertions, 0 deletions
diff --git a/app-text/a2ps/Manifest b/app-text/a2ps/Manifest
new file mode 100644
index 0000000..f5ca2fd
--- /dev/null
+++ b/app-text/a2ps/Manifest
@@ -0,0 +1,22 @@
+AUX 50a2ps-gentoo.el 218 SHA256 421f04aba83fc2fdf02230a86d940bae039206473cb070f2cdd78b0d0725d9e3 SHA512 d1696581767c62903ea24cc7ffec2f25c30b64a0a7aa76d22e8a1872c5ea9b1aaa0f88f7ce24b1ee57f3da57bd3eaa36f2c5fd388437ce9a935bd82912075269 WHIRLPOOL 2a807602fcc08d914fd22f3cc77b16767a1b6303ddaa9802613c0df3bdcced07c225a65ac33808af0a3b2669601ebf3eb18f8976a587b6b969c6baf0c44c5fe0
+AUX a2ps-4.13-manpage-chmod.patch 461 SHA256 032c4698c1dabb1a72978b9aefef7a8895098fb5a7e46e81d861fedfef3b11ab SHA512 f3dc2698ee989928b3179b65b01bf12d828f4428bd860f6f1a3811daaa9d6256b353c2acb5cd4bf392dd89b040f8e9c15420ab4373f3d54b8b60652aaf23f864 WHIRLPOOL d94998e5a7bbbdd6fc4ccccbb6701b25c25ff4fd90a8619c7ddca954053f44c540d3d7756a8165c62889a63015b7c96fa9b5c5b384d078b4ce9f8e83b8d8ce5f
+AUX a2ps-4.13-select-freebsd.patch 1582 SHA256 1ef965e835524b4d45dbe98038817d48ebb0c152d7c2c62c1e3d29f85bb0e2ae SHA512 7a86980077ae6cc0458e112304a1f50582a7008c27935f1a41659ff16a4b21dc0980704797c4125a7c176f106cf6d26a8b06b8ae35d04650657fa57d257ab751 WHIRLPOOL 53fbef43f538de238ebb664b8ff0a811040c65a461412b2ba9f927bcfbdf01de8c07472d897209edd51f16475f0b92359d7a98f3a759035b787792cebf8e6006
+AUX a2ps-4.13-stdout.diff 462 SHA256 bde80a714f5de1221ec828cf0f33859561510190e97b08f4ba62ab41ad26fc74 SHA512 61be8be21b08f39b0a7509bb96f67139165421baaaa20968ec54f9df37d5b8c355f06bc76513ed10c8c7d61608ed766ed28d4498211dff285d6b381aaf2454dc WHIRLPOOL 2213de93347dae7e2350c4932f3556a5d8cc198d64c7ac245de6328ef97e2e291fc83e086428d487450aee5ba92e5f738aee65a40987e4af088bc6d207b1b0e0
+AUX a2ps-4.13c-emacs.patch 442 SHA256 943739a788db47f10942477754f42c8c9b22cdaad4463bea4103c31a330de76a SHA512 0ef1a215ecb757e249c4d4bdf9a789419c6cd433f7e330783fef13a0158c57c5c5e6a22526d8abcca0919bdb1dc08337869fdd3f0fe192284ca087eafad322a3 WHIRLPOOL 2e204b9aed61c118f699f3434e6d6679564c8cd9ce7079be7b020a78813be27e1212293a39216ab0519ac34dc5eda30999836a7af202fa37b27a2abe9288198d
+AUX a2ps-4.13c-fixps.patch 549 SHA256 ac32464a1a9bb2f4f557a3567a94928e4d8cbdd20ebaee0e1811f076d7e7456e SHA512 1de385f24940d4b54fe64689d713bb78425f5f9950644890cf7d76ba5e411215cd8738a9570c6b163f219d75949572ae5f004f6849bcf82d3003c26b02977346 WHIRLPOOL 82f1f3acd3ac9640f98c64deb1b4c14450f2a0c01bf539664637a3c72650cb8796a3de3920b6972f3bc96e1a54d58d0b2512a079ae22e483bc9efa96cb773e4c
+AUX a2ps-4.13c-fnmatch-replacement.patch 1500 SHA256 5d1b8a8791fa2a36c23f43ef153a724cce1f8eec8fb92ab886f52fae7f8f3be3 SHA512 5509ae1277ff1f1f487fb106ed6673eb67fa7d1531a35bfa087f78a0bdb4dc0bf38c69b7fab95161a19406fc1acaef09b22b8a05ef603c6d43a8d7a8c3077b56 WHIRLPOOL c08ae041456250152d1355a09ec2b253da6637d67d7834ade169550903132c44345647ceefeef7a4bb2168504752b1b5b6a88d15e8f395bb9b1ed618c1e98286
+AUX a2ps-4.13c-locale-gentoo.diff 981 SHA256 2878415235a2d23231e4295fba1adf0435ddcc539394f7ebe49cf23fdf76ec29 SHA512 56800ba839e04a89088c130df9676595cbcdfa15fb1853eb85560e9d529e93d6db4b5813375ede8cf82aa8b0fd51f81f5f080e2c5d38dc1a7739a8e62e0ab997 WHIRLPOOL 618928fad266cbb3335a9408a78c30fd62a87596631f8e316e35db5d219e11ada62096db7f000db80ca963bb6695441f54781ab6a8c4bb71ef64ef458d81ba03
+AUX a2ps-4.13c-psmandup.diff 569 SHA256 2e64be23e030ed0f08b243f0513800336d06739fc7e347a09c130958531b85cd SHA512 df2eead6d38d1250cd6ac34b445de6685bd73360d93fb4f1d8f1b959aac9046f15e426485f72b1873ab0fd5f116db6b2b829c42edab147cb65f24c2d1028e009 WHIRLPOOL 7a5be2e7144c6692f00db8868289258ddba672b25139be7f24dc36ad26e93e7eb4311ebdbfdb82c24bbce042f69278ad517714b68a058fa8087d4cbdd727dd6c
+AUX a2ps-4.13c-psset.patch 469 SHA256 0ddb899c48c897fc333e73702f9dc666be4cbd6215da6db860784fb503500b68 SHA512 c12baf7d542b6425598870978b6bc83d30f1f5a43b768b34707ca945f62c8b0f6523714c4d00375198799a8c4da0296209bd8b45677413893c83807ea798ddb6 WHIRLPOOL c13aa6a0bb0cca01ce622dad147b44a853328505f5e8940744a6072cdf94c852a32754065407f60233e357acef66b8c33d812f70d5df0e8539dd53a915b1cc04
+AUX a2ps-4.13c-stdarg.patch 1505 SHA256 9e7e630386b694b90b0bc6454bedc7c102d46b8bb6a6246eabd37e8b6d639c68 SHA512 3e71c84ccb3553873011a26c0ef17a2678fa3d79db4531a81f11360a0caf83d541205d2f566b79bf826ef1968120433310202ce77a1910d68ce32e3c05145391 WHIRLPOOL 445bb15878b3ef61eeec7b6f34004d848e4c2d1af038eae233959f9d496b426eea216244291cb7fc0ae5a81d8a9e5a6e55132619a0eff6264eab4f4f492936d7
+AUX a2ps-4.14-check-mempcpy.patch 514 SHA256 7ec2164888d1621a8406d431ed3accd137ec8f92e0ca885175bc1c17010519a1 SHA512 6835f5e9205cb549da52c4a3c13aad601c9e9d294f0f35ebe4d8cc6f8bd8b5f6fe77b857f8c92f552a43c02eb6de812021c078ce597c319bde176f0e91cd167b WHIRLPOOL 00a2fdc4c2267d6b9548c7c908387d544ee5a8579453b3974ef54cdc44df9f382db764cd098949765002b7bde79005088a460ed690d3cea20c62f5e8d749045e
+AUX a2ps-4.14-cleanup.patch 2633 SHA256 5c9285a014a8e57066978b93afbdafdd47d11ed01afaa7c15af4f20c8d2b991c SHA512 07afbf25203c6eacb92ab8c32fa6b913a832163a03fcd47c163cf3bdfd0cf07efd960342005fd7923108b978bc0395919c7f70e048d547b4bc5c083eed86a1f3 WHIRLPOOL ccdba46c3f562d102b7abf66e2f0eef334fffe4e19aa86097cde21ede3b05a217cac1c78b098d739209fffab6a6ea9b63622b2bd122ebc9f7c22c1991387d544
+AUX a2ps-4.14-fix-stpcpy-proto.patch 436 SHA256 3707120fbbbd8306f01fec785c18b9fa2eee02ec689cde5ad251a9337af6573e SHA512 439af060da55d93e8fa6962f7b77c292e47b1a39d987c35010edd52f0ebf360337b5bd29fd134d4d4ab8333187672e7ae97c2d0259c706e38a2cf9d719dcf7bb WHIRLPOOL 886d71fc29fc02d8e8dde050108f4e9b59ece6af2d723a7ba0377dfe1730e3ac6543f02b395b250ee2672e0bf56cb1f4818dbcc52f2c17103f0f1d6c3583d750
+AUX a2ps-4.14-ja-cleanup.patch 3210 SHA256 f2d4ff66d3d908d65a2ce4dd69bceb933d6b02a6141996eae80f00dad389e68b SHA512 1a2ce34b5b0bc79bf269fe171c64bcdef0a87bf4efa8508eee851228a1483efce9c8945a17def7abc4cdfe2f1f8611d63995d98099e290d06fb1be430350b778 WHIRLPOOL f085bc34785e8a1ce9a6d65418d8031032c977530a1efae777c88a1bc2598a376197afe453a4f0bf3d3d7fcb9c4473247cf565cf8c3ccd6e3ff97116a2ed44ba
+AUX a2ps-4.14-psset.patch 616 SHA256 8525836efb9ba5db025b013e0262912ccabc77773307a8b79da6ec1f7444a9e3 SHA512 3118d91519c81e5e9f46a5386e9db757936231e71047ba8579b3d969a7c824bad6325b54221a61a0b171bb87669b548704a068bc71a1cd3b48d3a32416fe0c0f WHIRLPOOL 86eb4c5a06c07a7acea062f7c49b3deb9866569bda3d07382684859575d84978fb6677e9210dc0fa99a42b2908b9f14e434e349e69a0797c88f96d6539df19fe
+AUX a2ps-4.14-ptrdiff_t.patch 367 SHA256 09fa3327d064f3246103894b8abbbea2c7b0d2446080a4b5c9cd0510b9efd6d0 SHA512 b9ebff895614a20b8f9e891ce53cf0f7ec38452619f7e907deadff22840a019737dd129690f5ffec91f7f798ae03bd0c7c62f1aa751589865f589362825038c5 WHIRLPOOL 35adb3bfadb7e2601138df84757aa5111580aa70b4347661c237755bc29108739d570b0bee7c626f57bcb7278b05266bdcd4e7113ade633c96dda30014bcb221
+AUX a2ps-ds2.patch 2023 SHA256 e144f4a7b4d35b0eb54662b2a919750a95c7d6294e3fb5ac25fb57008f1de045 SHA512 0977ad1f9ed1a54396fa009338ef7e636c86e042b0f68a7dabcd25f61a61923f02fb85d26176bc9dba8b744f8ce50ca5b4a786abc979d98d4b6626c59c05dae1 WHIRLPOOL 5f6c10e5de045750403c0274391ca793a3798995263102230167f0b50c1d98059ffcf13e5284d98b3cddb6ee37876582d2333fe95e3bd334e1411e85ba3333cb
+AUX cyr2ps 873 SHA256 2eeec715c902b1f4925ce98c7bfb43fe6e114a9de2d36745cdb20a109fd6b3a5 SHA512 84c9ef6f66dfd8c470c98ec066a20286bef970a0175ab5714be3e2541d0e9653c55c33220294031ae2a090722f77d10476ad6434fb673265879b10ab8307c93e WHIRLPOOL 37504468148a984eb4756c79060778916617d8e2bdbc388fbbfeeb0286e5223ee9a47027172d9fb1d8c4bffa51fddcb77bb44b0988fbe1068fa287aa031ff0ab
+DIST a2ps-4.14-ja_nls.patch.gz 27576 SHA256 90b2a4caf680f04ac8c325a4bc7434edf038ef7059003179b7fa65a5bafdecdc SHA512 f02f553dd9d9dbd9dfe41ebfe103493000aa4e9de5634c94e7453f73b66d88fea6b0010095913a4a99c7285990a1df1ebcc39da451b2b34f96b0c191112b125f WHIRLPOOL 38a532bc7f696cf3a1addc502b6ad2d26ed4222b770b0e9fc4633fc81cad911df7e64781516a84cdc589965d12d51142c0a06980be7211b0a6d9bf279a11d55e
+DIST a2ps-4.14.tar.gz 2552507 SHA256 f3ae8d3d4564a41b6e2a21f237d2f2b104f48108591e8b83497500182a3ab3a4 SHA512 fd6ac8ab47d789114c283e8ca508f7f56feabd1a189f4ac772cad9e6be7e3791e210892cfffd04ad1d39efe4b15386b2e61bf4cd56b70ed581c0554f36bfe06f WHIRLPOOL f0e445b760e0fdee031c9b8204430880f8e46d0eee2b580bec0dca35564818b7a8925b5941346c008a5ef32dedc28768b43f0e58f3a0e71f289bf593e5325e8d
+EBUILD a2ps-4.14-r4.ebuild 3667 SHA256 b4625e2e28b0faf9080863ee13237cff7ff83f0572dba4ce5bf9469179d096f6 SHA512 cd3f7a95236576f372dbc6e947e01d050225f37b82bdabc12363e27fa272ff50a04768c8f5ac8343d929e3caec5f108d70cce29f52b1f6436c0f297373575076 WHIRLPOOL 1f0be15ae0eee46c89607cc8a3d9831021f29f02f4a4727c2c158bc203a46c8fb3520fba440bcff524542b61d7fd0882725ae3ddd8002541914d83582d742388
diff --git a/app-text/a2ps/a2ps-4.14-r4.ebuild b/app-text/a2ps/a2ps-4.14-r4.ebuild
new file mode 100644
index 0000000..e7cf34b
--- /dev/null
+++ b/app-text/a2ps/a2ps-4.14-r4.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools elisp-common eutils flag-o-matic
+
+DESCRIPTION="Any to PostScript filter"
+HOMEPAGE="http://www.inf.enst.fr/~demaille/a2ps/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz
+ linguas_ja? ( mirror://gentoo/${P}-ja_nls.patch.gz )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="emacs latex linguas_ja nls static-libs userland_BSD userland_GNU vanilla"
+
+RESTRICT=test
+
+RDEPEND="app-text/ghostscript-gpl
+ app-text/libpaper
+ >=app-text/psutils-1.17
+ app-text/wdiff
+ emacs? ( virtual/emacs )
+ latex? ( virtual/latex-base )
+ nls? ( virtual/libintl )
+ userland_GNU? ( >=sys-apps/coreutils-6.10-r1 )
+ userland_BSD? ( sys-freebsd/freebsd-ubin )"
+DEPEND="${RDEPEND}
+ >=dev-util/gperf-2.7.2
+ virtual/yacc
+ nls? ( sys-devel/gettext )"
+
+SITEFILE=50${PN}-gentoo.el
+
+S=${WORKDIR}/${PN}-${PV:0:4}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.13c-locale-gentoo.diff
+ # this will break
+ #epatch "${FILESDIR}/${PN}-4.13c-stdarg.patch"
+ use vanilla || epatch "${FILESDIR}"/${PN}-4.13-stdout.diff
+ if use linguas_ja; then
+ epatch "${DISTDIR}"/${P}-ja_nls.patch.gz
+ # bug #335803
+ epatch "${FILESDIR}"/${P}-ja-cleanup.patch
+ else
+ epatch "${FILESDIR}"/${P}-cleanup.patch
+ fi
+
+ # fix fnmatch replacement, bug #134546
+ epatch "${FILESDIR}"/${PN}-4.13c-fnmatch-replacement.patch
+
+ # bug #122026
+ epatch "${FILESDIR}"/${P}-psset.patch
+
+ # fix emacs printing, bug #114627
+ epatch "${FILESDIR}"/a2ps-4.13c-emacs.patch
+
+ # fix chmod error, #167670
+ epatch "${FILESDIR}"/a2ps-4.13-manpage-chmod.patch
+
+ # add configure check for mempcpy, bug 216588
+ epatch "${FILESDIR}"/${P}-check-mempcpy.patch
+
+ # fix compilation error due to invalid stpcpy() prototype, bug 216588
+ epatch "${FILESDIR}"/${P}-fix-stpcpy-proto.patch
+
+ # fix compilation error due to obstack.h issue, bug 269638
+ epatch "${FILESDIR}"/${P}-ptrdiff_t.patch
+
+#SDS
+ epatch ${FILESDIR}/a2ps-ds2.patch
+#EDS
+
+ # fix building with sys-devel/automake >= 1.12, bug 420503
+ rm -f {.,ogonkify}/aclocal.m4
+ sed -i \
+ -e '/^AM_C_PROTOTYPES/d' \
+ -e '/^AUTOMAKE_OPTIONS.*ansi2knr/d' \
+ -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
+ -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
+ configure.in {contrib/sample,lib,src}/Makefile.am m4/protos.m4 || die
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags -DPROTOTYPES #420503
+
+ local myconf="COM_netscape=no COM_acroread=no"
+
+ use emacs || myconf="${myconf} EMACS=no"
+ use latex || myconf="${myconf} COM_latex=no"
+
+ export LANG=C LC_ALL=C
+
+#SDS
+ econf \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ --sysconfdir="${EPREFIX}"/etc/a2ps \
+ --with-encoding=KOI8 \
+ $(use_enable nls) \
+ ${myconf}
+#EDS
+
+}
+
+src_compile() {
+ # parallel make b0rked
+ emake -j1
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ lispdir="${EPREFIX}${SITELISP}"/${PN} \
+ install
+
+ newdoc "${ED}"/usr/share/a2ps/README README.a2ps
+ newdoc "${ED}"/usr/share/a2ps/ppd/README README.a2ps.ppd
+ newdoc "${ED}"/usr/share/ogonkify/README README.ogonkify
+
+ rm -f "${ED}"/usr/share/{a2ps,a2ps/ppd,ogonkify}/README
+
+ prune_libtool_files
+
+ if use emacs; then
+ elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
+ fi
+
+ dodoc ANNOUNCE AUTHORS ChangeLog FAQ NEWS README* THANKS TODO
+
+#SDS
+ install -c -m 755 ${FILESDIR}/cyr2ps ${D}/usr/bin
+#EDS
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+
+#SDS
+ (
+ cd /usr/share/a2ps/afm
+ ./make_fonts_map.sh
+ mv -f fonts.map.new fonts.map || die
+ )
+#EDS
+
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/app-text/a2ps/files/50a2ps-gentoo.el b/app-text/a2ps/files/50a2ps-gentoo.el
new file mode 100644
index 0000000..3e12daa
--- /dev/null
+++ b/app-text/a2ps/files/50a2ps-gentoo.el
@@ -0,0 +1,5 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'a2ps-mode "a2ps" nil t)
+(autoload 'a2ps-buffer "a2ps-print" nil t)
+(autoload 'a2ps-region "a2ps-print" nil t)
+(add-to-list 'auto-mode-alist '("\\.a2ps\\'" . a2ps-mode))
diff --git a/app-text/a2ps/files/a2ps-4.13-manpage-chmod.patch b/app-text/a2ps/files/a2ps-4.13-manpage-chmod.patch
new file mode 100644
index 0000000..e0c6112
--- /dev/null
+++ b/app-text/a2ps/files/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/app-text/a2ps/files/a2ps-4.13-select-freebsd.patch b/app-text/a2ps/files/a2ps-4.13-select-freebsd.patch
new file mode 100644
index 0000000..a2c3889
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13-select-freebsd.patch
@@ -0,0 +1,57 @@
+--- src/select.c.orig Thu Dec 16 02:04:56 1999
++++ src/select.c Sat Aug 21 12:05:31 2004
+@@ -131,6 +131,36 @@
+ return 1;
+ }
+
++/* escapes the name of a file so that the shell groks it in 'single' q.marks.
++ The resulting pointer has to be free()ed when not longer used. */
++char *
++shell_escape(const char *fn)
++{
++ size_t len = 0;
++ const char *inp;
++ char *retval, *outp;
++
++ for(inp = fn; *inp; ++inp)
++ switch(*inp)
++ {
++ case '\'': len += 4; break;
++ default: len += 1; break;
++ }
++
++ outp = retval = malloc(len + 1);
++ if(!outp)
++ return NULL; /* perhaps one should do better error handling here */
++ for(inp = fn; *inp; ++inp)
++ switch(*inp)
++ {
++ case '\'': *outp++ = '\''; *outp++ = '\\'; *outp++ = '\'', *outp++ = '\''; break;
++ default: *outp++ = *inp; break;
++ }
++ *outp = 0;
++
++ return retval;
++}
++
+ /* What says file about the type of a file (result is malloc'd). NULL
+ if could not be run. */
+
+@@ -144,11 +174,15 @@
+ if (IS_EMPTY (job->file_command))
+ return NULL;
+
++ filename = shell_escape(filename);
++ if(filename == NULL)
++ return NULL;
+ /* Call file(1) with the correct option */
+- command = ALLOCA (char, (2
++ command = ALLOCA (char, (4
+ + strlen (job->file_command)
+ + ustrlen (filename)));
+- sprintf (command, "%s %s", job->file_command, (const char *) filename);
++ sprintf (command, "%s '%s'", job->file_command, (const char *) filename);
++ free(filename);
+ message (msg_tool, (stderr, "Reading pipe: `%s'\n", command));
+ file_out = popen (command, "r");
+
diff --git a/app-text/a2ps/files/a2ps-4.13-stdout.diff b/app-text/a2ps/files/a2ps-4.13-stdout.diff
new file mode 100644
index 0000000..1e40e61
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13-stdout.diff
@@ -0,0 +1,13 @@
+--- lib/printers.c.orig Tue Oct 12 00:01:59 1999
++++ lib/printers.c Wed May 2 11:23:25 2001
+@@ -315,8 +315,8 @@
+ res->ppd = NULL; /* Printer's ppd are not read yet */
+
+ /* Output */
+- /* Default is to send to default printer */
+- res->flag_output_is_printer = true;
++ /* Default is to send to stdout */
++ res->flag_output_is_printer = false;
+ res->flag_output_name = NULL;
+ res->output_is_file = true;
+ res->output_name = NULL;
diff --git a/app-text/a2ps/files/a2ps-4.13c-emacs.patch b/app-text/a2ps/files/a2ps-4.13c-emacs.patch
new file mode 100644
index 0000000..f1cd5d9
--- /dev/null
+++ b/app-text/a2ps/files/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/app-text/a2ps/files/a2ps-4.13c-fixps.patch b/app-text/a2ps/files/a2ps-4.13c-fixps.patch
new file mode 100644
index 0000000..13b196f
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13c-fixps.patch
@@ -0,0 +1,19 @@
+--- contrib/fixps.in.orig 2004-12-20 00:11:40.000000000 +0100
++++ contrib/fixps.in 2004-12-20 00:14:12.000000000 +0100
+@@ -38,7 +38,7 @@
+ run_gs=0
+ # What action to perform: fixps, cat, check, and gs
+ task=fixps
+-tmpdir=/tmp/$program.$$
++tmpdir=`mktemp -d -t fixps.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+ verbose=echo
+
+ # The version/usage strings
+@@ -191,7 +191,6 @@
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+ fi
+
+-mkdir $tmpdir
+ fixps_sed=$tmpdir/fixps.sed
+
+ # If printing from stdin, save into a tmp file
diff --git a/app-text/a2ps/files/a2ps-4.13c-fnmatch-replacement.patch b/app-text/a2ps/files/a2ps-4.13c-fnmatch-replacement.patch
new file mode 100644
index 0000000..c49ab78
--- /dev/null
+++ b/app-text/a2ps/files/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/app-text/a2ps/files/a2ps-4.13c-locale-gentoo.diff b/app-text/a2ps/files/a2ps-4.13c-locale-gentoo.diff
new file mode 100644
index 0000000..0b59956
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13c-locale-gentoo.diff
@@ -0,0 +1,25 @@
+diff -urN a2ps-4.13.ORIG/config.h.in a2ps-4.13/config.h.in
+--- a2ps-4.13.ORIG/config.h.in 2003-09-27 19:33:38.000000000 +0900
++++ a2ps-4.13/config.h.in 2003-09-27 21:25:46.000000000 +0900
+@@ -181,6 +181,9 @@
+ /* Define to 1 if you have the `rename' function. */
+ #undef HAVE_RENAME
+
++/* Define to 1 if you have the <locale.h> header file. */
++#undef HAVE_LOCALE_H
++
+ /* Define to 1 if you have the `setlocale' function. */
+ #undef HAVE_SETLOCALE
+
+diff -urN a2ps-4.13.ORIG/configure.in a2ps-4.13/configure.in
+--- a2ps-4.13.ORIG/configure.in 2003-09-27 19:33:38.000000000 +0900
++++ a2ps-4.13/configure.in 2003-09-27 21:26:05.000000000 +0900
+@@ -71,7 +71,7 @@
+ AC_HEADER_DIRENT
+ AC_CHECK_HEADERS(sys/time.h sys/stat.h sys/types.h sys/ioctl.h \
+ math.h string.h strings.h stdlib.h unistd.h stdarg.h pwd.h malloc.h \
+- memory.h errno.h fcntl.h stdbool.h fnmatch.h)
++ memory.h errno.h fcntl.h stdbool.h fnmatch.h locale.h)
+
+ ## --------------------- ##
+ ## Checks for typedefs. ##
diff --git a/app-text/a2ps/files/a2ps-4.13c-psmandup.diff b/app-text/a2ps/files/a2ps-4.13c-psmandup.diff
new file mode 100644
index 0000000..67f2fab
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13c-psmandup.diff
@@ -0,0 +1,19 @@
+--- contrib/psmandup.in.orig 2004-12-20 00:16:07.000000000 +0100
++++ contrib/psmandup.in 2004-12-20 00:16:39.000000000 +0100
+@@ -36,7 +36,7 @@
+ message=
+ psselect=${PSSELECT:-psselect}
+ psset=${PSSET:-psset}
+-tmpdir=/tmp/$program.$$
++tmpdir=`mktemp -d -t fixps.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+
+ # These two must be kept in synch. They are opposed.
+ verbose=echo
+@@ -185,7 +185,6 @@
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+ fi
+
+-mkdir $tmpdir
+
+ # If printing from stdin, save into a tmp file
+ if test $file = '-'; then
diff --git a/app-text/a2ps/files/a2ps-4.13c-psset.patch b/app-text/a2ps/files/a2ps-4.13c-psset.patch
new file mode 100644
index 0000000..f8fd449
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13c-psset.patch
@@ -0,0 +1,11 @@
+--- a2ps-4.13/contrib/psset.in.orig 2006-03-16 12:30:48.000000000 +0100
++++ a2ps-4.13/contrib/psset.in 2006-03-16 12:28:14.000000000 +0100
+@@ -241,7 +241,7 @@
+ # spaces with a `\' too...
+ pspagedevicelen=`echo "$pspagedevice" | wc -l`
+ pspagedevice=`echo "$pspagedevice" | \
+- sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^/\\\\\\/"`
++ sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\/"`
+
+ case $at in
+ 0) # Insert last in the Setup, so that we win over other requests.
diff --git a/app-text/a2ps/files/a2ps-4.13c-stdarg.patch b/app-text/a2ps/files/a2ps-4.13c-stdarg.patch
new file mode 100644
index 0000000..4ff1212
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.13c-stdarg.patch
@@ -0,0 +1,74 @@
+--- a2ps-4.13-orig/configure.in 2005-08-14 14:13:42.000000000 +0200
++++ a2ps-4.13/configure.in 2005-08-14 14:18:20.000000000 +0200
+@@ -157,6 +157,22 @@
+ [Define to rpl_fnmatch if the replacement function should be used.])
+ fi
+
++# Check for C99 va_copy
++AC_CACHE_CHECK([
++ AC_TRY_LINK([#include <stdarg.h>],
++ [
++ va_list va1, va2;
++
++ va_copy(va2, va1);
++ va_end(va2);
++ ],
++ [ac_cv_va_copy="yes"],[ac_cv_va_copy="no"]
++ )
++])
++if test "x$ac_cv_va_copy"="xyes"; then
++ AC_DEFINE(HAVE_VA_COPY,1,[Define to 1 if C99 va_copy function should be used])
++fi
++
+ # Needed checks for tinyterm.[ch]
+ ad_TINYTERM_CHECKS
+
+--- a2ps-4.13-orig/lib/printlen.c 2002-03-04 19:46:25.000000000 +0100
++++ a2ps-4.13/lib/printlen.c 2005-08-14 14:29:08.000000000 +0200
+@@ -27,15 +27,24 @@
+
+ unsigned long strtoul ();
+
++#if !defined(HAVE_VA_COPY)
+ static int
+ int_printflen (const char *format, va_list *args)
++#else
++static int
++int_printflen (const char *format, va_list args)
++#endif
+ {
+ const char *cp;
+ int total_width = 0;
+ int width = 0;
+ va_list ap;
+
++#ifndef HAVE_VA_COPY
+ memcpy (&ap, args, sizeof (va_list));
++#else
++ va_copy(ap, args);
++#endif
+
+ for (cp = format ; *cp ; cp++)
+ {
+@@ -93,13 +102,21 @@
+ }
+ }
+ }
++
++#ifdef HAVE_VA_COPY
++ va_end(ap);
++#endif
+ return total_width;
+ }
+
+ int
+ vprintflen (const char *format, va_list args)
+ {
++#if !defined(HAVE_VA_COPY)
+ return int_printflen (format, &args);
++#else
++ return int_printflen (format, args);
++#endif
+ }
+
+ int
diff --git a/app-text/a2ps/files/a2ps-4.14-check-mempcpy.patch b/app-text/a2ps/files/a2ps-4.14-check-mempcpy.patch
new file mode 100644
index 0000000..7b820ce
--- /dev/null
+++ b/app-text/a2ps/files/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/app-text/a2ps/files/a2ps-4.14-cleanup.patch b/app-text/a2ps/files/a2ps-4.14-cleanup.patch
new file mode 100644
index 0000000..25187f3
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.14-cleanup.patch
@@ -0,0 +1,106 @@
+fix missing prototype and printf warnings
+
+--- a/lib/argmatch.c
++++ b/lib/argmatch.c
+@@ -21,6 +21,7 @@
+ #include "argmatch.h"
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifdef STDC_HEADERS
+ # include <string.h>
+ #endif
+--- a/lib/encoding.c
++++ b/lib/encoding.c
+@@ -790,7 +790,7 @@ dump_encoding_setup (FILE * stream,
+ /* Create the dictionary and fill it */
+ fprintf (stream, "%% Dictionary for %s support\n",
+ encoding->name);
+- fprintf (stream, "/%sdict %d dict begin\n", encoding->key, nb);
++ fprintf (stream, "/%sdict %zu dict begin\n", encoding->key, nb);
+ for (i = 0 ; i < nb ; i++)
+ fprintf (stream, " /f%s %sEncoding /%s reencode_font\n",
+ font_names [i],
+--- a/lib/output.c
++++ b/lib/output.c
+@@ -84,7 +84,7 @@ new_derivation (enum derivation_type type)
+ static void
+ derivation_self_print (struct derivation * derivation, FILE * stream)
+ {
+- fprintf (stream, "At %x: ", (int) derivation);
++ fprintf (stream, "At %p: ", derivation);
+ switch (derivation->type)
+ {
+ case nothing:
+@@ -525,7 +525,7 @@ output_file (struct output * out, a2ps_job * job,
+ expand_user_string (job, FIRST_FILE (job),
+ (const uchar *) "Expand: requirement",
+ (const uchar *) token));
+- output (dest, expansion);
++ output (dest, "%s", expansion);
+ continue;
+ }
+
+--- a/lib/parseppd.y
++++ b/lib/parseppd.y
+@@ -154,7 +154,7 @@ font_clause :
+ void
+ yyerror (const char *msg)
+ {
+- error_at_line (1, 0, ppdfilename, ppdlineno, msg);
++ error_at_line (1, 0, ppdfilename, ppdlineno, "%s", msg);
+ }
+
+ /*
+--- a/lib/psgen.c
++++ b/lib/psgen.c
+@@ -232,7 +232,7 @@ output_marker (a2ps_job * job, const char * kind, uchar * marker)
+ default:
+ *buf = '\0';
+ ps_escape_char (job, cp[i], buf);
+- output (jdiv, (char *) buf);
++ output (jdiv, "%s", buf);
+ break;
+ }
+ }
+--- a/lib/quotearg.c
++++ b/lib/quotearg.c
+@@ -60,6 +60,7 @@
+
+ #if HAVE_MBRTOWC && HAVE_WCHAR_H
+ # include <wchar.h>
++# include <wctype.h>
+ #else
+ # define iswprint(wc) 1
+ # define mbrtowc(pwc, s, n, ps) 1
+--- a/lib/title.c
++++ b/lib/title.c
+@@ -28,6 +28,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <string.h>
+
+ #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
+ # if __STDC__
+--- a/src/long-options.c
++++ b/src/long-options.c
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <getopt.h>
+ #include "closeout.h"
+ #include "long-options.h"
+--- a/src/parsessh.y
++++ b/src/parsessh.y
+@@ -740,7 +740,7 @@ exception_def_opt:
+ void
+ yyerror (const char *msg)
+ {
+- error_at_line (1, 0, sshfilename, sshlineno, msg);
++ error_at_line (1, 0, sshfilename, sshlineno, "%s", msg);
+ }
+
+ /*
diff --git a/app-text/a2ps/files/a2ps-4.14-fix-stpcpy-proto.patch b/app-text/a2ps/files/a2ps-4.14-fix-stpcpy-proto.patch
new file mode 100644
index 0000000..7c3c690
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.14-fix-stpcpy-proto.patch
@@ -0,0 +1,17 @@
+=== modified file 'lib/xstrrpl.c'
+--- lib/xstrrpl.c 2008-04-14 18:04:50 +0000
++++ 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/app-text/a2ps/files/a2ps-4.14-ja-cleanup.patch b/app-text/a2ps/files/a2ps-4.14-ja-cleanup.patch
new file mode 100644
index 0000000..16271b3
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.14-ja-cleanup.patch
@@ -0,0 +1,122 @@
+diff --git lib/argmatch.c lib/argmatch.c
+index f983e9d..eadc7ea 100644
+--- lib/argmatch.c
++++ lib/argmatch.c
+@@ -21,6 +21,7 @@
+ #include "argmatch.h"
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifdef STDC_HEADERS
+ # include <string.h>
+ #endif
+diff --git lib/encoding.c lib/encoding.c
+index 9bd9f2a..f554a6d 100644
+--- lib/encoding.c
++++ lib/encoding.c
+@@ -989,7 +989,7 @@ dump_encoding_setup (FILE * stream,
+ /* Create the dictionary and fill it */
+ fprintf (stream, "%% Dictionary for %s support\n",
+ encoding->name);
+- fprintf (stream, "/%sdict %d dict begin\n", encoding->key,
++ fprintf (stream, "/%sdict %zu dict begin\n", encoding->key,
+ (encoding->composite_flag == true)? nb+nb+ns:nb+ns);
+ for (i = 0 ; i < nb ; i++)
+ fprintf (stream, " /f%s %sEncoding /%s reencode_font\n",
+diff --git lib/output.c lib/output.c
+index b5fc37d..5f67676 100644
+--- lib/output.c
++++ lib/output.c
+@@ -84,7 +84,7 @@ new_derivation (enum derivation_type type)
+ static void
+ derivation_self_print (struct derivation * derivation, FILE * stream)
+ {
+- fprintf (stream, "At %x: ", (int) derivation);
++ fprintf (stream, "At %p: ", derivation);
+ switch (derivation->type)
+ {
+ case nothing:
+@@ -525,7 +525,7 @@ output_file (struct output * out, a2ps_job * job,
+ expand_user_string (job, FIRST_FILE (job),
+ (const uchar *) "Expand: requirement",
+ (const uchar *) token));
+- output (dest, expansion);
++ output (dest, "%s", expansion);
+ continue;
+ }
+
+diff --git lib/parseppd.y lib/parseppd.y
+index a7558ba..c89d188 100644
+--- lib/parseppd.y
++++ lib/parseppd.y
+@@ -154,7 +154,7 @@ font_clause :
+ void
+ yyerror (const char *msg)
+ {
+- error_at_line (1, 0, ppdfilename, ppdlineno, msg);
++ error_at_line (1, 0, ppdfilename, ppdlineno, "%s", msg);
+ }
+
+ /*
+diff --git lib/psgen.c lib/psgen.c
+index 9eeef74..9d7a27d 100644
+--- lib/psgen.c
++++ lib/psgen.c
+@@ -232,7 +232,7 @@ output_marker (a2ps_job * job, const char * kind, uchar * marker)
+ default:
+ *buf = '\0';
+ ps_escape_char (job, cp[i], buf);
+- output (jdiv, (char *) buf);
++ output (jdiv, "%s", buf);
+ break;
+ }
+ }
+diff --git lib/quotearg.c lib/quotearg.c
+index 16d0b91..89db991 100644
+--- lib/quotearg.c
++++ lib/quotearg.c
+@@ -60,6 +60,7 @@
+
+ #if HAVE_MBRTOWC && HAVE_WCHAR_H
+ # include <wchar.h>
++# include <wctype.h>
+ #else
+ # define iswprint(wc) 1
+ # define mbrtowc(pwc, s, n, ps) 1
+diff --git lib/title.c lib/title.c
+index cf4a34b..7a3e87b 100644
+--- lib/title.c
++++ lib/title.c
+@@ -28,6 +28,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <string.h>
+
+ #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
+ # if __STDC__
+diff --git src/long-options.c src/long-options.c
+index fb40cd9..7bd77b0 100644
+--- src/long-options.c
++++ src/long-options.c
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <getopt.h>
+ #include "closeout.h"
+ #include "long-options.h"
+diff --git src/parsessh.y src/parsessh.y
+index 21e9559..569fdb6 100644
+--- src/parsessh.y
++++ src/parsessh.y
+@@ -740,7 +740,7 @@ exception_def_opt:
+ void
+ yyerror (const char *msg)
+ {
+- error_at_line (1, 0, sshfilename, sshlineno, msg);
++ error_at_line (1, 0, sshfilename, sshlineno, "%s", msg);
+ }
+
+ /*
diff --git a/app-text/a2ps/files/a2ps-4.14-psset.patch b/app-text/a2ps/files/a2ps-4.14-psset.patch
new file mode 100644
index 0000000..291c3aa
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.14-psset.patch
@@ -0,0 +1,21 @@
+diff -Naur a2ps-4.14.orig/contrib/psset.in a2ps-4.14/contrib/psset.in
+--- a2ps-4.14.orig/contrib/psset.in 2007-12-29 12:29:01.000000000 +0900
++++ a2ps-4.14/contrib/psset.in 2009-04-12 12:17:43.000000000 +0900
+@@ -219,7 +219,7 @@
+ done
+
+ pspagedevice="% Pagedevice definitions:
+-countdictstack
++ countdictstack
+ % Push our own mark, since there can be several PS marks pushed depending
+ % where the failure really occured.
+ /psset_mark
+@@ -227,7 +227,7 @@
+ } stopped
+ % My cleartomark
+ { /psset_mark eq { exit } if } loop
+-countdictstack exch sub dup 0 gt
++ countdictstack exch sub dup 0 gt
+ {
+ { end } repeat
+ }{
diff --git a/app-text/a2ps/files/a2ps-4.14-ptrdiff_t.patch b/app-text/a2ps/files/a2ps-4.14-ptrdiff_t.patch
new file mode 100644
index 0000000..00d955a
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-4.14-ptrdiff_t.patch
@@ -0,0 +1,14 @@
+diff -uNr a2ps-4.14/lib/obstack.h a2ps-4.14.test/lib/obstack.h
+--- a2ps-4.14/lib/obstack.h 2007-12-29 09:37:59.000000000 +0800
++++ a2ps-4.14.test/lib/obstack.h 2009-06-10 18:49:45.000000000 +0900
+@@ -138,9 +138,9 @@
+ #define __need_ptrdiff_t
+ #endif
+ #endif
++#endif
+
+ #include <stddef.h>
+-#endif
+
+ #if defined (__STDC__) && __STDC__
+ #define PTR_INT_TYPE ptrdiff_t
diff --git a/app-text/a2ps/files/a2ps-ds2.patch b/app-text/a2ps/files/a2ps-ds2.patch
new file mode 100644
index 0000000..9d9e011
--- /dev/null
+++ b/app-text/a2ps/files/a2ps-ds2.patch
@@ -0,0 +1,53 @@
+diff -dPNur a2ps-4.13/encoding/koi8.edf a2ps-4.13-new/encoding/koi8.edf
+--- a2ps-4.13/encoding/koi8.edf Fri Sep 4 15:05:13 1998
++++ a2ps-4.13-new/encoding/koi8.edf Wed Dec 27 05:05:37 2000
+@@ -32,22 +32,22 @@
+ EndDocumentation
+
+ # Regular fonts don't support Cyrillic glyphs
+-Default: CourierISOC
++Default: Courier
+
+-Substitute: Courier CourierISOC
+-Substitute: Courier-Bold CourierISOC-Bold
+-Substitute: Courier-BoldOblique CourierISOC-BoldOblique
+-Substitute: Courier-Oblique CourierISOC-Oblique
++Substitute: Courier ERKurier
++Substitute: Courier-Bold ERKurierBold
++Substitute: Courier-BoldOblique ERKurierBoldItalic
++Substitute: Courier-Oblique ERKurierItalic
+
+-Substitute: Times-Roman College
+-Substitute: Times-Bold College-Bold
+-Substitute: Times-Italic College-Italic
+-Substitute: Times-BoldItalic College-Italic
++Substitute: Times-Roman ERBukinist
++Substitute: Times-Bold ERBukinistBold
++Substitute: Times-Italic ERBukinistItalic
++Substitute: Times-BoldItalic ERBukinistBoldItalic
+
+-Substitute: Helvetica Textbook
+-Substitute: Helvetica-Bold Textbook-Bold
+-Substitute: Helvetica-Oblique Textbook-Italic
+-Substitute: Helvetica-BoldOblique Textbook-Italic
++Substitute: Helvetica ERUnivers
++Substitute: Helvetica-Bold ERUniversBold
++Substitute: Helvetica-Oblique ERUniversItalic
++Substitute: Helvetica-BoldOblique ERUniversBoldItalic
+
+ Vector:
+ .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
+diff -dPNur a2ps-4.13/etc/a2ps_cfg.in a2ps-4.13-new/etc/a2ps_cfg.in
+--- a2ps-4.13/etc/a2ps_cfg.in Thu Feb 24 22:37:44 2000
++++ a2ps-4.13-new/etc/a2ps_cfg.in Wed Jul 18 06:43:05 2001
+@@ -72,8 +72,8 @@
+
+ # It may be useful to extend it so that a2ps can see some
+ # TeX or X11 resources: it likes AFM files and PF[AB] files.
+-#AppendLibraryPath: foo
+-
++AppendLibraryPath: /usr/share/fonts/DarkLin/Type1/ER-KOI8
++#AppendLibraryPath: /usr/share/fonts/default/Type1
+
+ #################################################################
+ # 3) Default settings #
diff --git a/app-text/a2ps/files/cyr2ps b/app-text/a2ps/files/cyr2ps
new file mode 100755
index 0000000..a602228
--- /dev/null
+++ b/app-text/a2ps/files/cyr2ps
@@ -0,0 +1,49 @@
+#! /bin/bash
+
+enc=UTF-8
+case $1 in
+koi|KOI|Koi|koi8|Koi8|KOI8|koi-8|Koi-8|KOI-8|koi-8r|Koi-8r|KOI-8R|koi8r|Koi8r|KOI8R|k|K|Koi8-r|koi8-r|KOI8-R)
+ enc=""
+ shift
+ ;;
+alt|Alt|ALT|dos|Dos|DOS|cp866|Cp866|CP866|A|a)
+ enc=CP866
+ shift
+ ;;
+win|Win|WIN|cp1251|Cp1251|CP1251|W|w)
+ enc=CP1251
+ shift
+ ;;
+UTF-8|utf-8|Utf-8|UTF8|utf8|Utf-8|Unicode|UNICODE|unicode|U|u)
+ enc=UTF-8
+ shift
+ ;;
+esac
+
+
+in=$BASH_ARGV
+if [ "$in" == "-" -o -f "$in" ]; then
+ arglen=$(($#-1))
+ args=${@:1:$arglen}
+else
+ args=$@
+ in="-"
+fi
+
+out=""
+
+if [[ " ${args[*]} " != *" -o "* ]]; then
+ if [ $in == "-" ]; then
+ out="-o -"
+ else
+ out="-o `basename $in`.ps"
+ fi
+fi
+
+
+echo "Encoding: $enc, In: $in, Out: $out, extra args: ${args[*]}"
+if [ -n "$enc" ]; then
+ cat $in | iconv -f UTF-8 -t KOI8-R -c | a2ps $out $args -
+else
+ a2ps $out $args $in
+fi