dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / www-client / surfraw / surfraw-2.3.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools bash-completion-r1
6
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 LICENSE="public-domain"
12 KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
13
14 RDEPEND="
15         dev-lang/perl
16 "
17 RESTRICT="test"
18 DOCS=(
19         AUTHORS ChangeLog HACKING NEWS README TODO
20 )
21 PATCHES=(
22         "${FILESDIR}"/${PN}-2.3.0-completion.patch
23 )
24 S=${WORKDIR}/${PN^}-${P}
25
26 src_prepare() {
27         default
28         eautoreconf
29 }
30
31 src_configure() {
32         econf --with-elvidir='$(datadir)'/surfraw
33 }
34
35 src_install() {
36         default
37
38         newbashcomp surfraw-bash-completion ${PN}
39         bashcomp_alias ${PN} sr
40
41         docinto examples
42         dodoc examples/README examples/uzbl_load_url_from_surfraw
43 }
44
45 pkg_preinst() {
46         has_version "=${CATEGORY}/${PN}-1.0.7"
47         upgrade_from_1_0_7=$?
48 }
49
50 pkg_postinst() {
51         local moves f
52
53         einfo
54         einfo "You can get a list of installed elvi by just typing 'surfraw' or"
55         einfo "the abbreviated 'sr'."
56         einfo
57         einfo "You can try some searches, for example:"
58         einfo "$ sr ask why is jeeves gay? "
59         einfo "$ sr google -results=100 RMS, GNU, which is sinner, which is sin?"
60         einfo "$ sr rhyme -method=perfect Julian"
61         einfo
62         einfo "The system configuration file is /etc/surfraw.conf"
63         einfo
64         einfo "Users can specify preferences in '~/.surfraw.conf'  e.g."
65         einfo "SURFRAW_graphical_browser=mozilla"
66         einfo "SURFRAW_text_browser=w3m"
67         einfo "SURFRAW_graphical=no"
68         einfo
69         einfo "surfraw works with any graphical and/or text WWW browser"
70         einfo
71         if [[ $upgrade_from_1_0_7 = 0 ]] ; then
72                 ewarn "surfraw usage has changed slightly since version 1.0.7, elvi are now called"
73                 ewarn "using the 'sr' wrapper script as described above.  If you wish to return to"
74                 ewarn "the old behaviour you can add /usr/share/surfraw to your \$PATH"
75         fi
76         # This file was always autogenerated, and is no longer needed.
77         if [ -f "${EROOT}"/etc/surfraw_elvi.list ]; then
78                 rm -f "${EROOT}"/etc/surfraw_elvi.list
79         fi
80
81         # Config file location changes in v2.2.6
82         for f in /etc/surfraw.{bookmarks,conf}; do
83                 if [ -f "${EROOT}"${f} ]; then
84                         ewarn "${f} has moved to /etc/xdg/config/surfraw/${f##*.} in v2.2.6."
85                         moves=1
86                 fi
87         done
88         if [ "${moves}" == 1 ]; then
89                 ewarn "You must manually move, and update, the config files listed"
90                 ewarn "above for surfraw v2.2.6 and above to use them."
91         fi
92 }