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

Contents of /www-client/opera/opera-12.01.1532.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Wed Sep 12 15:31:14 2012 UTC (8 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Old.

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

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/opera-12.01.1532.ebuild,v 1.5 2012/09/02 12:51:33 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)" # Major version, i.e. 11.00
17 O_B="$(get_version_component_range 3)" # Build version, i.e. 1156
18
19 O_D="${O_V/./}"
20 O_P="${PN}-${O_V}-${O_B}"
21 O_U="mirror://opera/"
22
23 SRC_URI="
24 amd64? ( ${O_U}linux/${O_D}/${O_P}.x86_64.linux.tar.xz )
25 x86? ( ${O_U}linux/${O_D}/${O_P}.i386.linux.tar.xz )
26 x86-fbsd? ( ${O_U}unix/${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 me mk ms nb nl nn pa pl pt pt-BR ro ru sk sr
32 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="${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_DT_HASH="${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 einfo "Keeping these locales (linguas): ${LINGUAS}."
103 for LINGUA in ${O_LINGUAS}; do
104 if ! use linguas_${LINGUA/-/_}; then
105 LINGUA=$(find "${LNGDIR}" -maxdepth 1 -type d -iname ${LINGUA/_/-})
106 rm -r "${LINGUA}" || die "The list of linguas needs to be fixed"
107 fi
108 done
109
110 # Remove doc directory but keep the LICENSE under another name (bug #315473)
111 mv share/doc/${PN}/LICENSE share/${PN}/defaults/license.txt
112 rm -rf share/doc
113 for locale in share/${PN}/locale/*; do
114 rm -f "${locale}/license.txt"
115 ln -sn /usr/share/${PN}/defaults/license.txt "${locale}/license.txt" \
116 || die
117 done
118
119 # Remove package directory
120 rm -rf share/${PN}/package
121
122 # Optional libraries
123 if ! use gtk; then
124 rm lib/${PN}/liboperagtk2.so || die
125 rm lib/${PN}/liboperagtk3.so || die
126 fi
127 if ! use kde; then
128 rm lib/${PN}/liboperakde4.so || die
129 fi
130 if ! use gstreamer; then
131 rm -r lib/${PN}/gstreamer || die
132 fi
133 if use amd64 && ! use multilib; then
134 rm lib/${PN}/pluginwrapper/operapluginwrapper-ia32-linux || die
135 fi
136
137 # Unzip the man pages before sedding
138 gunzip share/man/man1/* || die
139
140 local OPERA_SUFFIX= OPERA__SUFFIX= OPERAU_SUFFIX=
141 if [[ ${PN} = opera-next ]]; then
142 OPERA_SUFFIX="-next"
143 OPERA__SUFFIX=" Next"
144 OPERA_USUFFIX="-NEXT"
145 fi
146
147 # Replace PREFIX, SUFFIX and PN in various files
148 sed -i \
149 -e "s:@@{PREFIX}:/usr:g" \
150 -e "s:@@{SUFFIX}:${OPERA_SUFFIX}:g" \
151 -e "s:@@{_SUFFIX}:${OPERA__SUFFIX}:g" \
152 -e "s:@@{USUFFIX}:${OPERA_USUFFIX}:g" \
153 share/man/man1/* \
154 share/mime/packages/* \
155 share/applications/${PN}-*.desktop \
156 || die
157
158 # Create /usr/bin/opera wrapper
159 echo '#!/bin/sh' > ${PN}
160 echo 'export OPERA_DIR="/usr/share/'"${PN}"'"' >> ${PN}
161 echo 'export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-"${HOME}/.'${PN}'"}' \
162 >> ${PN}
163 echo 'exec '"${OPREFIX}/${PN}/${PN}"' "$@"' >> ${PN}
164
165 # Change libz.so.3 to libz.so.1 for gentoo/freebsd
166 if use elibc_FreeBSD; then
167 scanelf -qR -N libz.so.3 -F "#N" lib/${PN}/ | \
168 while read i; do
169 if [[ $(strings "$i" | fgrep -c libz.so.3) -ne 1 ]];
170 then
171 export SANITY_CHECK_LIBZ_FAILED=1
172 break
173 fi
174 sed -i \
175 "$i" \
176 -e 's/libz\.so\.3/libz.so.1/g'
177 done
178 [[ "$SANITY_CHECK_LIBZ_FAILED" = "1" ]] && die
179 fi
180 }
181
182 src_install() {
183 # We install into usr instead of opt as Opera does not support the latter
184 dodir /usr
185 mv lib/ "${D}/${OPREFIX}" || die
186 mv share/ "${D}/usr/" || die
187
188 # Install startup scripts
189 dobin ${PN}
190
191 # Stop revdep-rebuild from checking opera binaries
192 dodir /etc/revdep-rebuild
193 echo "SEARCH_DIRS_MASK=\"${OPREFIX}/${PN}\"" \
194 > "${D}"/etc/revdep-rebuild/90${PN}
195
196 # Set PaX markings for hardened/PaX (bug #344267)
197 pax-mark m $( list-paxables $( find "${D}"/${OPREFIX}/${PN}/ ) )
198 }
199
200 pkg_preinst() {
201 gnome2_icon_savelist
202 }
203
204 pkg_postinst() {
205 if use elibc_FreeBSD; then
206 elog
207 elog "To improve shared memory usage please set:"
208 elog "$ sysctl kern.ipc.shm_allow_removed=1"
209 fi
210
211 # Update desktop file database and gtk icon cache (bug #334993)
212 gnome2_icon_cache_update
213 fdo-mime_desktop_database_update
214 }
215
216 pkg_postrm() {
217 # Update desktop file database and gtk icon cache (bug #334993)
218 gnome2_icon_cache_update
219 fdo-mime_desktop_database_update
220 }

  ViewVC Help
Powered by ViewVC 1.1.13