aboutsummaryrefslogtreecommitdiffstats
path: root/www/linux-opera/Makefile
blob: f59c1730910d516f19ac279ba7e301b1bfd24d9e (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# $FreeBSD$

PORTNAME=   opera
PORTVERSION=    ${OPERA_VER}
PORTREVISION=   1
CATEGORIES= www linux
MASTER_SITES=   ftp://ftp.opera.com/pub/opera/linux/${OPERA_VER:S/.//}/ \
        ftp://ftp.sunet.se/pub/www/clients/Opera/linux/${OPERA_VER:S/.//}/ \
        ftp://sunsite.cnlab-switch.ch/mirror/opera/linux/${OPERA_VER:S/.//}/ \
        ftp://ftp.tiscali.nl/pub/mirrors/opera/linux/${OPERA_VER:S/.//}/ \
        ftp://ftp.ntua.gr/pub/www/Opera/linux/${OPERA_VER:S/.//}/ \
        http://mirrors.pmmf.hu/mirror/opera/linux/${OPERA_VER:S/.//}/ \
        ftp://ftp.task.gda.pl/pub/opera/linux/${OPERA_VER:S/.//}/ \
        ftp://ftp.planetmirror.com/pub/opera/linux/${OPERA_VER:S/.//}/ \
        http://gd.tuwien.ac.at/infosys/browsers/opera/linux/${OPERA_VER:S/.//}/ \
        ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/www/opera/linux/${OPERA_VER:S/.//}/&,}
PKGNAMEPREFIX=  linux-
DISTNAME=   ${PORTNAME}-${OPERA_VER}-${OPERA_BUILD}.i386.linux

MAINTAINER= acm@FreeBSD.org
COMMENT=    A blazingly fast, full-featured, standards-compliant browser

RUN_DEPENDS=    update-mime-database:${PORTSDIR}/misc/shared-mime-info

USE_XZ=     yes
USE_LINUX=  yes
USE_LINUX_APPS= naslibs png xorglibs
ONLY_FOR_ARCHS= i386 amd64
USE_GNOME=  desktopfileutils
WANT_GNOME= yes
INSTALLS_ICONS= yes

NO_BUILD=   yes

OPERA_VER?= 11.62
OPERA_BUILD?=   1347
DATADIR=    ${PREFIX}/share/${UNIQUENAME}
DOCSDIR=    ${PREFIX}/share/doc/${UNIQUENAME}

MAN1=       linux-opera.1 linux-opera-widget-manager.1

RENAME=     opera opera-widget-manager lib/opera \
        share/applications/opera-browser.desktop \
        share/applications/opera-widget-installer.desktop \
        share/applications/opera-widget-manager.desktop \
        share/doc/opera share/opera man/man1/opera.1 \
        man/man1/opera-widget-manager.1 \
        share/mime/packages/opera-extension.xml \
        share/mime/packages/opera-unite-application.xml \
        share/mime/packages/opera-widget.xml

.include <bsd.port.pre.mk>

.if ${OSVERSION}<700055
IGNORE= you need FreeBSD>=7.0 RELEASE with Linux emulation 2.6.x.
.elif ${OSVERSION}<800076 && ! defined (OVERRIDE_LINUX_NONBASE_PORTS)
IGNORE= you need to use non-default linux ports (define OVERRIDE_LINUX_BASE_PORT=f8 and OVERRIDE_LINUX_NONBASE_PORTS=f8). You also can use f10 instead of f8, but I only have tested it with f8.
.endif

post-extract:
    @${GUNZIP_CMD} ${WRKSRC}/share/man/man1/*.gz
    @${MV} ${WRKSRC}/share/man ${WRKSRC}/man
    @for _r in ${RENAME}; do \
        linux=`${ECHO_CMD} $${_r} | \
               ${SED} -e 's|opera|${UNIQUENAME}|g'`; \
        ${MV} ${WRKSRC}/$${_r} ${WRKSRC}/$${linux}; \
    done; \
    for _f in `find ${WRKSRC}/share/icons -type f | \
           ${SED} -e 's|${WRKSRC}/||g'`; do \
        linux=`${ECHO_CMD} $${_f} | \
               ${SED} -e 's|opera|${UNIQUENAME}|g'`; \
        ${MV} ${WRKSRC}/$${_f} ${WRKSRC}/$${linux}; \
    done; \
    for _l in `find ${WRKSRC}/share/icons -name opera-widget.png | \
           ${SED} -e 's|/opera-widget\.png||g'`; do \
        ${RM} $${_l}/opera-widget.png; \
        cd $${_l}; \
        ${LN} -s ../mimetypes/${UNIQUENAME}-widget.png \
            $${_l}/${UNIQUENAME}-widget.png; \
    done

post-patch:
    @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
        s|%%LOCALBASE%%|${LOCALBASE}|g ; \
        s|%%LINUXBASE%%|${LINUXBASE}|g' \
            ${WRKSRC}/share/${UNIQUENAME}/defaults/pluginpath.ini
    @${REINPLACE_CMD} -e '/man1/s|opera|${UNIQUENAME}|g ; \
        /man1/s|1.gz|1|g ; /man1/s|share/||g ; \
        s|bin/opera|bin/${UNIQUENAME}|g ; \
        s|name=$$(uname -s)|name=Linux|g ; \
        s|lib/opera|lib/${UNIQUENAME}|g ; \
        s|applications/opera|applications/${UNIQUENAME}|g ; \
        s|doc/opera|doc/${UNIQUENAME}|g ; \
        /hicolor/s|/opera|/${UNIQUENAME}|g ; \
        s|packages/opera|packages/${UNIQUENAME}|g ; \
        s|share/opera|share/${UNIQUENAME}|g ; \
        s|PREFIX=/usr/local|PREFIX=${PREFIX}|g ; \
        /OPERA_PERSONALDIR/s|.opera|.${UNIQUENAME}|g ; \
        s|opera)|${UNIQUENAME})|g ; \
        s|opera-widget-manager)|${UNIQUENAME}-widget-manager)|g ; \
        s|^.*rmdir.*mime/packages.*||g ; \
        s|^.*GX - bin/uninstall-opera@.*||g ; \
        s|[$$]tempdir/damaged|${WRKSRC}/damaged|g ; \
        s|PREFIX/bin/uninstall-opera|PREFIX/bin/disabled-opera|g' \
            ${WRKSRC}/install
    @${REINPLACE_CMD} -e '/^Name/s|$$| (Linux version)|g ; \
        /Exec/s|opera|${UNIQUENAME}|g ; \
        /Icon/s|opera|${UNIQUENAME}|g ; \
        /StartupWMClass/s|opera|${UNIQUENAME}|g ; \
        s|TryExec=.*||g ; /^$$/d' \
            ${WRKSRC}/share/applications/*.desktop
    @${REINPLACE_CMD} -e 's|lib/opera|lib/${UNIQUENAME}|g ; \
        s|doc/opera|doc/${UNIQUENAME}|g ; \
        s|share/opera|share/${UNIQUENAME}|g ; \
        s|opera-widget-manager|${UNIQUENAME}-widget-manager|g ; \
        s|opera (1)|${UNIQUENAME} (1)|g ; \
        s|\.opera@@|\.${UNIQUENAME}@@|g ; \
        s|B opera@@|B ${UNIQUENAME}@@|g ; \
        /standards-compliant/s|opera|${UNIQUENAME}|g' \
            ${WRKSRC}/man/man1/*.1
    @${REINPLACE_CMD} -e '/<generic-icon/s|opera|${UNIQUENAME}|g' \
            ${WRKSRC}/share/mime/packages/*.xml
    @${FIND} ${WRKSRC} -name '*.orig' -delete
    @${FIND} ${WRKSRC} -name '*.bak' -delete

do-install:
    @(cd ${WRKSRC} && ./install --system --quiet --force)

.include <bsd.port.post.mk>