aboutsummaryrefslogtreecommitdiff
path: root/japanese/another-htmllint/Makefile
blob: c9b525c43dcab5be60ca817fd8c23066879aff72 (plain) (blame)
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
# $FreeBSD$

PORTNAME=	another-htmllint
PORTVERSION=	20060601
CATEGORIES=	japanese www
MASTER_SITES=	http://dist.bsdlab.org/

MAINTAINER=	kuriyama@FreeBSD.org
COMMENT=	Another HTML-lint (all messages are written in Japanese)

RUN_DEPENDS=	p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
		ja-p5-Jcode>=0:${PORTSDIR}/japanese/p5-Jcode

USES=		dos2unix perl5 zip
WRKSRC=		${WRKDIR}
DOS2UNIX_FILES=	readme.txt

DIR=		${STAGEDIR}${PREFIX}/share/htmllint
PM=		htmllint.pm RFC2396.pm htmllint.env
RULE=		*.rul
HTML=		*.cgi *.html *.gif *.css
SEDSUB=		${SED} -e 's@%PREFIX%@${PREFIX}@'

# Please set this!
HTMLLINT_ADMIN?=	kuriyama@FreeBSD.org

do-build:
	@${SEDSUB} ${FILESDIR}/htmllint > ${WRKSRC}/htmllint
	@${SEDSUB} ${WRKSRC}/htmllintenv > ${WRKSRC}/htmllint.env
	@${SEDSUB} ${WRKSRC}/htmllint.cgi > ${WRKSRC}/htmllint.cgi.new
	@${MV} ${WRKSRC}/htmllint.cgi.new ${WRKSRC}/htmllint.cgi
	@${SED} -i.bak -e 's|^</address>|</address><br>Maintained by <address>${HTMLLINT_ADMIN}</address>|' ${WRKSRC}/*.html
.if exists(${LOCALBASE}/bin/w3m)
	@${ECHO_MSG} "Find w3m."
	@${SED} -i.bak -e 's|^#$$W3M|$$W3M|' ${WRKSRC}/htmllint.env
.endif

do-install:
	${MKDIR} ${DIR}/rule ${DIR}/html
	cd ${WRKSRC} && ${INSTALL_SCRIPT} htmllint ${STAGEDIR}${PREFIX}/bin
	cd ${WRKSRC} && ${INSTALL_SCRIPT} ${HTML} ${DIR}/html
	cd ${WRKSRC} && ${INSTALL_DATA} ${PM} ${DIR}
	cd ${WRKSRC} && ${INSTALL_DATA} ${RULE} ${DIR}/rule

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>