blob: 7df3144ded883236b526a98fb1dd10ffc87e272b (
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# $NetBSD: Makefile,v 1.229 2021/04/21 11:41:57 adam Exp $
DISTNAME= netpbm-10.79.04
PKGREVISION= 7
CATEGORIES= graphics
MASTER_SITES= #
# 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-r3052${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} MACHINE=${MACHINE:Q}
MAKE_FLAGS+= PKGMANDIR=${PKGMANDIR}
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
REPLACE_SH+= buildtools/stamp-date
STAGEDIR= ${WRKDIR}/staging
WRKSRC= ${WRKDIR}/netpbm
WRAPPER_REORDER_CMDS+= reorder:l:rle:netpbm
SUBST_CLASSES+= rgb_txt
SUBST_STAGE.rgb_txt= pre-configure
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,'
# needs pkg-config and x11?!
TEST_TARGET= test
.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
.include "../../mk/compiler.mk"
# Ridiculous but they hardcode it in every file so we have no choice.
.if ${OPSYS} == "SunOS" && \
(!empty(CC_VERSION:Mgcc-[6-9]*) || !empty(PKGSRC_COMPILER:Mclang))
SUBST_CLASSES+= xopen
SUBST_STAGE.xopen= pre-configure
SUBST_FILES.xopen= */*.c */*/*.c */*/*/*.c */*/*/*/*.c */*/*/*/*/*.c
SUBST_FILES.xopen+= lib/util/lexheader
SUBST_SED.xopen= -e '/_XOPEN_SOURCE/s/500/600/'
SUBST_SED.xopen+= -e '/_XOPEN_SOURCE/s/1$$/600/'
SUBST_SED.xopen+= -e '/_XOPEN_SOURCE[^0-9]*\//s/SOURCE/SOURCE 600/'
SUBST_SED.xopen+= -e '/_XOPEN_SOURCE$$/s/E$$/E 600/'
SUBST_SED.xopen+= -e '/_POSIX_SOURCE.*fdopen/s/_POSIX_SOURCE/_XOPEN_SOURCE 600/'
.endif
INSTALLATION_DIRS= ${PKGMANDIR}/man1 ${PKGMANDIR}/man3 ${PKGMANDIR}/man5 share/netpbm
.include "options.mk"
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
.if !empty(PKG_OPTIONS:Mjasper)
${ECHO} "JASPERLIB = ${BUILDLINK_PREFIX.jasper}/lib/libjasper.so" >> ${WRKSRC}/config.mk
${ECHO} "JASPERHDR_DIR = ${BUILDLINK_PREFIX.jasper}/include" >> ${WRKSRC}/config.mk
.else
${ECHO} "JASPERLIB = NONE" >> ${WRKSRC}/config.mk
.endif
${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 -rwppm . ${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/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
|