summaryrefslogtreecommitdiff
blob: 83ee4f145539def2cbbdbc56ba6f2fe8bc772dcc (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-gfx/dcraw/dcraw-8.86.ebuild,v 1.1 2008/05/26 12:25:32 wschlich Exp $

inherit eutils toolchain-funcs

DESCRIPTION="Converts the native (RAW) format of various digital cameras into netpbm portable pixmap (.ppm) image"
HOMEPAGE="http://www.cybercom.net/~dcoffin/dcraw/"
SRC_URI="http://dev.gentoo.org/~wschlich/src/media-gfx/dcraw/${P}.tar.bz2"
LICENSE="freedist GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="gimp jpeg lcms"

DEPEND="virtual/libc
	jpeg? ( >=media-libs/jpeg-6b )
	lcms? ( media-libs/lcms )
	gimp? ( media-gfx/gimp )"

RDEPEND="${DEPEND}
	media-libs/netpbm"

src_compile() {
	local mymakeopts
	use lcms || mymakeopts="${mymakeopts} NO_LCMS=yes"
	use jpeg || mymakeopts="${mymakeopts} NO_JPEG=yes"
	emake CC=$(tc-getCC) ${mymakeopts} || die "make failed"

	# rawphoto gimp plugin
	if use gimp; then

		# find gimptool (ugly!)
		local gimptool=/usr/bin/gimptool
		if [ ! -x ${gimptool} ]; then
			gimptool=${gimptool}-2.0
			if [ ! -x ${gimptool} ]; then
				die "Couldn't find gimptool. Please reinstall gimp."
			fi
		fi

		# build plugin
		${gimptool} --build rawphoto.c || die "gimptool failed"

	fi
}

src_install() {
	emake DESTDIR="${D}" install || die "make install failed"
	dodoc doc/conversion-examples.txt doc/dcwrap

	# rawphoto gimp plugin
	if use gimp; then

		# find gimptool (ugly!)
		local gimptool=/usr/bin/gimptool
		if [ ! -x ${gimptool} ]; then
			gimptool=${gimptool}-2.0
			if [ ! -x ${gimptool} ]; then
				die "Couldn't find gimptool. Please reinstall gimp."
			fi
		fi

		# install plugin
		env DESTDIR="${D}" ${gimptool} --install-admin-bin rawphoto || die "gimptool failed"

	fi
}

pkg_postinst() {
	elog ""
	elog "See conversion-examples.txt.gz on how to convert"
	elog "the PPM files produced by dcraw to other image formats."
	elog ""
	ewarn "The functionality of the external program 'fujiturn' was"
	ewarn "incoporated into dcraw and is automatically used now."
	elog ""
	elog "There's an example wrapper script included called 'dcwrap'."
	elog ""
	elog "This package also includes 'dcparse', which extracts"
	elog "thumbnail images (preferably JPEGs) from any raw digital"
	elog "camera formats that have them, and shows table contents."
	elog ""
}