summaryrefslogtreecommitdiff
blob: 14eaac6a31e4812095596573797ce381cf17df28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-print/magicfilter/magicfilter-1.2-r4.ebuild,v 1.6 2003/12/09 18:14:06 lanius Exp $

inherit eutils

IUSE=""

S=${WORKDIR}/${P}
PATCHDIR=${WORKDIR}/${P}-gentoo
DESCRIPTION="Customizable, extensible automatic printer filter"
HOMEPAGE="http://www.gnu.org/directory/magicfilter.html"
SRC_URI="ftp://metalab.unc.edu/pub/linux/system/printing/${P}.tar.gz
	mirror://gentoo/${P}-gentoo.tar.bz2
	http://cvs.gentoo.org/~seemant/${P}-gentoo.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"

DEPEND="virtual/ghostscript
	>=sys-apps/groff-1.16.1-r1
	>=app-arch/bzip2-1.0.1-r4
	>=app-arch/gzip-1.2.4a-r6"

src_unpack() {

	unpack ${A}
	# This is the patch directly from the Debian package.  It's included
	# here (instead of fetching from Debian) because their package
	# revisions will change faster than this ebuild will keep up...
	cd ${S}
	epatch ${PATCHDIR}/magicfilter_1.2-39.diff
	epatch ${PATCHDIR}/magicfilter-1.2-stc777.patch
	cp ${PATCHDIR}/*-filter.x filters || die
}

src_compile() {
	./configure --host="${CHOST}" || die
	emake || die
	# Fixup the filters for /usr/sbin/magicfilter;
	cd filters
	for f in *-filter; do
		mv $f $f.old
		( read l; echo '#!/usr/sbin/magicfilter'; cat ) <$f.old >$f
	done
	cd ..

	cp magicfilterconfig magicfilterconfig.org
	sed -e "s/\"\/etc\/magicfilter\"/\"\/usr\/share\/magicfilter\"/" magicfilterconfig.org > magicfilterconfig
}

src_install() {
	into /usr
	dosbin magicfilter magicfilterconfig

	insinto /usr/share/magicfilter
	doins filters/*-filter ${PATCHDIR}/stc777-text-helper

	newman magicfilter.man magicfilter.8
	doman magicfilterconfig.8

	dodoc README QuickInst TODO debian/copyright
	docinto filters
	dodoc filters/README*
}