aboutsummaryrefslogtreecommitdiffstats
path: root/print/pnm2ppa/Makefile
blob: b784454ad938b6aa45913f0b5f7ae85e3401a56e (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
# Created by: smace@FreeBSD.org
# $FreeBSD$

PORTNAME=   pnm2ppa
PORTVERSION=    1.13
PORTREVISION=   4
CATEGORIES= print
MASTER_SITES=   SF

MAINTAINER= 000.fbsd@quip.cz
COMMENT=    Convert PNM images to PPA for some HP printers

OPTIONS_DEFINE= A4SIZE
A4SIZE_DESC=    Set A4 (not Letter) as a default paper size

USES=   gmake ghostscript:run
GNU_CONFIGURE=  yes

.include <bsd.port.pre.mk>

.if defined(A4) || !empty(PORT_OPTIONS:MA4SIZE)
RUN_DEPENDS+=   enscript:print/enscript-a4
.else
RUN_DEPENDS+=   enscript:print/enscript-letter
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|-Wformat-security -g|-Wformat-security| ; \
         s|-O2 -DNDEBUG|-DNDEBUG|' ${WRKSRC}/configure
    @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" \
        ${WRKSRC}/pnm2ppa.conf > ${WRKSRC}/pnm2ppa.conf.sample
    @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" \
        ${WRKSRC}/docs/en/pnm2ppa.1 > ${WRKSRC}/pnm2ppa.1
    @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" \
            -e "s:%%LOCALBASE%%:${LOCALBASE}:g" \
        ${FILESDIR}/asciippafilter.SH > ${WRKSRC}/asciippafilter
    @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" \
            -e "s:%%LOCALBASE%%:${LOCALBASE}:g" \
        ${FILESDIR}/ppafilter.SH > ${WRKSRC}/ppafilter

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/calibrate_ppa ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/pnm2ppa ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_SCRIPT} ${WRKSRC}/asciippafilter ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_SCRIPT} ${WRKSRC}/ppafilter ${STAGEDIR}${PREFIX}/bin
    ${INSTALL_MAN} ${WRKSRC}/pnm2ppa.1 ${STAGEDIR}${PREFIX}/man/man1
    ${INSTALL_DATA} ${WRKSRC}/pnm2ppa.conf.sample ${STAGEDIR}${PREFIX}/etc

.include <bsd.port.post.mk>