summaryrefslogtreecommitdiff
blob: 1eba9d4ce1908ba04243500831223176dbca14e9 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/netpbm/netpbm-9.12-r4.ebuild,v 1.16 2004/01/14 17:45:29 mholzer Exp $

inherit flag-o-matic

DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
HOMEPAGE="http://netpbm.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
RESTRICT="nomirror"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ppc sparc amd64 hppa"

DEPEND=">=media-libs/jpeg-6b
	>=media-libs/tiff-3.5.5
	>=media-libs/libpng-1.2.1"

src_unpack() {
	unpack ${A}
	cd ${S}
	# 13/May/2003: Fix for bug #14392  by Jason Wever <weeve@gentoo.org>
	# start fix
	if [ ${ARCH} = "sparc" ]
	then
		filter-flags "-O3"
		filter-flags "-O2"
		filter-flags "-O"
	fi
	# end fix
	sed -e "s:-O3:${CFLAGS}:" ${FILESDIR}/${PV}/Makefile.config >Makefile.config
}

src_compile() {
	MAKEOPTS="${MAKEOPTS} -j1"
	local myopts=""
	[ -n ${CC} ] && myopts="${myopts} CC=\"${CC}\""
	[ -n ${CXX} ] && myopts="${myopts} CXX=\"${CXX}\""
	einfo "myopts=${myopts}"
	emake ${myopts}|| die "Make failed"
}

src_install() {
	make INSTALL_PREFIX="${D}/usr/" install || die "Install failed"

	# fix broken symlinks
	dosym /usr/bin/gemtopnm /usr/bin/gemtopbm
	dosym /usr/bin/pnmtoplainpnm /usr/bin/pnmnoraw

	insinto /usr/include
	doins pnm/{pam,pnm}.h ppm/{ppm,pgm,pbm}.h
	doins pbmplus.h shhopt/shhopt.h
	dodoc COPYRIGHT.PATENT GPL_LICENSE.txt HISTORY \
		Netpbm.programming README* netpbm.lsm
}