summaryrefslogtreecommitdiff
path: root/graphics/djvulibre/Makefile
blob: 176dba3a5d1e48bfb6f77b6b305c93c572c7eafa (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
# Created by: Mikhail Teterin <mi@aldan.algebra.com>
# $FreeBSD$

PORTNAME=	djvulibre
PORTVERSION=	3.5.25.3
PORTREVISION=	2
CATEGORIES=	graphics www
MASTER_SITES=	SF/djvu/DjVuLibre/${PORTVERSION:R}

MAINTAINER=	bf@FreeBSD.org
COMMENT=	DjVu base libraries and utilities

LICENSE=	GPLv2

LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
		libtiff.so:${PORTSDIR}/graphics/tiff

USES=		pathfix iconv
GNU_CONFIGURE=	yes
LDFLAGS+=	-L${LOCALBASE}/lib ${ICONV_LIB}
CONFIGURE_ENV=	JPEG_CFLAGS="-I${LOCALBASE}/include" \
		JPEG_LIBS="-L${LOCALBASE}/lib -ljpeg" \
		TIFF_CFLAGS="-I${LOCALBASE}/include" \
		TIFF_LIBS="-L${LOCALBASE}/lib -ltiff" \
		PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
		PTHREAD_LIBS="${PTHREAD_LIBS}"
CONFIGURE_ARGS=	--enable-threads=pthread --enable-shared
USE_LDCONFIG=	yes
CONFLICTS=	djvulibre-nox11-3*
WRKSRC=		${WRKDIR}/${DISTNAME:R}

PORTDOCS=	djvu2spec.djvu djvu3spec.djvu djvuchanges.txt lizard2002.djvu lizard2007.djvu

OPTIONS_DEFINE=		DOCS ANY2DJVU
OPTIONS_SUB=		yes

ANY2DJVU_DESC=		Install any2djvu script (requires curl)
ANY2DJVU_RUN_DEPENDS=	curl:${PORTSDIR}/ftp/curl

.include <bsd.port.options.mk>

post-patch:
	@${REINPLACE_CMD} -e \
		'/-[Og]\*)/d ; \
		s|$$OPTS -O[[:digit:]]*|$$OPTS|g ; \
		s|$$OPTS $$opt|$$OPTS|g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} -e \
		's|$${FLAGS}|| ; \
		s|@CPPFLAGS@|$${FLAGS} &|' \
		${WRKSRC}/tools/jb2cmp/Makefile.in
	@${REINPLACE_CMD} -e \
		's|_PROGRAM} -m 0755|_SCRIPT}|' \
		${WRKSRC}/tools/Makefile.in
.if empty(PORT_OPTIONS:MANY2DJVU)
	@${REINPLACE_CMD} -e 's,any2djvu,,' ${WRKSRC}/tools/Makefile.in
.endif

post-install:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>