1 |
|
# Copyright 1999-2021 Gentoo Authors
|
|
1 |
# Copyright 1999-2020 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=7
|
5 |
|
inherit autotools bash-completion-r1
|
|
5 |
inherit autotools bash-completion-r1 git-r3
|
6 |
6 |
|
7 |
7 |
DESCRIPTION="A fast unix command line interface to WWW"
|
8 |
|
HOMEPAGE="https://gitlab.com/surfraw/Surfraw"
|
9 |
|
SRC_URI="https://gitlab.com/surfraw/Surfraw/-/archive/${P}/${PN^}-${P}.tar.bz2"
|
10 |
|
SLOT="0"
|
11 |
8 |
LICENSE="public-domain"
|
12 |
|
KEYWORDS="amd64 ~hppa ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
|
9 |
HOMEPAGE="
|
|
10 |
https://gitlab.com/surfraw/Surfraw
|
|
11 |
"
|
|
12 |
EGIT_REPO_URI="https://gitlab.com/surfraw/Surfraw.git"
|
|
13 |
|
|
14 |
SLOT="0"
|
|
15 |
KEYWORDS=""
|
|
16 |
RESTRICT="test"
|
13 |
17 |
|
14 |
18 |
RDEPEND="
|
15 |
19 |
dev-lang/perl
|
16 |
20 |
"
|
17 |
|
RESTRICT="test"
|
18 |
21 |
DOCS=(
|
19 |
22 |
AUTHORS ChangeLog HACKING NEWS README TODO
|
20 |
23 |
)
|
21 |
24 |
PATCHES=(
|
22 |
25 |
"${FILESDIR}"/${PN}-2.3.0-completion.patch
|
|
26 |
"${FILESDIR}"/${PN}-99999-sr-completion-path.patch
|
23 |
27 |
)
|
24 |
|
S=${WORKDIR}/${PN^}-${P}
|
25 |
28 |
|
26 |
29 |
src_prepare() {
|
27 |
30 |
default
|
... | ... | |
54 |
57 |
docinto examples
|
55 |
58 |
dodoc examples/README examples/uzbl_load_url_from_surfraw
|
56 |
59 |
}
|
57 |
|
|
58 |
|
pkg_preinst() {
|
59 |
|
has_version "=${CATEGORY}/${PN}-1.0.7"
|
60 |
|
upgrade_from_1_0_7=$?
|
61 |
|
}
|
62 |
|
|
63 |
|
pkg_postinst() {
|
64 |
|
local moves f
|
65 |
|
|
66 |
|
einfo
|
67 |
|
einfo "You can get a list of installed elvi by just typing 'surfraw' or"
|
68 |
|
einfo "the abbreviated 'sr'."
|
69 |
|
einfo
|
70 |
|
einfo "You can try some searches, for example:"
|
71 |
|
einfo "$ sr ask why is jeeves gay? "
|
72 |
|
einfo "$ sr google -results=100 RMS, GNU, which is sinner, which is sin?"
|
73 |
|
einfo "$ sr rhyme -method=perfect Julian"
|
74 |
|
einfo
|
75 |
|
einfo "The system configuration file is /etc/surfraw.conf"
|
76 |
|
einfo
|
77 |
|
einfo "Users can specify preferences in '~/.surfraw.conf' e.g."
|
78 |
|
einfo "SURFRAW_graphical_browser=mozilla"
|
79 |
|
einfo "SURFRAW_text_browser=w3m"
|
80 |
|
einfo "SURFRAW_graphical=no"
|
81 |
|
einfo
|
82 |
|
einfo "surfraw works with any graphical and/or text WWW browser"
|
83 |
|
einfo
|
84 |
|
if [[ $upgrade_from_1_0_7 = 0 ]] ; then
|
85 |
|
ewarn "surfraw usage has changed slightly since version 1.0.7, elvi are now called"
|
86 |
|
ewarn "using the 'sr' wrapper script as described above. If you wish to return to"
|
87 |
|
ewarn "the old behaviour you can add /usr/share/surfraw to your \$PATH"
|
88 |
|
fi
|
89 |
|
# This file was always autogenerated, and is no longer needed.
|
90 |
|
if [ -f "${EROOT}"/etc/surfraw_elvi.list ]; then
|
91 |
|
rm -f "${EROOT}"/etc/surfraw_elvi.list
|
92 |
|
fi
|
93 |
|
|
94 |
|
# Config file location changes in v2.2.6
|
95 |
|
for f in /etc/surfraw.{bookmarks,conf}; do
|
96 |
|
if [ -f "${EROOT}"${f} ]; then
|
97 |
|
ewarn "${f} has moved to /etc/xdg/config/surfraw/${f##*.} in v2.2.6."
|
98 |
|
moves=1
|
99 |
|
fi
|
100 |
|
done
|
101 |
|
if [ "${moves}" == 1 ]; then
|
102 |
|
ewarn "You must manually move, and update, the config files listed"
|
103 |
|
ewarn "above for surfraw v2.2.6 and above to use them."
|
104 |
|
fi
|
105 |
|
}
|