Share the Knowledge!

Seeing a post near the bottom of http://forums.dropbox.com/topic.php?id=45949&replies=98&page=4#post-405748 hinted how to create a functioning dropbox ebuild. The problem seems to be that dropbox doesn’t like the system-wide rsync library, but the most current (as of Feb 26 2012) ebuild removes the local copy of it. So you just have to create an ebuild for your local overlay which does not remove the bundled rsync.

If you do not yet have a local overlay, see here (dead link). Copy (don’t move) dropbox-1.2.51.ebuild into your overlay as directed on the wiki. You can rename it if you want to use a newer version, so long as you keep the correct name pattern. Open the ebuild in a text editor and remove the line “net-libs/rsync” from RDEPEND, and the entry “librsync.so.1” from the line starting “rm -vf”.

For those who don’t want to make a mistake in editing, here are the commands to make the folder (assuming the local overlay has already been created as instructed) and the text of the modified ebuild to copy and paste, one line at a time.

sudo -s
mkdir -p /usr/local/portage/net-misc/dropbox/
cd /usr/local/portage/net-misc/dropbox/
nano dropbox-1.2.51.ebuild

Here you copy the file from below, then right click in the terminal window and paste the contents. Type Ctrl-O, then Ctrl-X.

ebuild dropbox-1.2.51.ebuild manifest
exit

It is possible that your system may not use the local ebuild over the main tree one, depending on what other overlays you have. If this is the case, you should be able to add “-r1” to the filename before the “.ebuild”.The modified ebuild’s text is below, and a link to download it is here. Note that the download must go into a temporary folder, and use “sudo mv” to place it in the right folder before manifesting.

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbox/dropbox-1.2.51.ebuild,v 1.6 2012/02/20 09:07:27 jlec Exp $

EAPI="4"

inherit gnome2-utils pax-utils

DESCRIPTION="Dropbox daemon (pretends to be GUI-less)"
HOMEPAGE="http://dropbox.com/"
SRC_URI="x86? ( http://dl-web.dropbox.com/u/17/dropbox-lnx.x86-${PV}.tar.gz )
	amd64? ( http://dl-web.dropbox.com/u/17/dropbox-lnx.x86_64-${PV}.tar.gz )"

LICENSE="CCPL-Attribution-NoDerivs-3.0 FTL MIT LGPL-2 openssl dropbox"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="mirror strip"

QA_DT_HASH="opt/${PN}/.*"
QA_EXECSTACK_x86="opt/dropbox/_ctypes.so"
QA_EXECSTACK_amd64="opt/dropbox/_ctypes.so"

DEPEND=""
# Be sure to have GLIBCXX_3.4.9, #393125
RDEPEND="
	app-arch/bzip2
	dev-libs/popt
	dev-libs/openssl:0.9.8
	media-libs/libpng:1.2
	net-misc/wget
	>=sys-devel/gcc-4.2.0
	sys-libs/zlib
"

src_unpack() {
	unpack ${A}
	mkdir -p "${S}"
	mv "${WORKDIR}/.dropbox-dist" "${S}"/src || die
	cd "${S}"/src
	rm -vf libstdc++.so.6 libz* libssl* libbz2* libpopt.so.0 libcrypto.so.0.9.8 libpng12.so.0 || die
	pax-mark cm "${S}/src/dropbox"
	cd "${WORKDIR}"
}

src_install() {
	cd src || die
	dodoc README ACKNOWLEDGEMENTS
	rm README ACKNOWLEDGEMENTS || die

	local targetdir="/opt/dropbox"
	insinto "${targetdir}"
	doins -r *
	fperms a+x "${targetdir}/dropbox"
	fperms a+x "${targetdir}/dropboxd"
	dosym "${targetdir}/dropboxd" "/opt/bin/dropbox"

	insinto /usr/share
	doins -r icons
}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	gnome2_icon_cache_update
}

pkg_postrm() {
	gnome2_icon_cache_update
}

Share the Knowledge!

  • Mauro Toffanin

    This guide is very outdated; dropbox is available through Portage with a simple:

    emerge -av dropbox