summaryrefslogtreecommitdiff
blob: 9b5969209c5679bd7d808189d3fd2edc0a8e3b3f (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-gfx/imageworsener/imageworsener-0.9.8.ebuild,v 1.2 2012/03/15 20:31:51 sping Exp $

EAPI="4"

inherit eutils autotools

MY_P="${PN}-src-${PV}"
MY_PN="imagew"

DESCRIPTION="Utility for image scaling and processing"
HOMEPAGE="http://entropymine.com/imageworsener/"
SRC_URI="http://entropymine.com/${PN}/${MY_P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="jpeg png test webp zlib"

DEPEND="png? ( media-libs/libpng:0 )
	jpeg? ( virtual/jpeg )
	webp? ( >=media-libs/libwebp-0.1.3 )
	zlib? ( sys-libs/zlib )"
RDEPEND="${DEPEND}"

REQUIRED_USE="test? ( jpeg png webp zlib )"

src_prepare() {
	epatch "${FILESDIR}"/${P}-libm.patch
	eautoreconf
}

src_configure() {
	local switch=
	use test && switch=test

	econf \
			$(use_with ${switch} jpeg) \
			$(use_with ${switch} png) \
			$(use_with ${switch} webp) \
			$(use_with ${switch} zlib) \
		|| die
}

src_install() {
	default
	dodoc readme.txt technical.txt changelog.txt || die

	# Remove dummy files pointing to others
	rm "${D}"/usr/share/doc/${PF}/{ChangeLog,README} || die
}

src_test() {
	cd "${S}/tests" || die
	./runtest "${S}/${MY_PN}"
}