Magellan Linux

Contents of /trunk/extras/opera/opera-11.64-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12203 - (show annotations) (download)
Thu May 10 17:50:50 2012 UTC (12 years, 1 month ago) by niro
File size: 7505 byte(s)
auto added: ver bump to 11.64-r1
1 # $Id$
2
3 PNAME="opera"
4 PVER="11.64"
5 PBUILD="r1"
6
7 # enable or disable gtk3 (0=false, 1=true)
8 ENABLE_GTK3=0
9 # enable or disable qt4/kde4 (0=false, 1=true)
10 ENABLE_KDE4=0
11
12 # export them, as they are used in postinstall
13 SPECIAL_VARS="ENABLE_GTK3 ENABLE_KDE4"
14
15 SPLIT_PACKAGES="opera opera-gtk2"
16 if [[ ${ENABLE_GTK3} -eq 1 ]]
17 then
18 SPLIT_PACKAGES+=" opera-gtk3"
19 fi
20
21 if [[ ${ENABLE_KDE4} -eq 1 ]]
22 then
23 SPLIT_PACKAGES+=" opera-kde4"
24 fi
25
26 PCAT="net-www"
27 HOMEPAGE="http://www.opera.com/"
28
29 COMMON_DEPEND=">= x11-libs/libICE-1
30 >= x11-libs/libSM-1
31 >= x11-libs/libX11-1
32 >= x11-libs/libXau-1
33 >= x11-libs/libXdmcp-1
34 >= x11-libs/libXext-1
35 >= x11-libs/libXmu-1
36 >= x11-libs/libXrender-0.9
37 >= x11-libs/libXt-1
38 >= x11-libs/libXcomposite-0.4
39 >= x11-libs/libXcursor-1
40 >= x11-libs/libXdamage-1
41 >= x11-libs/libXfixes-4
42 >= x11-libs/libXi-1
43 >= x11-libs/libXrandr-1
44 >= media-libs/fontconfig-2.6
45 >= media-libs/freetype-2.3
46 >= media-libs/libpng-1.2
47 >= dev-libs/expat-2
48 >= media-libs/gstreamer-0.10.25
49 >= media-libs/gst-plugins-base-0.10.25
50 >= sys-apps/util-linux-2.16
51 >= sys-libs/zlib-1.2.3
52 >= virtual/opengl"
53
54 if [[ ${ENABLE_KDE4} -eq 1 ]]
55 then
56 KDE4_DEPEND=">= x11-libs/qt4-core-4.7
57 >= x11-libs/qt4-gui-4.7
58 >= x11-libs/qt4-dbus-4.7
59 >= x11-libs/qt4-svg-4.7
60 >= kde-base/kdelibs4-4.6"
61 fi
62
63 GTK2_DEPEND="== net-www/opera-${PVER}
64 >= dev-libs/glib2-2.28
65 >= dev-libs/atk-1.33
66 >= x11-libs/cairo-1.10
67 >= x11-libs/pango-1.28
68 >= x11-libs/gtk2+-2.24"
69
70 if [[ ${ENABLE_GTK3} -eq 1 ]]
71 then
72 GTK3_DEPEND="== net-www/opera-${PVER}
73 >= dev-libs/glib2-2.30
74 >= dev-libs/atk-2
75 >= x11-libs/cairo-1.10
76 >= x11-libs/pango-3
77 >= x11-libs/gtk3+-3"
78 fi
79
80 SDEPEND="${COMMON_DEPEND}
81 ${KDE4_DEPEND}
82 ${GTK2_DEPEND}
83 >= sys-apps/sed-4"
84
85 if [[ ${ENABLE_GTK3} -eq 1 ]]
86 then
87 SDEPEND="${SDEPEND}
88 ${GTK3_DEPEND}"
89 fi
90
91 if [[ ${ENABLE_KDE4} -eq 1 ]]
92 then
93 SDEPEND="${SDEPEND}
94 ${KDE4_DEPEND}"
95 fi
96
97 PROVIDE="virtual/webbrowser"
98
99 # .6 uses newer glibc and qt versions
100 BUILD="1403"
101
102 # ftp://opera.ftp.fu-berlin.de/linux
103 SRCFILE_x86="${PNAME}-${PVER}-${BUILD}.i386.linux.tar.xz"
104 SRCFILE_x86_64="${PNAME}-${PVER}-${BUILD}.x86_64.linux.tar.xz"
105 # decide between x86 and x86_64 arch
106 SRCFILE="$(eval echo \$SRCFILE_${ARCH/i*86/x86})"
107 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}-${BUILD}.${ARCH/i*86/i386}.linux"
108
109 sminclude mtools xdg
110
111 SRC_URI=(
112 http://get.geo.opera.com/pub/opera/linux/${PVER/./}/${SRCFILE_x86}
113 http://get.geo.opera.com/pub/opera/linux/${PVER/./}/${SRCFILE_x86_64}
114 ftp://opera.ftp.fu-berlin.de/linux/${PVER/./}/${SRCFILE_x86}
115 ftp://opera.ftp.fu-berlin.de/linux/${PVER/./}/${SRCFILE_x86_64}
116 ftp://opera.ftp.fu-berlin.de/linux/${PVER/./}/final/en/i386/${SRCFILE_x86}
117 ftp://opera.ftp.fu-berlin.de/linux/${PVER/./}/final/en/x86_64/${SRCFILE_x86_64}
118 mirror://${PNAME}/${SRCFILE_x86}
119 mirror://${PNAME}/${SRCFILE_x86_64}
120 )
121
122 split_info_opera()
123 {
124 DESCRIPTION="Opera Web browser."
125 DEPEND="${COMMON_DEPEND}"
126 }
127
128 if [[ ${ENABLE_KDE4} -eq 1 ]]
129 then
130 split_info_opera-kde4()
131 {
132 DESCRIPTION="Opera UI integration for KDE4."
133 DEPEND="== net-www/opera-${PVER}
134 ${KDE4_DEPEND}"
135 }
136 fi
137
138 split_info_opera-gtk2()
139 {
140 DESCRIPTION="Opera UI integration for GTK2 and GNOME."
141 DEPEND="== net-www/opera-${PVER}
142 ${GTK2_DEPEND}"
143 }
144
145 if [[ ${ENABLE_GTK3} -eq 1 ]]
146 then
147 split_info_opera-gtk3()
148 {
149 DESCRIPTION="Opera UI integration for GTK3 and GNOME."
150 DEPEND="== net-www/opera-${PVER}
151 ${GTK3_DEPEND}"
152 }
153 fi
154
155 src_prepare()
156 {
157 munpack ${SRCFILE} || die
158 }
159
160 src_install_opera()
161 {
162 cd ${SRCDIR}
163
164 # fix install destination
165 # (do it here, not in src_unpack to support split-packages)
166 sed -i "s:/usr/local:${BINDIR}/opt/opera:g" install || die
167
168 # prepare installation directories for opera's installer script
169 minstalldir /opt/opera
170 # run opera's native installer
171 ./install --system --unattended || die
172
173 # remove uninstaller
174 rm ${BINDIR}/opt/opera/bin/uninstall-opera || die
175
176 # fix ${BINDIR} everywhere
177 sed -i "s:${BINDIR}::g" ${BINDIR}/opt/opera/bin/opera || die
178 sed -i "s:${BINDIR}::g" ${BINDIR}/opt/opera/bin/opera-widget-manager || die
179 sed -i "s:${BINDIR}::g" ${BINDIR}/opt/opera/share/applications/opera-widget-manager.desktop || die
180 sed -i "s:${BINDIR}::g" ${BINDIR}/opt/opera/share/applications/opera-browser.desktop || die
181 sed -i "s:${BINDIR}::g" ${BINDIR}/opt/opera/share/applications/opera-widget-installer.desktop || die
182
183 # sanity check
184 if [[ ! -z $(grep -irl ${BINDIR} ${BINDIR}/opt/opera) ]]
185 then
186 die "${BINDIR} in installed /opt/opera files detected!"
187 fi
188
189 # fix permissions
190 mchmod 0755 /opt/opera/bin/opera || die
191 mchmod 0755 /opt/opera/bin/opera-widget-manager || die
192 mchmod 0644 /opt/opera/share/applications/opera-widget-manager.desktop || die
193 mchmod 0644 /opt/opera/share/applications/opera-browser.desktop || die
194 mchmod 0644 /opt/opera/share/applications/opera-widget-installer.desktop || die
195
196 # install the icons
197 local i
198 for i in 16x16 22x22 24x24 32x32 48x48 128x128 scalable
199 do
200 minstalldir /usr/share/icons/hicolor/${i}/apps || die
201 if [[ -f share/icons/hicolor/${i}/apps/opera-browser.png ]]
202 then
203 minstallfile share/icons/hicolor/${i}/apps/opera-browser.png /usr/share/icons/hicolor/${i}/apps || die
204 fi
205 if [[ -f share/icons/hicolor/${i}/apps/opera-widget-manager.png ]]
206 then
207 minstallfile share/icons/hicolor/${i}/apps/opera-widget-manager.png /usr/share/icons/hicolor/${i}/apps || die
208 fi
209
210 minstalldir /usr/share/icons/hicolor/${i}/mimetypes || die
211 if [[ -f share/icons/hicolor/${i}/mimetypes/opera-widget.png ]]
212 then
213 minstallfile share/icons/hicolor/${i}/mimetypes/opera-widget.png /usr/share/icons/hicolor/${i}/mimetypes || die
214 fi
215 if [[ -f share/icons/hicolor/${i}/mimetypes/opera-unite-application.png ]]
216 then
217 minstallfile share/icons/hicolor/${i}/mimetypes/opera-unite-application.png /usr/share/icons/hicolor/${i}/mimetypes || die
218 fi
219 done
220
221 # install a symlink /usr/bin/opera
222 minstalldir /usr/bin || die
223 mlink /opt/opera/bin/opera /usr/bin/opera || die
224 mlink /opt/opera/bin/opera-widget-manager /usr/bin/opera-widget-manager || die
225
226 # install desktop icons
227 minstallxdg --file share/applications/opera-browser.desktop || die
228 minstallxdg --file share/applications/opera-widget-manager.desktop || die
229 minstallxdg --file share/applications/opera-widget-installer.desktop || die
230
231 # cleanup
232 rm ${BINDIR}/opt/opera/lib/opera/liboperakde4.so || die
233 rm ${BINDIR}/opt/opera/lib/opera/liboperagtk2.so || die
234 rm ${BINDIR}/opt/opera/lib/opera/liboperagtk3.so || die
235 }
236
237 if [[ ${ENABLE_KDE4} -eq 1 ]]
238 then
239 src_install_opera-kde4()
240 {
241 cd ${SRCDIR}
242 minstalldir /opt/opera/lib/opera || die
243 minstallexec lib/opera/liboperakde4.so /opt/opera/lib/opera/ || die
244 }
245 fi
246
247 src_install_opera-gtk2()
248 {
249 cd ${SRCDIR}
250 minstalldir /opt/opera/lib/opera || die
251 minstallexec lib/opera/liboperagtk2.so /opt/opera/lib/opera/ || die
252 }
253
254 if [[ ${ENABLE_GTK3} -eq 1 ]]
255 then
256 src_install_opera-gtk3()
257 {
258 cd ${SRCDIR}
259 minstalldir /opt/opera/lib/opera || die
260 minstallexec lib/opera/liboperagtk3.so /opt/opera/lib/opera/ || die
261 }
262 fi
263
264 postinstall_opera()
265 {
266 if [[ ${ENABLE_KDE4} -ne 1 ]]
267 then
268 if [[ ! -z $(magequery -n opera-kde4) ]]
269 then
270 echo "Opera was packaged without KDE4 support but an old KDE4 package was found."
271 echo "Please uninstall 'net-www/opera-kde4' after this installation."
272 fi
273 fi
274 if [[ ${ENABLE_GTK3} -ne 1 ]]
275 then
276 if [[ ! -z $(magequery -n opera-gtk3) ]]
277 then
278 echo "Opera was packaged without GTK3 support but an old GTK3 package was found."
279 echo "Please uninstall 'net-www/opera-gtk3' after this installation."
280 fi
281 fi
282 }