summaryrefslogtreecommitdiff
blob: e375099132c8f396b00576d59049aad260e9fbf9 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/htmltidy/htmltidy-2.7.18-r2.ebuild,v 1.1 2003/12/20 05:23:52 obz Exp $

# convert from normalized gentoo version number to htmltidy's wacky date thing
parts=(${PV//./ })
vers=$(printf "%02d%02d%02d" ${parts[0]} ${parts[1]} ${parts[2]})
MY_P=tidy_src_${vers}
S=${WORKDIR}/tidy

DESCRIPTION="Tidy the layout and correct errors in HTML and XML documents"
SRC_URI="http://tidy.sourceforge.net/src/old/${MY_P}.tgz
		 http://tidy.sourceforge.net/docs/tidy_docs.tgz"
HOMEPAGE="http://tidy.sourceforge.net/"
LICENSE="GPL-2"

IUSE="xml doc"
SLOT="0"
KEYWORDS="~x86 ~ppc ~sparc ~alpha"

DEPEND=""

src_unpack() {

	unpack ${A}
	cd ${S}
	use xml && epatch ${FILESDIR}/htmltidy-dbpatch.diff

	# Prevent tidy from chown/grp'ing itself to 'tidy:tidy'
	sed -i -e "s:chgrp\|chown:#&:" Makefile

}

src_compile() {

	emake OTHERCFLAGS="${CFLAGS}" || die "emake failed"

}

src_install() {

	# Need to move the man page around, thanks to the flaky Makefile
	cp ${S}/htmldoc/man_page.txt  ${S}/man_page.txt

	make \
		INSTALLDIR="${D}/usr/" MANPAGESDIR="${D}/usr/share/man/" \
		install || die

	# This installs the standard project documentation
	cd ${S}/htmldoc
	dohtml *.html *.gif *.css
	# and the api documentation if we have USE="doc"
	use doc && dohtml -r api

}