source: net-misc/plowshare/plowshare-99999999.ebuild @ 614fd62

Revision 614fd62, 2.8 KB checked in by Mario Fetka <mario.fetka@…>, 7 years ago (diff)

redigest and add

  • Property mode set to 100644
Line 
1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5EAPI="2"
6
7inherit bash-completion-r1 git-2
8
9DESCRIPTION="Command-line downloader and uploader for file-sharing websites"
10HOMEPAGE="http://code.google.com/p/plowshare/"
11EGIT_REPO_URI="https://code.google.com/p/${PN}/"
12
13LICENSE="GPL-3"
14SLOT="0"
15KEYWORDS="~amd64 ~arm ~ppc ~x86"
16IUSE="bash-completion +javascript +perl scripts view-captcha"
17
18RDEPEND="
19        javascript? ( dev-lang/spidermonkey )
20        perl? ( dev-lang/perl
21                media-gfx/imagemagick[perl] )
22        view-captcha? ( || ( media-gfx/aview media-libs/libcaca ) )
23        app-shells/bash
24        || ( app-text/recode ( dev-lang/perl dev-perl/HTML-Parser ) )
25        app-text/tesseract[tiff]
26        || ( media-gfx/imagemagick[tiff] media-gfx/graphicsmagick[imagemagick,tiff] )
27        net-misc/curl
28        sys-apps/util-linux"
29DEPEND=""
30
31# NOTES:
32# spidermonkey dep should be any javascript interpreter using /usr/bin/js
33
34# TODO:
35# dev-java/rhino could probably be an alternative for spidermonkey
36
37src_prepare() {
38        if ! use javascript; then
39                sed -i -e 's:^mediafire.*::' \
40                        -e 's:^badongo.*::' \
41                        -e 's:^dataport_cz.*::' \
42                        -e 's:^1fichier.*::' \
43                        -e 's:^turbobit.*::' \
44                        src/modules/config || die "sed failed"
45                rm src/modules/{mediafire,badongo,dataport_cz,1fichier,turbobit}.sh || die "rm failed"
46        fi
47        if ! use perl; then
48                sed -i -e 's:^netload_in.*::' \
49                        -e 's:^badongo.*::' \
50                        src/modules/config || die "sed failed"
51                rm src/modules/netload_in.sh || die "rm failed"
52                if use javascript; then
53                        rm src/modules/badongo.sh || die "rm failed"
54                fi
55
56                # Don't install perl file helpers.
57                sed -i -e 's:\(.*src/core.sh\).*:\1:' Makefile || die "sed failed"
58        fi
59
60        # Don't let 'make install' install docs.
61        sed -i -e "/INSTALL.*DOCDIR/d" Makefile || die "sed failed"
62
63        if use bash-completion; then
64                sed -i -e \
65                        's:CDIR=/usr/local/share/plowshare/modules/config:CDIR=/usr/share/plowshare/modules/config:' \
66                        etc/plowshare.completion || die "sed failed"
67        fi
68}
69
70src_compile() {
71        # There is a Makefile but it's not compiling anything, let's not try.
72        :
73}
74
75src_test() {
76        # Disable tests because all of them need a working Internet connection.
77        :
78}
79
80src_install() {
81        DESTDIR="${D}" PREFIX="/usr" emake install || die "emake install failed"
82
83        dodoc AUTHORS CHANGELOG README || die "dodoc failed"
84
85        if use scripts; then
86                exeinto /usr/bin/
87                doexe ${S}/contrib/plowdown_{add_remote_loop,loop,parallel}.sh \
88                        || die "doins failed"
89        fi
90
91        if use bash-completion; then
92                newbashcomp etc/${PN}.completion ${PN} || die "newbashcomp failed"
93        fi
94}
95
96pkg_postinst() {
97        if ! use javascript; then
98                ewarn "Without javascript you will not be able to use:"
99                ewarn " mediafire, badongo, dataport_cz, 1fichier and turbobit."
100        fi
101        if ! use perl; then
102                ewarn "Without perl you will not be able to use:"
103                ewarn " netload.in and badongo."
104        fi
105}
Note: See TracBrowser for help on using the repository browser.