Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/surfraw/files/, www-client/surfraw/
Date: Mon, 05 Feb 2018 20:48:13
Message-Id: 1517863688.90495f87e0831ee83b4da2634d03618a099fe5ac.jer@gentoo
1 commit: 90495f87e0831ee83b4da2634d03618a099fe5ac
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 5 20:47:51 2018 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 5 20:48:08 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90495f87
7
8 www-client/surfraw: Version 2.3.0.
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 www-client/surfraw/Manifest | 1 +
13 .../surfraw/files/surfraw-2.3.0-completion.patch | 43 +++++++++++
14 www-client/surfraw/surfraw-2.3.0.ebuild | 87 ++++++++++++++++++++++
15 3 files changed, 131 insertions(+)
16
17 diff --git a/www-client/surfraw/Manifest b/www-client/surfraw/Manifest
18 index 792ef3f87f8..ee68fecec4b 100644
19 --- a/www-client/surfraw/Manifest
20 +++ b/www-client/surfraw/Manifest
21 @@ -1 +1,2 @@
22 DIST surfraw-2.2.9.tar.gz 200042 BLAKE2B c360da9826b6473a1159e67a19e9e12eaf4697b5be4373088169eb6ee1b85f126854f8594c5de8fd0517b7020947be42a5678d1ed7bd798f0925c53a68728c15 SHA512 81ddfc5300f5f052e09187144f39c0e1f0d6a0df9ad82d4457b60498278061ac6736a8236bd2b3516f6ad885d22c8616372b354f11b2dbb46ef4f3790456f016
23 +DIST surfraw-2.3.0.tar.gz 205557 BLAKE2B 35ca2b46f14fc123fd014682a413c6f22e8c9f05d85e8e76660e099536fda8648446757d467afbe8807c91ec1628c568854ebfda48953e9499a018c30f2bc5ee SHA512 51cdfb68bab701bce635a64ab3d5af669b2330c895180d01cca1c6f3c4005972ba4c573b693df59a2cc4fdb97d4fd11224bae500bbd4a17c3ab446de5241c9a0
24
25 diff --git a/www-client/surfraw/files/surfraw-2.3.0-completion.patch b/www-client/surfraw/files/surfraw-2.3.0-completion.patch
26 new file mode 100644
27 index 00000000000..1f86ec55f01
28 --- /dev/null
29 +++ b/www-client/surfraw/files/surfraw-2.3.0-completion.patch
30 @@ -0,0 +1,43 @@
31 +--- a/surfraw-bash-completion.IN
32 ++++ b/surfraw-bash-completion.IN
33 +@@ -4,6 +4,23 @@
34 + # installing the bash-completion package which sets this explicitly.
35 + shopt -s extglob
36 +
37 ++_srpkgname()
38 ++{
39 ++ local pd
40 ++ local dir=$(sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \
41 ++ /etc/make.{conf,globals})/*
42 ++ local cur="$1"
43 ++
44 ++ COMPREPLY=($(compgen -W "$(
45 ++ for pd in $dir
46 ++ do
47 ++ [ ! -d ${pd} ] && continue
48 ++ builtin cd ${pd}
49 ++ echo *
50 ++ done)" -- ${cur})
51 ++ )
52 ++}
53 ++
54 + _surfraw()
55 + { COMPREPLY=()
56 + local cur=${COMP_WORDS[COMP_CWORD]}
57 +@@ -20,7 +37,7 @@
58 + then COMPREPLY=( $( compgen -W "$elvi" -- $cur ) )
59 + # "sr go<tab>" for google
60 + elif [[ $prev == @(alioth|deb@(bugs|contents|packages|pts|sec)|freshmeat|fsfdir|sourceforge) ]]
61 +- then COMPREPLY=( $(apt-cache --generate pkgnames $cur) )
62 ++ then _srpkgname ${cur}
63 + # "sr debbugs 4<tab>" to check 44bsd-rdist bugs...
64 + elif [[ -x /usr/bin/look ]] # in bsdmainutils, "important"
65 + then COMPREPLY=( $(/usr/bin/look ${cur:-''}) )
66 +@@ -29,5 +46,5 @@
67 + fi
68 + return 0
69 + }
70 +-# test first in case removed-but-unpurged
71 +-type -p surfraw >/dev/null 2>&1 && complete -F _surfraw surfraw sr
72 ++
73 ++complete -F _surfraw surfraw sr
74
75 diff --git a/www-client/surfraw/surfraw-2.3.0.ebuild b/www-client/surfraw/surfraw-2.3.0.ebuild
76 new file mode 100644
77 index 00000000000..cea13e94ecb
78 --- /dev/null
79 +++ b/www-client/surfraw/surfraw-2.3.0.ebuild
80 @@ -0,0 +1,87 @@
81 +# Copyright 1999-2018 Gentoo Foundation
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=6
85 +inherit bash-completion-r1 eutils
86 +
87 +DESCRIPTION="A fast unix command line interface to WWW"
88 +HOMEPAGE="http://surfraw.alioth.debian.org/ https://gitlab.com/surfraw/Surfraw"
89 +SRC_URI="http://${PN}.alioth.debian.org/dist/${P}.tar.gz"
90 +
91 +SLOT="0"
92 +LICENSE="public-domain"
93 +KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
94 +RESTRICT="test"
95 +RDEPEND="
96 + dev-lang/perl
97 +"
98 +
99 +DOCS=(AUTHORS ChangeLog HACKING NEWS README TODO)
100 +PATCHES=(
101 + "${FILESDIR}"/${PN}-2.3.0-completion.patch
102 +)
103 +
104 +src_configure() {
105 + econf --with-elvidir='$(datadir)'/surfraw
106 +}
107 +
108 +src_install() {
109 + default
110 +
111 + newbashcomp surfraw-bash-completion ${PN}
112 + bashcomp_alias ${PN} sr
113 +
114 + docinto examples
115 + dodoc examples/README
116 + insinto /usr/share/doc/${PF}/examples
117 + doins examples/uzbl_load_url_from_surfraw
118 +}
119 +
120 +pkg_preinst() {
121 + has_version "=${CATEGORY}/${PN}-1.0.7"
122 + upgrade_from_1_0_7=$?
123 +}
124 +
125 +pkg_postinst() {
126 + local moves f
127 +
128 + einfo
129 + einfo "You can get a list of installed elvi by just typing 'surfraw' or"
130 + einfo "the abbreviated 'sr'."
131 + einfo
132 + einfo "You can try some searches, for example:"
133 + einfo "$ sr ask why is jeeves gay? "
134 + einfo "$ sr google -results=100 RMS, GNU, which is sinner, which is sin?"
135 + einfo "$ sr rhyme -method=perfect Julian"
136 + einfo
137 + einfo "The system configuration file is /etc/surfraw.conf"
138 + einfo
139 + einfo "Users can specify preferences in '~/.surfraw.conf' e.g."
140 + einfo "SURFRAW_graphical_browser=mozilla"
141 + einfo "SURFRAW_text_browser=w3m"
142 + einfo "SURFRAW_graphical=no"
143 + einfo
144 + einfo "surfraw works with any graphical and/or text WWW browser"
145 + einfo
146 + if [[ $upgrade_from_1_0_7 = 0 ]] ; then
147 + ewarn "surfraw usage has changed slightly since version 1.0.7, elvi are now called"
148 + ewarn "using the 'sr' wrapper script as described above. If you wish to return to"
149 + ewarn "the old behaviour you can add /usr/share/surfraw to your \$PATH"
150 + fi
151 + # This file was always autogenerated, and is no longer needed.
152 + if [ -f "${EROOT}"/etc/surfraw_elvi.list ]; then
153 + rm -f "${EROOT}"/etc/surfraw_elvi.list
154 + fi
155 +
156 + # Config file location changes in v2.2.6
157 + for f in /etc/surfraw.{bookmarks,conf}; do
158 + if [ -f "${EROOT}"${f} ]; then
159 + ewarn "${f} has moved to /etc/xdg/config/surfraw/${f##*.} in v2.2.6."
160 + moves=1
161 + fi
162 + done
163 + if [ "${moves}" == 1 ]; then
164 + ewarn "You must manually move, and update, the config files listed"
165 + ewarn "above for surfraw v2.2.6 and above to use them."
166 + fi
167 +}