dev-util/android-sdk-update-manager/android-sdk-update-manager-20.ebuild
changeset 39 5eba823d9a03
equal deleted inserted replaced
38:c74c2c0273a0 39:5eba823d9a03
       
     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-17.ebuild,v 1.1 2012/03/24 09:29:59 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
       
    27 		amd64? ( app-emulation/emul-linux-x86-gtklibs )
       
    28 		x86? ( x11-libs/gtk+:2 )
       
    29 	)"
       
    30 
       
    31 ANDROID_SDK_DIR="/opt/${PN}"
       
    32 QA_DT_HASH_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_DT_HASH_amd64="${QA_DT_HASH_x86}"
       
    42 
       
    43 S="${WORKDIR}/android-sdk-linux"
       
    44 
       
    45 pkg_setup() {
       
    46 	enewgroup android
       
    47 }
       
    48 
       
    49 src_prepare(){
       
    50 #	epatch "${FILESDIR}/${PN}-8-swt.patch"
       
    51 
       
    52 	rm -rf tools/lib/x86*
       
    53 }
       
    54 
       
    55 src_install(){
       
    56 	dodoc tools/NOTICE.txt "SDK Readme.txt" || die
       
    57 	rm -f tools/NOTICE.txt "SDK Readme.txt"
       
    58 
       
    59 	dodir "${ANDROID_SDK_DIR}/tools"
       
    60 	cp -pPR tools/* "${ED}${ANDROID_SDK_DIR}/tools" || die "failed to install tools"
       
    61 
       
    62 	# Maybe this is needed for the tools directory too.
       
    63 	#keepdir "${ANDROID_SDK_DIR}"/{add-ons,docs,platforms,temp} || die "failed to keepdir"
       
    64 	dodir "${ANDROID_SDK_DIR}"/{add-ons,docs,platforms,temp} || die "failed to dodir"
       
    65 
       
    66 	fowners root:android "${ANDROID_SDK_DIR}"/{,add-ons,docs,platforms,temp,tools} || die
       
    67 	fperms 0775 "${ANDROID_SDK_DIR}"/{,add-ons,docs,platforms,temp,tools} || die
       
    68 
       
    69 	echo "PATH=\"${EPREFIX}${ANDROID_SDK_DIR}/tools:${EPREFIX}${ANDROID_SDK_DIR}/platform-tools\"" > "${T}/80${PN}" || die
       
    70 
       
    71 	SWT_PATH="/tmp"
       
    72 	if use X ; then
       
    73 		SWT_VERSIONS="3.7 3.6 3.5"
       
    74 		for version in $SWT_VERSIONS; do
       
    75 			# redirecting stderr to /dev/null
       
    76 			# not sure if this is best, but avoids misleading error messages
       
    77 			SWT_PATH="`dirname \`java-config -p swt-\$version 2>/dev/null\` 2>/dev/null`"
       
    78 			if [ $SWT_PATH ]; then
       
    79 				einfo "SWT_PATH=$SWT_PATH selecting version $version of SWT."
       
    80 				break
       
    81 			fi
       
    82 		done
       
    83 	fi
       
    84 
       
    85 	echo "ANDROID_SWT=\"${SWT_PATH}\"" >> "${T}/80${PN}" || die
       
    86 
       
    87 	doenvd "${T}/80${PN}" || die
       
    88 
       
    89 	echo "SEARCH_DIRS_MASK=\"${EPREFIX}${ANDROID_SDK_DIR}\"" > "${T}/80${PN}" || die
       
    90 
       
    91 	insinto "/etc/revdep-rebuild" && doins "${T}/80${PN}" || die
       
    92 
       
    93 }
       
    94 
       
    95 pkg_postinst() {
       
    96 	elog "The Android SDK now uses its own manager for the development	environment."
       
    97 	elog "Run 'android' to download the full SDK, including some of the platform tools."
       
    98 	elog "You must be in the android group to manage the development environment."
       
    99 	elog "Just run 'gpasswd -a <USER> android', then have <USER> re-login."
       
   100 	elog "See http://developer.android.com/sdk/adding-components.html for more"
       
   101 	elog "information."
       
   102 	elog "If you have problems downloading the SDK, see http://code.google.com/p/android/issues/detail?id=4406"
       
   103 	elog "You need to run env-update and source /etc/profile in any open shells"
       
   104 	elog "if you get an SWT error."
       
   105 	use X || ewarn "You specified -X use-flag, the programs emulator and ddms will not work."
       
   106 }