summaryrefslogtreecommitdiff
path: root/graphics/netpbm/Makefile
blob: 2d017eab5aa98224bf6dbc1656608f76b29df091 (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
# $NetBSD: Makefile,v 1.166 2010/06/13 22:44:39 wiz Exp $

DISTNAME=	netpbm-10.35.73
PKGREVISION=	1
CATEGORIES=	graphics
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=netpbm/}
EXTRACT_SUFX=	.tgz

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

MAKE_JOBS_SAFE=	no

PKG_INSTALLATION_TYPES=	overwrite pkgviews
PKG_DESTDIR_SUPPORT=	user-destdir

USE_TOOLS+=	bash:run gmake lex 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_FILE=	GNUmakefile
REPLACE_PERL+=	editor/ppmfade editor/ppmshadow editor/pnmquant \
		generator/ppmrainbow manweb editor/pnmflip editor/ppmquant
STAGEDIR=	${WRKDIR}/staging

LIBS.SunOS+=	-lsocket -lnsl
MAKE_ENV+=	NETWORKLD=${LIBS:Q}
MAKE_FLAGS+=	PKGMANDIR=${PKGMANDIR}

WRAPPER_REORDER_CMDS+=	reorder:l:rle:netpbm

# Several of the netpbm shell scripts use bashisms, so force using
# bash for all of the shell scripts.
#
REPLACE_INTERPRETER+=	bash
REPLACE.bash.old=	.*/bin/sh
REPLACE.bash.new=	${TOOLS_PATH.bash}
REPLACE_FILES.bash=	converter/other/anytopnm
REPLACE_FILES.bash+=	converter/other/pnmtoplainpnm
REPLACE_FILES.bash+=	converter/ppm/hpcdtoppm/hpcdtoppm
REPLACE_FILES.bash+=	converter/ppm/hpcdtoppm/pcdovtoppm
REPLACE_FILES.bash+=	editor/pamstretch-gen
REPLACE_FILES.bash+=	editor/pnmindex.sh
REPLACE_FILES.bash+=	editor/pnmmargin
REPLACE_FILES.bash+=	editor/ppmquantall
REPLACE_FILES.bash+=	other/ppmtomap

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

# Fiasco fails to compile on Darwin-8.x.
.if !empty(MACHINE_PLATFORM:MDarwin-8.*-*)
MAKE_ENV+=	BUILD_FIASCO=N
.endif

.if ${OPSYS} == "Darwin"
MAKE_ENV+=	NETPBMLIBTYPE="dylib" NETPBMLIBSUFFIX="dylib"
.elif ${OPSYS} == "HPUX" && ${OBJECT_FMT} == "SOM"
MAKE_ENV+=	NETPBMLIBTYPE="unixshared" NETPBMLIBSUFFIX="sl"
.else
MAKE_ENV+=	NETPBMLIBTYPE="unixshared" NETPBMLIBSUFFIX="so"
.endif

.if !empty(PKGSRC_COMPILER:Mido)
CPPFLAGS+=	-DSGI_IDO_CC
.endif

.include "../../graphics/jasper/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"

pre-configure:
	${CP} ${WRKSRC}/Makefile.config.in ${WRKSRC}/Makefile.config

pre-install:
	${RM} -fr ${STAGEDIR}

post-install:
	cd ${STAGEDIR} && 					\
	${MV} link/* lib && 					\
	${RM} -rf link man/web && 				\
	(rmdir man || ${TRUE}) &&				\
	${MKDIR} share/doc/netpbm &&				\
	${CP} ${WRKSRC}/doc/* share/doc/netpbm &&		\
	${MKDIR} ${PKGMANDIR}/man1 &&				\
	${MV} share/doc/netpbm/*.1	${PKGMANDIR}/man1 &&	\
	${MV} misc share/netpbm && 				\
	${CHOWN} -R ${BINOWN}:${BINGRP} . &&			\
	pax -rwpppm . ${DESTDIR}${PREFIX}
	${RM} -fr ${STAGEDIR}
	${FIND} ${DESTDIR}${PREFIX}/share/doc/netpbm -type f -print |	\
		${XARGS} ${CHMOD} ${NONBINMODE}

.include "../../mk/bsd.pkg.mk"