Fixup fromcvs/togit conversion
[pkgsrcv2.git] / www / tidy / Makefile
1 # $NetBSD: Makefile,v 1.34 2009/08/03 22:35:33 wiz Exp $
2 #
3
4 DISTNAME=       tidy-20090326
5 PKGREVISION=    1
6 CATEGORIES=     www
7 MASTER_SITES=   # manually created tarballs on ftp.NetBSD.org only
8
9 MAINTAINER=     pkgsrc-users@NetBSD.org
10 HOMEPAGE=       http://tidy.sourceforge.net/
11 COMMENT=        Fixes and tidies up HTML files
12 LICENSE=        mit
13
14 PKG_DESTDIR_SUPPORT=    user-destdir
15
16 BUILD_DEPENDS+= libxslt>=1.1.0:../../textproc/libxslt
17
18 PKG_OPTIONS_VAR=        PKG_OPTIONS.tidy
19 PKG_SUPPORTED_OPTIONS=  doc
20 PKG_SUGGESTED_OPTIONS=  doc
21
22 .include "../../mk/bsd.options.mk"
23
24 WRKSRC=         ${WRKDIR}/tidy
25 GNU_CONFIGURE=  yes
26 USE_LIBTOOL=    yes
27 USE_TOOLS+=     aclocal autoconf automake gmake
28 CPPFLAGS+=      -DSUPPORT_ACCESSIBILITY_CHECKS=1 -DSUPPORT_UTF16_ENCODINGS=1
29 CPPFLAGS+=      -DSUPPORT_ASIAN_ENCODINGS=1 -DSUPPORT_GETPWNAM=1
30
31 INSTALLATION_DIRS=      ${PKGMANDIR}/man1
32 PLIST_SRC+=             ${PKGDIR}/PLIST
33
34 .if !empty(PKG_OPTIONS:Mdoc)
35 BUILD_DEPENDS+= doxygen>=1.5.9:../../devel/doxygen
36
37 HTML_DOCFILES=  Overview.html doxygen.cfg grid.gif tidy.css faq.html \
38                 license.html pending.html release-notes.html tidy.gif
39 HTML_DOCDIR=    ${PREFIX}/share/doc/tidy
40 INSTALLATION_DIRS+=     ${HTML_DOCDIR} ${HTML_DOCDIR}/api
41 PLIST_SRC+=     ${PKGDIR}/PLIST.doc
42 .endif
43
44 pre-configure:
45         cd ${WRKSRC}/build/gnuauto && cp -R -f * ${WRKSRC}
46         cd ${WRKSRC} && \
47                 touch NEWS README AUTHORS ChangeLog; \
48                 libtoolize --force --copy; \
49                 aclocal; \
50                 autoconf; \
51                 automake -acf
52
53 post-build:
54         cd ${WRKSRC}/htmldoc && \
55         ${WRKSRC}/console/tidy -xml-help > tidy.xml && \
56         ${WRKSRC}/console/tidy -xml-config > tidy-config.xml && \
57         xsltproc tidy1.xsl tidy.xml > tidy.1
58 .if !empty(PKG_OPTIONS:Mdoc)
59         cd ${WRKSRC} && \
60         doxygen htmldoc/doxygen.cfg
61 .endif
62
63 post-install:
64         ${INSTALL_MAN} ${WRKSRC}/htmldoc/tidy.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
65 .if !empty(PKG_OPTIONS:Mdoc)
66         for doc in ${HTML_DOCFILES}; do                                 \
67             ${INSTALL_DATA} ${WRKSRC}/htmldoc/$$doc ${DESTDIR}${HTML_DOCDIR} ;  \
68         done
69         ${INSTALL_DATA} ${WRKSRC}/htmldoc/api/* ${DESTDIR}${HTML_DOCDIR}/api
70 .endif
71
72 .include "../../mk/bsd.pkg.mk"