1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 MAJOR_VERSION=${PV%\.[0-9]}
12 DESCRIPTION="Scratchbox is a cross-compilation toolkit designed to make embedded Linux application development easier."
13 HOMEPAGE="http://www.scratchbox.org/"
14 SRC_URI="http://scratchbox.org/download/files/sbox-releases/stable/tarball/scratchbox-core-${PV}-i386.tar.gz
15 http://scratchbox.org/download/files/sbox-releases/stable/tarball/scratchbox-libs-${PV}-i386.tar.gz"
25 TARGET_DIR="/opt/scratchbox"
31 # doins doesn't work with symlinks, getting "file not found" with doins
32 cp -pRP ./* "${D}/${TARGET_DIR}"
33 dosym opt/scratchbox scratchbox
35 # scratchbox service loader
36 newinitd "${FILESDIR}/scratchbox.rc" scratchbox || die "newinitd failed"
38 # group already created
39 echo ${SBOX_GROUP} > "${D}/${TARGET_DIR}/.run_me_first_done"
43 einfo "Creating group sbox"
44 enewgroup "${SBOX_GROUP}"
49 elog "You need to run:"
50 elog "\"emerge --config =${CATEGORY}/${PF}\""
51 elog "to set permissions right and setup scratchbox and users"
53 elog "For further documentation about how to setup"
54 elog "scratchbox for your development needs have a look at"
55 elog "http://scratchbox.org/documentation/user/scratchbox-${MAJOR_VERSION}/"
57 elog "Also note that when you reboot you should run:"
58 elog "/etc/init.d/scratchbox start"
59 elog "before trying to run scratchbox."
60 elog "You can also add it to the default runlevel:"
61 elog "rc-update add scratchbox default"
63 elog "Type /opt/scratchbox/login to start scratchbox."
69 elog "To remove all traces of scratchbox you will need to remove the file"
70 elog "/etc/init.d/scratchbox. Don't forget to delete the sbox group."
75 if [ `id -u` != "0" ]; then
76 ewarn "Must be root to run this"
80 einfo "Do you want to configure scratchbox? [Yes/No]"
81 einfo "Note: This will set permissions and copy files from the system into the scratchbox"
86 "${TARGET_DIR}/sbin/sbox_configure" "no" ${SBOX_GROUP} || die "sbox_configure failed"
92 mkdir -p "${TARGET_DIR}/scratchbox/users"
95 einfo "Existing users:"
96 einfo $(ls "${TARGET_DIR}/users")
99 einfo "Create new user (leaf empty to skip): "
106 einfo "Note: users have to be in the '${SBOX_GROUP}' to be able to login into the scratchbox"
107 "${TARGET_DIR}/sbin/sbox_adduser" ${newuser} || die "sbox_adduser failed"
112 einfo "Configuration finished. Make sure you run '/etc/init.d/scratchbox start' before logging in."