ba29db204a63dd708b2e5045f5bc8d87f55fab0f
[gentoo.git] / gnome-extra / nautilus-dropbox / nautilus-dropbox-1.6.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 GNOME2_LA_PUNT="yes"
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit autotools eutils python-r1 linux-info gnome2 readme.gentoo user
10
11 DESCRIPTION="Store, Sync and Share Files Online"
12 HOMEPAGE="https://www.dropbox.com"
13 SRC_URI="https://www.dropbox.com/download?dl=packages/${P}.tar.bz2"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
18 IUSE="debug"
19
20 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
21
22 RDEPEND="${PYTHON_DEPS}
23         gnome-base/nautilus
24         dev-libs/glib:2
25         dev-python/pygtk:2[${PYTHON_USEDEP}]
26         net-misc/dropbox
27         x11-libs/gtk+:2
28         x11-libs/libnotify
29         x11-libs/libXinerama"
30
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33         dev-python/docutils[${PYTHON_USEDEP}]"
34
35 CONFIG_CHECK="~INOTIFY_USER"
36
37 pkg_setup () {
38         check_extra_config
39         enewgroup dropbox
40
41         DOC_CONTENTS="Add any users who wish to have access to the dropbox nautilus
42                 plugin to the group 'dropbox'. You need to setup a drobox account
43                 before using this plugin. Visit ${HOMEPAGE} for more information."
44
45         python_setup
46 }
47
48 src_prepare() {
49         G2CONF="${G2CONF} $(use_enable debug) --disable-static"
50
51         gnome2_src_prepare
52
53         # use sysem dropbox
54         sed \
55                 -e "s|~/[.]dropbox-dist|${EPREFIX}/opt/dropbox|" \
56                 -e "s|\(DROPBOXD_PATH = \).*|\1\"${EPREFIX}/opt/dropbox/dropboxd\"|" \
57                 -i dropbox.in || die
58         # us system rst2man
59         epatch "${FILESDIR}"/${PN}-0.7.0-system-rst2man.patch
60         sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.in || die
61         AT_NOELIBTOOLIZE=yes eautoreconf
62 }
63
64 src_install () {
65         gnome2_src_install
66
67         local extensiondir="$(pkg-config --variable=extensiondir libnautilus-extension)"
68         [ -z ${extensiondir} ] && die "pkg-config unable to get nautilus extensions dir"
69
70         # Strip $EPREFIX from $extensiondir as fowners/fperms act on $ED not $D
71         extensiondir="${extensiondir#${EPREFIX}}"
72
73         use prefix || fowners root:dropbox "${extensiondir}"/libnautilus-dropbox.so
74         fperms o-rwx "${extensiondir}"/libnautilus-dropbox.so
75
76         readme.gentoo_create_doc
77
78         python_replicate_script "${ED}"/usr/bin/dropbox
79 }
80
81 pkg_postinst () {
82         gnome2_pkg_postinst
83         readme.gentoo_print_elog
84 }