/[gentoo-x86]/www-client/opera-next/opera-next-12.11.1657.ebuild
Gentoo

Contents of /www-client/opera-next/opera-next-12.11.1657.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Nov 13 16:50:13 2012 UTC (21 months, 1 week ago) by jer
Branch: MAIN
Changes since 1.1: +3 -3 lines
Explain version/build slightly better.

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key A792A613)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/opera-next/opera-next-12.11.1657.ebuild,v 1.1 2012/11/13 16:48:06 jer Exp $
4
5 EAPI=4
6 inherit eutils fdo-mime gnome2-utils multilib pax-utils versionator
7
8 DESCRIPTION="A fast and secure web browser and Internet suite"
9 HOMEPAGE="http://www.opera.com/"
10
11 SLOT="0"
12 LICENSE="OPERA-12 LGPL-2 LGPL-3"
13 KEYWORDS="~amd64 ~x86 ~x86-fbsd"
14 IUSE="elibc_FreeBSD gtk kde +gstreamer multilib"
15
16 O_V="$(get_version_component_range 1-2)" # Version, i.e. 11.00
17 O_B="$(get_version_component_range 3)" # Build number, i.e. 1156
18
19 O_D="imperialentanglement_${O_V}-${O_B}"
20 O_P="${PN}-${O_V}-${O_B}"
21 O_U="http://snapshot.opera.com/unix/"
22
23 SRC_URI="
24 amd64? ( ${O_U}${O_D}/${O_P}.x86_64.linux.tar.xz )
25 x86? ( ${O_U}${O_D}/${O_P}.i386.linux.tar.xz )
26 x86-fbsd? ( ${O_U}${O_D}/${O_P}.i386.freebsd.tar.xz )
27 "
28
29 O_LINGUAS="
30 af ar az be bg bn cs da de el en-GB es-ES es-LA et fa fi fr fr-CA fy gd he
31 hi hr hu id it ja ka kk ko lt lv me mk ms nb nl nn pa pl pt pt-BR ro ru sk
32 sr sv sw ta te th tl tr uk ur uz vi zh-CN zh-TW zu
33 "
34
35 for O_LINGUA in ${O_LINGUAS}; do
36 IUSE+=" linguas_${O_LINGUA/-/_}"
37 done
38
39 DEPEND="
40 >=sys-apps/sed-4
41 app-arch/xz-utils
42 "
43 GTKRDEPEND="
44 dev-libs/atk
45 dev-libs/glib:2
46 x11-libs/cairo
47 x11-libs/gdk-pixbuf
48 gtk? ( || ( x11-libs/gtk+:3 x11-libs/gtk+:2 ) )
49 x11-libs/pango
50 x11-libs/pixman
51 "
52 KDERDEPEND="
53 kde-base/kdelibs
54 x11-libs/qt-core:4
55 x11-libs/qt-gui:4
56 "
57 GSTRDEPEND="
58 dev-libs/glib:2
59 dev-libs/libxml2
60 media-libs/gst-plugins-base
61 media-libs/gstreamer
62 media-plugins/gst-plugins-meta
63 "
64 RDEPEND="
65 media-libs/fontconfig
66 media-libs/freetype
67 sys-apps/util-linux
68 sys-libs/zlib
69 virtual/opengl
70 x11-libs/libICE
71 x11-libs/libSM
72 x11-libs/libX11
73 x11-libs/libXext
74 x11-libs/libXft
75 x11-libs/libXrender
76 x11-libs/libXt
77 gtk? ( ${GTKRDEPEND} )
78 kde? ( ${KDERDEPEND} )
79 gstreamer? ( ${GSTRDEPEND} )
80 "
81 src_unpack() {
82 unpack ${A}
83 mv -v ${PN}* "${S}" || die
84 }
85
86 src_prepare() {
87 export OPREFIX="/usr/$(get_libdir)"
88 export QA_PREBUILT="${OPREFIX}/${PN}/.*"
89 export QA_PRESTRIPPED="${OPREFIX}/${PN}/.*"
90
91 local LNGDIR="share/${PN}/locale"
92
93 # Count linguas
94 count() { echo ${#}; }
95 local lingua_count=$(count ${O_LINGUAS} en)
96 local locale_count=$(count ${LNGDIR}/*)
97 [[ ${lingua_count} = ${locale_count} ]] \
98 || die "Number of LINGUAS does not match number of locales"
99 unset count
100
101 # Remove unwanted linguas
102 for LINGUA in ${O_LINGUAS}; do
103 if ! use linguas_${LINGUA/-/_}; then
104 LINGUA=$(find "${LNGDIR}" -maxdepth 1 -type d -iname ${LINGUA/_/-})
105 rm -r "${LINGUA}" || die "The list of linguas needs to be fixed"
106 fi
107 done
108
109 # Remove doc directory but keep the LICENSE under another name (bug #315473)
110 mv share/doc/${PN}/LICENSE share/${PN}/defaults/license.txt
111 rm -rf share/doc
112 for locale in share/${PN}/locale/*; do
113 rm -f "${locale}/license.txt"
114 ln -sn /usr/share/${PN}/defaults/license.txt "${locale}/license.txt" \
115 || die
116 done
117
118 # Remove package directory
119 rm -rf share/${PN}/package
120
121 # Optional libraries
122 if ! use gtk; then
123 rm lib/${PN}/liboperagtk2.so || die
124 rm lib/${PN}/liboperagtk3.so || die
125 fi
126 if ! use kde; then
127 rm lib/${PN}/liboperakde4.so || die
128 fi
129 if ! use gstreamer; then
130 rm -r lib/${PN}/gstreamer || die
131 fi
132 if use amd64 && ! use multilib; then
133 rm lib/${PN}/pluginwrapper/operapluginwrapper-ia32-linux || die
134 fi
135
136 # Unzip the man pages before sedding
137 gunzip share/man/man1/* || die
138
139 local OPERA_SUFFIX= OPERA__SUFFIX= OPERAU_SUFFIX=
140 if [[ ${PN} = opera-next ]]; then
141 OPERA_SUFFIX="-next"
142 OPERA__SUFFIX=" Next"
143 OPERA_USUFFIX="-NEXT"
144 fi
145
146 # Replace PREFIX, SUFFIX and PN in various files
147 sed -i \
148 -e "s:@@{PREFIX}:/usr:g" \
149 -e "s:@@{SUFFIX}:${OPERA_SUFFIX}:g" \
150 -e "s:@@{_SUFFIX}:${OPERA__SUFFIX}:g" \
151 -e "s:@@{USUFFIX}:${OPERA_USUFFIX}:g" \
152 share/man/man1/* \
153 share/mime/packages/* \
154 share/applications/${PN}-*.desktop \
155 || die
156
157 # Create /usr/bin/opera wrapper
158 echo '#!/bin/sh' > ${PN}
159 echo 'export OPERA_DIR="/usr/share/'"${PN}"'"' >> ${PN}
160 echo 'export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-"${HOME}/.'${PN}'"}' \
161 >> ${PN}
162 echo 'exec '"${OPREFIX}/${PN}/${PN}"' "$@"' >> ${PN}
163
164 # Change libz.so.3 to libz.so.1 for gentoo/freebsd
165 if use elibc_FreeBSD; then
166 scanelf -qR -N libz.so.3 -F "#N" lib/${PN}/ | \
167 while read i; do
168 if [[ $(strings "$i" | fgrep -c libz.so.3) -ne 1 ]];
169 then
170 export SANITY_CHECK_LIBZ_FAILED=1
171 break
172 fi
173 sed -i \
174 "$i" \
175 -e 's/libz\.so\.3/libz.so.1/g'
176 done
177 [[ "$SANITY_CHECK_LIBZ_FAILED" = "1" ]] && die
178 fi
179 }
180
181 src_install() {
182 # We install into usr instead of opt as Opera does not support the latter
183 dodir /usr
184 mv lib/ "${D}/${OPREFIX}" || die
185 mv share/ "${D}/usr/" || die
186
187 # Install startup scripts
188 dobin ${PN}
189
190 # Stop revdep-rebuild from checking opera binaries
191 dodir /etc/revdep-rebuild
192 echo "SEARCH_DIRS_MASK=\"${OPREFIX}/${PN}\"" \
193 > "${D}"/etc/revdep-rebuild/90${PN}
194
195 # Set PaX markings for hardened/PaX (bug #344267)
196 pax-mark m $( list-paxables $( find "${D}"/${OPREFIX}/${PN}/ ) )
197 }
198
199 pkg_preinst() {
200 gnome2_icon_savelist
201 }
202
203 pkg_postinst() {
204 if use elibc_FreeBSD; then
205 elog
206 elog "To improve shared memory usage please set:"
207 elog "$ sysctl kern.ipc.shm_allow_removed=1"
208 fi
209
210 # Update desktop file database and gtk icon cache (bug #334993)
211 gnome2_icon_cache_update
212 fdo-mime_desktop_database_update
213 }
214
215 pkg_postrm() {
216 # Update desktop file database and gtk icon cache (bug #334993)
217 gnome2_icon_cache_update
218 fdo-mime_desktop_database_update
219 }

  ViewVC Help
Powered by ViewVC 1.1.20