aboutsummaryrefslogtreecommitdiffstats
path: root/www/firefox-sync/Makefile
blob: 1b2c080e12b785323c3813e6d4a6f1e10920ba80 (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
# New ports collection makefile for:    weave
# Date created:             31 Aug 2009
# Whom:                 Grzegorz Blach <magik@roorback.net>
#
# $FreeBSD$
#

PORTNAME=   firefox-sync
PORTVERSION=    1.7
PORTEPOCH=  2
CATEGORIES= www
MASTER_SITES=   http://hg.mozilla.org/services/fx-sync/archive/${DISTVERSION}${EXTRACT_SUFX}/

MAINTAINER= magik@roorback.net
COMMENT=    Mozilla extension to synchronize Firefox data

BUILD_DEPENDS=  ${LOCALBASE}/lib/libxul/xpidl:${PORTSDIR}/www/libxul
RUN_DEPENDS=    ${LOCALBASE}/lib/libxul/xpidl:${PORTSDIR}/www/libxul

ONLY_FOR_ARCHS= i386 amd64
USE_BZIP2=  yes
USE_GMAKE=  yes
MAKE_JOBS_UNSAFE=yes
WRKSRC=     ${WRKDIR}/fx-sync-${DISTVERSION}

OPTIONS=    FF35 "Build for Firefox 3.5 instead of 3.6" Off

.include <bsd.port.options.mk>

.if defined(WITHOUT_FF35)
USE_FIREFOX_BUILD=  36
AMD64_ARCH= amd64
.else
USE_FIREFOX_BUILD=  35
AMD64_ARCH= x86_64
.endif

REVID=      d52662c1c99b
.if ${ARCH} == i386
PLATFORM=   FreeBSD_x86-gcc3
.elif ${ARCH} == amd64
PLATFORM=   FreeBSD_${AMD64_ARCH}-gcc3
.else
PLATFORM=   dummy
IGNORE=     unsupported platform
.endif

GMAKE_FLAGS=    sdkdir=${PREFIX}/lib/firefox3/sdk release_build=1 platform_target=${PLATFORM} TOPSRCDIR=${WRKSRC}
ALL_TARGET= ${GMAKE_FLAGS} crypto crypto-obsolete-build build
INSTALL_TARGET= ${GMAKE_FLAGS} xpi

XPI_ID=     {340c2bbc-ce74-4362-90b5-7c26312808ef}
XPI_DIR=    ${PREFIX}/lib/xpi/${XPI_ID}

PLIST_SUB+= XPI_XPIDIR="${XPI_DIR:S,^${PREFIX}/,,}" \
        XPI_XPIID=${XPI_ID} \
        PLATFORM=${PLATFORM}

post-patch:
    @${REINPLACE_CMD} -e "s|\$$(shell hg tip --template '{node\|short}')|${REVID}|g" ${WRKSRC}/Makefile
.if ${PLATFORM} == FreeBSD_x86_64-gcc3
    ${REINPLACE_CMD} -e 's|arch = amd64|arch = x86_64|g' ${WRKSRC}/crypto-obsolete/src/Makefile
.endif

post-install:
    ${MKDIR} ${XPI_DIR}
    (cd ${XPI_DIR}; tar -xf ${WRKSRC}/dist/xpi/weave-${DISTVERSION}-rel.xpi)
    ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${XPI_DIR}/
    ${FIND} ${XPI_DIR}/ -type d -print0 | ${XARGS} -0 ${CHMOD} 755
    ${FIND} ${XPI_DIR}/ -type f -print0 | ${XARGS} -0 ${CHMOD} 644
    ${MKDIR} ${PREFIX}/lib/firefox3/extensions
    ${LN} -sf ${XPI_DIR} ${PREFIX}/lib/firefox3/extensions

.include <bsd.port.mk>