summaryrefslogtreecommitdiffstats
path: root/www/mozex/Makefile.xpi
blob: 99bc252fea0a2a17fe4e505db5c7dfd455ef1a61 (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
# Date created:           Sun Oct 26, 2003
# Whom:               Thierry Thomas (<thierry@pompo.net>)
#
# $FreeBSD$
#    $MCom$

EXTRACT_SUFX=   .xpi

BUILD_DEPENDS+= ${MOZDIR}/regxpcom:${PORTSDIR}/www/${MOZPORT}
RUN_DEPENDS+=   ${MOZDIR}:${PORTSDIR}/www/${MOZPORT}

NO_BUILD=   yes
USE_ZIP=    yes

PKGINSTALL= ${PORTSDIR}/www/mozex/pkg-install.xpi
PKGDEINSTALL=   ${PKGINSTALL}

.if !defined(WITH_FIREFOX)
# "Regular" mozillas
. if exists(${LOCALBASE}/lib)
MOZDIR!=    ${FIND} ${LOCALBASE}/lib -name mozilla-bin -exec dirname {} \; | ${HEAD} -n 1
. else
MOZDIR=
. endif
. if empty(MOZDIR)
MOZPORT=    mozilla
MOZDIR=     ${LOCALBASE}/lib/${MOZPORT}
. else
MOZPORT!=   ${BASENAME} ${MOZDIR}
. endif
MOZLDIR=    lib/${MOZPORT}
.else
# Firefox
DEPRECATED= "must be converted to include www/xpi-adblock/Makefile.xpi"
PKGNAMESUFFIX=  -firefox
. if exists(${LOCALBASE}/lib)
MOZDIR!=    ${FIND} ${LOCALBASE}/lib -name firefox-bin -exec dirname {} \; | ${HEAD} -n 1
. else
MOZDIR=
. endif
. if empty(MOZDIR)
MOZVER=     firefox
. else
MOZVER!=    ${BASENAME} ${MOZDIR}
. endif
MOZPORT=    firefox
MOZLDIR=    lib/firefox
.endif
.if empty(MOZDIR)
MOZDIR=     ${LOCALBASE}/${MOZLDIR}
.endif

PLIST_SUB=  MOZDIR=${MOZLDIR}

pre-install:
.if ${PREFIX} != ${LOCALBASE}
    @${ECHO_MSG} ""
    @${ECHO_MSG} "${PREFIX} invalid - must be installed under ${LOCALBASE}."
    @${ECHO_MSG} ""
    @${FALSE}
.else
    @${CP} ${FILESDIR}/installed-chrome.txt ${MOZDIR}/${PORTNAME}-installed-chrome.txt
.endif

post-install:
    @${ECHO_CMD} ${MOZLDIR}/${PORTNAME}-installed-chrome.txt >> ${TMPPLIST}
    @${CAT} ${MOZDIR}/${PORTNAME}-installed-chrome.txt  \
        >> ${MOZDIR}/chrome/installed-chrome.txt
    @${ECHO_CMD} "@exec ${CAT} ${MOZDIR}/${PORTNAME}-installed-chrome.txt \
        >> ${MOZDIR}/chrome/installed-chrome.txt" >> ${TMPPLIST}
    @${SETENV} PKG_PREFIX=${PREFIX} \
    ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if exists(${PKGMESSAGE})
    @${CAT} ${PKGMESSAGE}
.endif