dev-util/android-sdk-update-manager/android-sdk-update-manager-21-r1.ebuild
changeset 59 9ed25873d854
equal deleted inserted replaced
58:98cddfca5dd0 59:9ed25873d854
       
     1 # Copyright 1999-2012 Gentoo Foundation
       
     2 # Distributed under the terms of the GNU General Public License v2
       
     3 # $Header: /var/cvsroot/gentoo-x86/dev-util/android-sdk-update-manager/android-sdk-update-manager-21.ebuild,v 1.1 2012/11/14 01:37:47 rich0 Exp $
       
     4 
       
     5 EAPI="3"
       
     6 
       
     7 inherit eutils user
       
     8 
       
     9 MY_P="android-sdk_r${PV}-linux"
       
    10 
       
    11 DESCRIPTION="Open Handset Alliance's Android SDK"
       
    12 HOMEPAGE="http://developer.android.com"
       
    13 SRC_URI="http://dl.google.com/android/${MY_P}.tgz"
       
    14 IUSE="+X"
       
    15 RESTRICT="mirror"
       
    16 
       
    17 LICENSE="android"
       
    18 SLOT="0"
       
    19 KEYWORDS="~amd64 ~x86"
       
    20 
       
    21 DEPEND="app-arch/tar
       
    22 		app-arch/gzip"
       
    23 RDEPEND=">=virtual/jdk-1.5
       
    24 	>=dev-java/ant-core-1.6.5
       
    25 	X? (
       
    26 		>=dev-java/swt-3.5[cairo]
       
    27 		amd64? ( app-emulation/emul-linux-x86-gtklibs )
       
    28 		x86? ( x11-libs/gtk+:2 )
       
    29 	)"
       
    30 
       
    31 ANDROID_SDK_DIR="/opt/${PN}"
       
    32 QA_FLAGS_IGNORED_x86="
       
    33 	${ANDROID_SDK_DIR/\/}/tools/emulator
       
    34 	${ANDROID_SDK_DIR/\/}/tools/adb
       
    35 	${ANDROID_SDK_DIR/\/}/tools/mksdcard
       
    36 	${ANDROID_SDK_DIR/\/}/tools/sqlite3
       
    37 	${ANDROID_SDK_DIR/\/}/tools/hprof-conv
       
    38 	${ANDROID_SDK_DIR/\/}/tools/zipalign
       
    39 	${ANDROID_SDK_DIR/\/}/tools/dmtracedump
       
    40 "
       
    41 QA_FLAGS_IGNORED_amd64="${QA_FLAGS_IGNORED_x86}"
       
    42 
       
    43 S="${WORKDIR}/android-sdk-linux"
       
    44 
       
    45 pkg_setup() {
       
    46 	enewgroup android
       
    47 }
       
    48 
       
    49 src_prepare(){
       
    50 	rm -rf tools/lib/x86*
       
    51 }
       
    52 
       
    53 src_install(){
       
    54 	dodoc tools/NOTICE.txt "SDK Readme.txt" || die
       
    55 	rm -f tools/NOTICE.txt "SDK Readme.txt"
       
    56 
       
    57 	dodir "${ANDROID_SDK_DIR}/tools"
       
    58 	cp -pPR tools/* "${ED}${ANDROID_SDK_DIR}/tools" || die "failed to install tools"
       
    59 
       
    60 	# Maybe this is needed for the tools directory too.
       
    61 	dodir "${ANDROID_SDK_DIR}"/{add-ons,docs,platforms,temp} || die "failed to dodir"
       
    62 
       
    63 	fowners root:android "${ANDROID_SDK_DIR}"/{,add-ons,docs,platforms,temp,tools} || die
       
    64 	fperms 0775 "${ANDROID_SDK_DIR}"/{,add-ons,docs,platforms,temp,tools} || die
       
    65 
       
    66 	echo "PATH=\"${EPREFIX}${ANDROID_SDK_DIR}/tools:${EPREFIX}${ANDROID_SDK_DIR}/platform-tools\"" > "${T}/80${PN}" || die
       
    67 
       
    68 	SWT_PATH=
       
    69 	if use X ; then
       
    70 		SWT_VERSIONS="4.2 3.7 3.6 3.5"
       
    71 		for version in $SWT_VERSIONS; do
       
    72 			# redirecting stderr to /dev/null
       
    73 			# not sure if this is best, but avoids misleading error messages
       
    74 			SWT_PATH="`dirname \`java-config -p swt-\$version 2>/dev/null\` 2>/dev/null`"
       
    75 			if [ $SWT_PATH ]; then
       
    76 				einfo "SWT_PATH=$SWT_PATH selecting version $version of SWT."
       
    77 				break
       
    78 			fi
       
    79 		done
       
    80 	fi
       
    81 
       
    82 	echo "ANDROID_SWT=\"${SWT_PATH}\"" >> "${T}/80${PN}" || die
       
    83 
       
    84 	doenvd "${T}/80${PN}" || die
       
    85 
       
    86 	echo "SEARCH_DIRS_MASK=\"${EPREFIX}${ANDROID_SDK_DIR}\"" > "${T}/80${PN}" || die
       
    87 
       
    88 	insinto "/etc/revdep-rebuild" && doins "${T}/80${PN}" || die
       
    89 
       
    90 }
       
    91 
       
    92 pkg_postinst() {
       
    93 	elog "The Android SDK now uses its own manager for the development	environment."
       
    94 	elog "Run 'android' to download the full SDK, including some of the platform tools."
       
    95 	elog "You must be in the android group to manage the development environment."
       
    96 	elog "Just run 'gpasswd -a <USER> android', then have <USER> re-login."
       
    97 	elog "See http://developer.android.com/sdk/adding-components.html for more"
       
    98 	elog "information."
       
    99 	elog "If you have problems downloading the SDK, see http://code.google.com/p/android/issues/detail?id=4406"
       
   100 	elog "You need to run env-update and source /etc/profile in any open shells"
       
   101 	elog "if you get an SWT error."
       
   102 	use X || ewarn "You specified -X use-flag, the programs emulator and ddms will not work."
       
   103 }