aboutsummaryrefslogtreecommitdiffstats
path: root/print/muttprint/Makefile
blob: 5e5a50f0ffa079dd91aca88d2f606cd314b898bd (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
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
# Created by: Oliver Braun <obraun@informatik.unibw-muenchen.de>
# $FreeBSD$

PORTNAME=   muttprint
PORTVERSION=    0.73
PORTREVISION=   4
CATEGORIES= print mail
MASTER_SITES=   SF/muttprint/muttprint/muttprint-${PORTVERSION}

MAINTAINER= guru@unixarea.de
COMMENT=    Utility to print mail for most any mail client

LICENSE=    GPLv2

BUILD_DEPENDS=  docbook2pdf:textproc/docbook-utils \
        docbook-sgml>0:textproc/docbook-sgml
RUN_DEPENDS=    psnup:print/psutils \
        p5-TimeDate>=0:devel/p5-TimeDate \
        p5-Text-Iconv>=0:converters/p5-Text-Iconv

GNU_CONFIGURE=  yes
USES=       autoreconf gmake perl5
USE_TEX=    latex dvipsk

NO_BUILD=   yes
REINPLACE_ARGS= -i ""

OPTIONS_DEFINE=     CUPS X11 DOCS XFACE
OPTIONS_DEFAULT=    X11
X11_DESC=       graphics/ImageMagick[-nox11] dependency
XFACE_DESC=     mail/faces dependency (requires gtk12)

CUPS_RUN_DEPENDS=   lpr-cups:print/cups
XFACE_RUN_DEPENDS=  uncompface:mail/faces

.if !defined(PAPERSIZE)
PAPERSIZE=  letter
.endif

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCUPS}
PRINT_COMMAND=CUPS
.else
PRINT_COMMAND=lpr -P$$PRINTER
.endif

.if ${PORT_OPTIONS:MX11}
RUN_DEPENDS+=   convert:graphics/ImageMagick6
.else
RUN_DEPENDS+=   convert:graphics/ImageMagick6-nox11
.endif

pre-everything::
    @${ECHO}
    @${ECHO} Set PAPERSIZE=a4 if you need that paper size.
    @${ECHO}

post-patch:
    @${RM} ${WRKSRC}/pics/*.orig
.if ${PAPERSIZE}==a4
    @${REINPLACE_CMD} 's|%%PAPERSIZE%%|${PAPERSIZE:tu}|' \
        ${WRKSRC}/muttprint
.else
    @${REINPLACE_CMD} 's|%%PAPERSIZE%%|${PAPERSIZE}|' \
        ${WRKSRC}/muttprint
.endif
    @${REINPLACE_CMD} 's|%%PRINT_COMMAND%%|${PRINT_COMMAND}| ; \
        s|%%PREFIX%%|${PREFIX}|' \
        ${WRKSRC}/muttprint
.if ${PORT_OPTIONS:MCUPS}
    @${REINPLACE_CMD} 's|lpr $$CUPS_OPTIONS|${PREFIX}/bin/lpr $$CUPS_OPTIONS|' ${WRKSRC}/muttprint
.endif

.include <bsd.port.mk>