aboutsummaryrefslogtreecommitdiff
path: root/textproc/highlight/Makefile
blob: 2dbec411771405726c2a1f3d24e3969a5e46bbc7 (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
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
# New ports collection makefile for:	highlight
# Date created:				05 August 2003
# Whom:					Adam Weinberger <adamw@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	highlight
PORTVERSION=	2.4.8
PORTEPOCH=	1
CATEGORIES=	textproc
MASTER_SITES=	http://www.andre-simon.de/zip/

MAINTAINER=	alexbl@FreeBSD.org
COMMENT=	Customizable syntax highlighter

WRKSRC=		${WRKDIR}/${DISTNAME}/${PORTNAME}

USE_GCC=	3.4
USE_GETOPT_LONG=	yes
USE_GMAKE=	yes
MAKEFILE=	makefile
MAKE_ARGS=	CXX="${CXX}" \
		CFLAGS="${CXXFLAGS} ${CPPFLAGS} -DHAVE_DECL_GETOPT" \
		LDFLAGS="${LDFLAGS}"
ALL_TARGET=	${PORTNAME}

PLIST_FILES=	bin/highlight

MAN1=		${PORTNAME}.1
MANCOMPRESSED=	yes

.if !defined(NOPORTDOCS)
PORTDOCS=	*
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 500000
BROKEN=		Does not compile
.endif

post-patch:
	@${REINPLACE_CMD} -e \
		's|/etc/highlight|${DATADIR}|g' ${WRKSRC}/datadir.cpp
	@${REINPLACE_CMD} -e \
		's|/usr/share/highlight|${DATADIR}|' ${WRKSRC}/datadir.cpp

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/../man/${MAN1}.gz ${MANPREFIX}/man/man1
	@${MKDIR} ${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/../filetypes.conf ${DATADIR}
	@${MKDIR} ${DATADIR}/helpmsg
	${INSTALL_DATA} ${WRKSRC}/../helpmsg/* ${DATADIR}/helpmsg
	@${MKDIR} ${DATADIR}/langDefs
	${INSTALL_DATA} ${WRKSRC}/../langDefs/*.lang ${DATADIR}/langDefs
	@${MKDIR} ${DATADIR}/themes
	${INSTALL_DATA} ${WRKSRC}/../themes/* ${DATADIR}/themes
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.for i in AUTHORS ChangeLog INSTALL README README_DE README_ES README_INDENT \
	README_REGEX TODO
	${INSTALL_DATA} ${WRKSRC}/../${i} ${DOCSDIR}
.endfor
	@${MKDIR} ${EXAMPLESDIR}
	${TAR} -C ${WRKSRC}/../examples -cf - . | \
		${TAR} -C  ${EXAMPLESDIR} --unlink -xf -
	@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR}
.endif

post-install:
.for dir in ${PREFIX}/share/${PORTNAME} ${PREFIX}/share/examples/${PORTNAME}
	@${FIND} ${dir} ! -type d | \
		${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}
	@${FIND} ${dir} -type d | ${SORT} -r | \
		${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST}
.endfor

.include <bsd.port.post.mk>