Magellan Linux

Contents of /branches/magellan-next/extras/opera/opera-11.60-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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