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