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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Apr 25 15:31:27 2012 UTC (2 years, 8 months ago) by jer
Branch: MAIN
http://my.opera.com/desktopteam/blog/2012/04/25/12-beta-rc

(Portage version: 2.2.0_alpha101/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20