1 # Copyright 1999-2006 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/${MAJOR_VERSION}/tarball/scratchbox-core-${PV}.tar.gz
15 http://scratchbox.org/download/files/sbox-releases/${MAJOR_VERSION}/tarball/scratchbox-libs-${PV}.tar.gz"
25 TARGET_DIR="/opt/scratchbox"
27 S=${WORKDIR}/scratchbox
32 # doins doesn't work with symlinks, getting "file not found" with doins
33 cp -pRP ./* "${D}/${TARGET_DIR}"
34 dosym opt/scratchbox scratchbox
36 # scratchbox service loader
37 newinitd "${FILESDIR}/scratchbox.rc" scratchbox || die "newinitd failed"
39 # group already created
40 echo ${SBOX_GROUP} > "${D}/${TARGET_DIR}/.run_me_first_done"
44 einfo "Creating group sbox"
45 enewgroup "${SBOX_GROUP}" || die "adding group '${SBOX_GROUP}' failed"
50 elog "You need to run:"
51 elog "\"emerge --config =${CATEGORY}/${PF}\""
52 elog "to set permissions right and setup scratchbox and users"
54 elog "For further documentation about how to setup"
55 elog "scratchbox for your development needs have a look at"
56 elog "http://scratchbox.org/documentation/user/scratchbox-${MAJOR_VERSION}/"
58 elog "Also note that when you reboot you should run:"
59 elog "/etc/init.d/scratchbox start"
60 elog "before trying to run scratchbox."
61 elog "You can also add it to the default runlevel:"
62 elog "rc-update add scratchbox default"
64 elog "Type /opt/scratchbox/login to start scratchbox."
70 elog "To remove all traces of scratchbox you will need to remove the file"
71 elog "/etc/init.d/scratchbox. Don't forget to delete the sbox group."
76 if [ `id -u` != "0" ]; then
77 ewarn "Must be root to run this"
81 einfo "Do you want to configure scratchbox? [Yes/No]"
82 einfo "Note: This will set permissions and copy files from the system into the scratchbox"
87 "${TARGET_DIR}/sbin/sbox_configure" "no" ${SBOX_GROUP} || die "sbox_configure failed"
93 mkdir -p "${TARGET_DIR}/scratchbox/users"
96 einfo "Existing users:"
97 einfo $(ls "${TARGET_DIR}/users")
100 einfo "Create new user (leaf empty to skip): "
107 einfo "Note: users have to be in the '${SBOX_GROUP}' to be able to login into the scratchbox"
108 "${TARGET_DIR}/sbin/sbox_adduser" ${newuser} || die "sbox_adduser failed"
113 einfo "Configuration finished. Make sure you run '/etc/init.d/scratchbox start' before logging in."