summaryrefslogtreecommitdiff
path: root/www/tidy/Makefile
blob: f5b2fe1fb71b48ef497c099cf0a301d5411ccb48 (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
# $NetBSD: Makefile,v 1.42 2014/04/25 21:04:24 wiz Exp $

DISTNAME=	tidy-20091027
PKGREVISION=	5
CATEGORIES=	www
MASTER_SITES=	# manually created tarballs on ftp.NetBSD.org only

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://tidy.sourceforge.net/
COMMENT=	Fixes and tidies up HTML files
LICENSE=	mit

BUILD_DEPENDS+=	libxslt>=1.1.0:../../textproc/libxslt

PKG_OPTIONS_VAR=	PKG_OPTIONS.tidy
PKG_SUPPORTED_OPTIONS=	doc
PKG_SUGGESTED_OPTIONS=	doc

.include "../../mk/bsd.options.mk"

WRKSRC=		${WRKDIR}/tidy
GNU_CONFIGURE=	yes
USE_LIBTOOL=	yes
USE_TOOLS+=	aclocal autoconf automake gmake
CPPFLAGS+=	-DSUPPORT_ACCESSIBILITY_CHECKS=1 -DSUPPORT_UTF16_ENCODINGS=1
CPPFLAGS+=	-DSUPPORT_ASIAN_ENCODINGS=1 -DSUPPORT_GETPWNAM=1

INSTALLATION_DIRS=	${PKGMANDIR}/man1
PLIST_SRC+=		${PKGDIR}/PLIST

.if !empty(PKG_OPTIONS:Mdoc)
BUILD_DEPENDS+= doxygen>=1.8.7:../../devel/doxygen

HTML_DOCFILES=	Overview.html doxygen.cfg grid.gif tidy.css faq.html \
		license.html pending.html release-notes.html tidy.gif
HTML_DOCDIR=	${PREFIX}/share/doc/tidy
INSTALLATION_DIRS+=	${HTML_DOCDIR} ${HTML_DOCDIR}/api
PLIST_SRC+=	${PKGDIR}/PLIST.doc
.endif

pre-configure:
	cd ${WRKSRC}/build/gnuauto && cp -R -f * ${WRKSRC}
	cd ${WRKSRC} && \
		touch NEWS README AUTHORS ChangeLog; \
		libtoolize --force --copy; \
		aclocal; \
		autoconf; \
		automake -acf

post-build:
	cd ${WRKSRC}/htmldoc && \
	${WRKSRC}/console/tidy -xml-help > tidy.xml && \
	${WRKSRC}/console/tidy -xml-config > tidy-config.xml && \
	xsltproc tidy1.xsl tidy.xml > tidy.1
.if !empty(PKG_OPTIONS:Mdoc)
	cd ${WRKSRC} && \
	doxygen htmldoc/doxygen.cfg
.endif

post-install:
	${INSTALL_MAN} ${WRKSRC}/htmldoc/tidy.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.if !empty(PKG_OPTIONS:Mdoc)
	for doc in ${HTML_DOCFILES}; do					\
	    ${INSTALL_DATA} ${WRKSRC}/htmldoc/$$doc ${DESTDIR}${HTML_DOCDIR} ;	\
	done
	${INSTALL_DATA} ${WRKSRC}/htmldoc/api/* ${DESTDIR}${HTML_DOCDIR}/api
.endif

.include "../../mk/bsd.pkg.mk"