aboutsummaryrefslogtreecommitdiffstats
path: root/print/hplip3/Makefile
blob: 1fad4c031d46f1b40165591e9b29aa1d6869b026 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# New ports collection makefile for:    hplip
# Date created:     1 April 2006
# Whom:         amistry@am-productions.biz
#
# $FreeBSD$
#

PORTNAME=   hplip
PORTVERSION=    0.9.10
CATEGORIES= print
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= hplip

MAINTAINER= amistry@am-productions.biz
COMMENT=    Drivers and utilities for HP Printers and All-in-One devices

LIB_DEPENDS=    jpeg.9:${PORTSDIR}/graphics/jpeg \
        sane.1:${PORTSDIR}/graphics/sane-backends \
        cups.2:${PORTSDIR}/print/cups-base \
        usb:${PORTSDIR}/devel/libusb \
        netsnmp.9:${PORTSDIR}/net-mgmt/net-snmp
RUN_DEPENDS=    pylupdate:${PORTSDIR}/x11-toolkits/py-qt

CONFLITS=   hpijs-* foomatic-filters-*

GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --disable-dependency-tracking \
        --disable-pp-build
INSTALLS_SHLIB= yes
USE_GHOSTSCRIPT_RUN=    yes
USE_PYTHON= yes
USE_RC_SUBR=    hpiod.sh hpssd.sh

CONFIGURE_ENV=  CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
        LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"

MAKE_ENV=   CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
        LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"

PKGDEINSTALL=   ${PKGINSTALL}

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 5000000
BROKEN=     does not compile
.endif

post-extract:
    @${RM} -r ${WRKSRC}/data/images/CVS

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/local/share/cups|${LOCALBASE}/share/cups|g ; \
        s|/usr/lib/cups/filter|${LOCALBASE}/libexec/cups/filter|g' \
            ${WRKSRC}/configure ${WRKSRC}/prnt/hpijs/configure
    @${REINPLACE_CMD} -e 's|/usr/share|${LOCALBASE}/share|g ; \
        s|/usr/lib|${LOCALBASE}/lib|g ; \
        s|/etc/init.d|${LOCALBASE}/etc/rc.d|g ; \
        s|/etc/sane.d|${LOCALBASE}/etc/sane.d|g ; \
        s|/etc/hp|${LOCALBASE}/etc/hp|g' \
            ${WRKSRC}/Makefile.in \
            ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|/etc/hp/|${LOCALBASE}/etc/hp/|g ; \
        s|/usr/lib/cups/filter|${LOCALBASE}/libexec/cups/filter|g' \
            ${WRKSRC}/base/g.py \
            ${WRKSRC}/fax/backend/hpfax.py \
            ${WRKSRC}/hplip_readme.html \
            ${WRKSRC}/hpssd.py \
            ${WRKSRC}/io/hpiod/hpiod.h \
            ${WRKSRC}/prnt/hpijs/hplip_api.h \
            ${WRKSRC}/prnt/hpijs/configure.in
    @${REINPLACE_CMD} -e 's|#!/usr/bin/env python|#!${LOCALBASE}/bin/python|g' \
            ${WRKSRC}/*.py \
            ${WRKSRC}/*/*.py \
            ${WRKSRC}/*/*/*.py
.if defined(NOPORTDOCS)
    @${REINPLACE_CMD} -e 's|install-data-am: install-docDATA|install-data-am:|g' \
        ${WRKSRC}/prnt/hpijs/Makefile.in
    @${REINPLACE_CMD} -e 's|install-dist_xmlDATA install-docDATA|install-dist_xmlDATA|g' \
        ${WRKSRC}/Makefile.in
.endif

pre-su-install:
    @${MKDIR} ${PREFIX}/share/applications

post-install:
.if !defined(PACKAGE_BUILDING)
    @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.endif
    @${LN} -sf ${PREFIX}/share/hplip/hpssd.py ${PREFIX}/sbin/hpssd
    @${LN} -sf ${PREFIX}/bin/foomatic-rip \
        ${PREFIX}/libexec/cups/filter/foomatic-rip
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>