Annotation of /trunk/extras/opera/opera-12.16-r1.smage2
Parent Directory | Revision Log
Revision 19320 -
(hide annotations)
(download)
Wed Sep 4 21:33:49 2013 UTC (11 years ago) by niro
File size: 6474 byte(s)
Wed Sep 4 21:33:49 2013 UTC (11 years ago) by niro
File size: 6474 byte(s)
-no gtk3 build included and fixed sed dependency
1 | niro | 19318 | # $Id$ |
2 | |||
3 | PNAME="opera" | ||
4 | PVER="12.16" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | # enable or disable gtk3 (0=false, 1=true) | ||
8 | niro | 19320 | ENABLE_GTK3=0 |
9 | niro | 19318 | # enable or disable qt4/kde4 (0=false, 1=true) |
10 | ENABLE_KDE4=1 | ||
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/gstreamer0.10-0.10 | ||
49 | >= media-libs/gstreamer0.10-plugins-base-0.10 | ||
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/kdelibs-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 | niro | 19320 | >= virtual/sed" |
84 | niro | 19318 | |
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 | # build version of opera | ||
100 | BUILD="1860" | ||
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="$(marchsrcfile)" | ||
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 | mdelete /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/share/applications/opera-browser.desktop || die | ||
179 | |||
180 | # sanity check | ||
181 | if [[ ! -z $(grep -irl ${BINDIR} ${BINDIR}/opt/opera) ]] | ||
182 | then | ||
183 | die "${BINDIR} in installed /opt/opera files detected!" | ||
184 | fi | ||
185 | |||
186 | # fix permissions | ||
187 | mchmod 0755 /opt/opera/bin/opera || die | ||
188 | mchmod 0644 /opt/opera/share/applications/opera-browser.desktop || die | ||
189 | |||
190 | # install the icons | ||
191 | local i | ||
192 | for i in 16x16 22x22 24x24 32x32 48x48 128x128 scalable | ||
193 | do | ||
194 | minstalldir /usr/share/icons/hicolor/${i}/apps || die | ||
195 | if [[ -f share/icons/hicolor/${i}/apps/opera-browser.png ]] | ||
196 | then | ||
197 | minstallfile share/icons/hicolor/${i}/apps/opera-browser.png /usr/share/icons/hicolor/${i}/apps || die | ||
198 | fi | ||
199 | |||
200 | minstalldir /usr/share/icons/hicolor/${i}/mimetypes || die | ||
201 | if [[ -f share/icons/hicolor/${i}/mimetypes/opera-extension.png ]] | ||
202 | then | ||
203 | minstallfile share/icons/hicolor/${i}/mimetypes/opera-extension.png /usr/share/icons/hicolor/${i}/mimetypes || die | ||
204 | fi | ||
205 | done | ||
206 | |||
207 | # install a symlink /usr/bin/opera | ||
208 | minstalldir /usr/bin || die | ||
209 | mlink /opt/opera/bin/opera /usr/bin/opera || die | ||
210 | |||
211 | for i in opera-browser | ||
212 | do | ||
213 | # fix exec pathes | ||
214 | sed -i -e 's:@@{_\{,1\}SUFFIX}::g' -e 's:@@{PREFIX}:/usr:g' share/applications/${i}.desktop || die | ||
215 | # install desktop icons | ||
216 | minstallxdg --file share/applications/${i}.desktop || die | ||
217 | done | ||
218 | |||
219 | # cleanup | ||
220 | mdelete /opt/opera/lib/opera/liboperakde4.so || die | ||
221 | mdelete /opt/opera/lib/opera/liboperagtk2.so || die | ||
222 | mdelete /opt/opera/lib/opera/liboperagtk3.so || die | ||
223 | } | ||
224 | |||
225 | if [[ ${ENABLE_KDE4} -eq 1 ]] | ||
226 | then | ||
227 | src_install_opera-kde4() | ||
228 | { | ||
229 | cd ${SRCDIR} | ||
230 | minstalldir /opt/opera/lib/opera || die | ||
231 | minstallexec lib/opera/liboperakde4.so /opt/opera/lib/opera/ || die | ||
232 | } | ||
233 | fi | ||
234 | |||
235 | src_install_opera-gtk2() | ||
236 | { | ||
237 | cd ${SRCDIR} | ||
238 | minstalldir /opt/opera/lib/opera || die | ||
239 | minstallexec lib/opera/liboperagtk2.so /opt/opera/lib/opera/ || die | ||
240 | } | ||
241 | |||
242 | if [[ ${ENABLE_GTK3} -eq 1 ]] | ||
243 | then | ||
244 | src_install_opera-gtk3() | ||
245 | { | ||
246 | cd ${SRCDIR} | ||
247 | minstalldir /opt/opera/lib/opera || die | ||
248 | minstallexec lib/opera/liboperagtk3.so /opt/opera/lib/opera/ || die | ||
249 | } | ||
250 | fi | ||
251 | |||
252 | postinstall_opera() | ||
253 | { | ||
254 | if [[ ${ENABLE_KDE4} -ne 1 ]] | ||
255 | then | ||
256 | if [[ ! -z $(magequery -n opera-kde4) ]] | ||
257 | then | ||
258 | echo "Opera was packaged without KDE4 support but an old KDE4 package was found." | ||
259 | echo "Please uninstall 'net-www/opera-kde4' after this installation." | ||
260 | fi | ||
261 | fi | ||
262 | if [[ ${ENABLE_GTK3} -ne 1 ]] | ||
263 | then | ||
264 | if [[ ! -z $(magequery -n opera-gtk3) ]] | ||
265 | then | ||
266 | echo "Opera was packaged without GTK3 support but an old GTK3 package was found." | ||
267 | echo "Please uninstall 'net-www/opera-gtk3' after this installation." | ||
268 | fi | ||
269 | fi | ||
270 | } |