summaryrefslogtreecommitdiff
path: root/graphics/netpbm/Makefile
blob: 6d3aeb3ad75be0f0a2ae2434420d021d4585ce18 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# $NetBSD: Makefile,v 1.209 2016/07/09 06:38:22 wiz Exp $

DISTNAME=	netpbm-10.68.02
CATEGORIES=	graphics
MASTER_SITES=	#
PKGREVISION=	4
# manually created from svn checkout of
# svn checkout http://svn.code.sf.net/p/netpbm/code/advanced netpbm
# tar --exclude netpbm/.svn/\* -cvzf /archive/distfiles/netpbm-$VERSION.tar.gz netpbm
# where VERSION comes from reading netpbm/doc/HISTORY
# for the documentation:
# svn checkout http://svn.code.sf.net/p/netpbm/code/userguide netpbm-userguide
# cd netpbm-userguide && for i in *.html; do python2.7 ../netpbm/buildtools/makeman $i; done && cd ..
# tar -cvzf /archive/distfiles/netpbm-docs-r${SVN_REVISION}.tar.gz netpbm-userguide/*.[0-9]
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} netpbm-docs-r2313${EXTRACT_SUFX}

MAINTAINER=	adam@NetBSD.org
HOMEPAGE=	http://netpbm.sourceforge.net/
COMMENT=	Toolkit for conversion of images between different formats
LICENSE=	gnu-gpl-v2

USE_TOOLS+=	gmake flex pax perl
USE_FEATURES=	snprintf

INSTALL_TARGET=	install-dev install-run
MAKE_ENV+=	INSTALL=${INSTALL:Q} STRIPFLAG=${_STRIPFLAG_INSTALL:Q} \
		pkgdir=${STAGEDIR:Q} MACHINE=${MACHINE:Q}
MAKE_FLAGS+=	PKGMANDIR=${PKGMANDIR:Q}
MAKE_FLAGS+=	CFLAGS_FOR_BUILD=${CFLAGS:Q}
MAKE_FLAGS+=	LDFLAGS_FOR_BUILD=${LDFLAGS:Q}
MAKE_FILE=	GNUmakefile
REPLACE_PERL+=	converter/pbm/pbmtox10bm
REPLACE_PERL+=	editor/pnmflip
REPLACE_PERL+=	editor/pnmquant
REPLACE_PERL+=	editor/ppmfade
REPLACE_PERL+=	editor/ppmquant
REPLACE_PERL+=	editor/ppmshadow
REPLACE_PERL+=	generator/ppmrainbow
REPLACE_PERL+=	manweb
STAGEDIR=	${WRKDIR}/staging
WRKSRC=		${WRKDIR}/netpbm

WRAPPER_REORDER_CMDS+=	reorder:l:rle:netpbm

SUBST_CLASSES+=		rgb_txt
SUBST_STAGE.rgb_txt=	post-patch
SUBST_MESSAGE.rgb_txt=	Configure RGB_TXT
SUBST_FILES.rgb_txt=	config.mk
SUBST_SED.rgb_txt+=	-e 's,/usr/share/netpbm/rgb.txt,${PREFIX}/share/netpbm/rgb.txt,'

.include "../../mk/bsd.prefs.mk"

# only used if NEED_RUNTIME_PATH is set, so set it unconditionally
MAKE_FLAGS+=	NETPBMLIB_RUNTIME_PATH=${PREFIX}

MAKE_FLAGS.NetBSD+=	NEED_RUNTIME_PATH=Y
MAKE_FLAGS.Darwin+=	NETPBMLIBTYPE=dylib
MAKE_FLAGS.Darwin+=	NETPBMLIBSUFFIX=dylib
MAKE_FLAGS.SunOS+=	LDSHLIB=-shared
MAKE_FLAGS.SunOS+=	NEED_RUNTIME_PATH=Y
MAKE_FLAGS.SunOS+=	NETWORKLD="-lsocket -lnsl"

.if ${OS_VARIANT} == "SCOOSR5"
MAKE_FLAGS+=	NETWORKLD="-lsocket -lresolv"
.endif

INSTALLATION_DIRS=	${PKGMANDIR}/man1 ${PKGMANDIR}/man3 ${PKGMANDIR}/man5 share/netpbm

post-extract:
	cd ${WRKSRC} && ${CP} config.mk.in config.mk
	${ECHO} "CFLAGS_SHLIB = -fPIC" >> ${WRKSRC}/config.mk
	${ECHO} "JPEGLIB = ${BUILDLINK_PREFIX.jpeg}/lib/libjpeg.so" >> ${WRKSRC}/config.mk
	${ECHO} "JPEGHDR_DIR = ${BUILDLINK_PREFIX.jpeg}/include" >> ${WRKSRC}/config.mk
	${ECHO} "TIFFLIB = ${BUILDLINK_PREFIX.tiff}/lib/libtiff.so" >> ${WRKSRC}/config.mk
	${ECHO} "TIFFHDR_DIR = ${BUILDLINK_PREFIX.tiff}/include" >> ${WRKSRC}/config.mk
	${ECHO} "ZLIB = ${BUILDLINK_PREFIX.zlib}/lib/libz.so" >> ${WRKSRC}/config.mk
	${ECHO} "ZHDR_DIR = ${BUILDLINK_PREFIX.zlib}/include" >> ${WRKSRC}/config.mk
.if ${OPSYS} == "Darwin"
	${ECHO} 'LDSHLIB=-dynamiclib -install_name $$(PREFIX)/lib/libnetpbm.$$(MAJ).dylib -compatibility_version $$(MAJ) -current_version $$(MAJ).$$(MIN)' >> ${WRKSRC}/config.mk
.endif

pre-install:
	${RM} -fr ${STAGEDIR}
	${MKDIR} -p ${STAGEDIR}/man/web

post-install:
	cd ${STAGEDIR} && 					\
	${RM} -rf ${PKGMANDIR}/web && 				\
	${RM} -rf man/web && 					\
	${MKDIR} share &&					\
	${MV} misc share/netpbm && 				\
	${CHOWN} -R ${BINOWN}:${BINGRP} . &&			\
	pax -rwpppm . ${DESTDIR}${PREFIX}
	${RM} -fr ${STAGEDIR}
	${INSTALL_DATA} ${WRKDIR}/netpbm-userguide/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
	${INSTALL_DATA} ${WRKDIR}/netpbm-userguide/*.3 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man3
	${INSTALL_DATA} ${WRKDIR}/netpbm-userguide/*.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5

.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/jasper/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"