dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / app-misc / todo / todo-2.11.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit bash-completion-r1
7
8 DESCRIPTION="A CLI-based TODO list manager"
9 HOMEPAGE="http://todotxt.org"
10 SRC_URI="https://github.com/todotxt/${PN}.txt-cli/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="test"
16 RESTRICT="!test? ( test )"
17
18 RDEPEND="app-shells/bash"
19
20 PATCHES=( "${FILESDIR}/${P}-fix-bash-completion.patch" )
21
22 DOCS=( README.md CONTRIBUTING.md LICENSE todo.cfg )
23
24 S="${WORKDIR}/${PN}.txt-cli-${PV}"
25
26 src_prepare() {
27         default
28
29         # fix version string
30         sed -i -e "s/@DEV_VERSION@/${PV}/" todo.sh || die
31
32         # TODO_DIR variable is bogus
33         sed -i -e '/export TODO_DIR/d' todo.cfg || die
34         sed -i -e '4i export TODO_DIR="$HOME/.todo"' todo.cfg || die
35 }
36
37 src_test() {
38         make test || die "tests failed"
39 }
40
41 src_install() {
42         dobin "${PN}.sh"
43         dosym "${PN}.sh" "/usr/bin/${PN}cli"
44         dosym "${PN}.sh" "/usr/bin/${PN}txt"
45         newbashcomp "${PN}_completion" "${PN}.sh"
46         bashcomp_alias "${PN}.sh" "${PN}cli" "${PN}txt"
47         einstalldocs
48 }
49
50 pkg_postinst() {
51         einfo
52         einfo 'Before starting todo, make sure to create'
53         einfo 'a .todo directory in your home directory:'
54         einfo '  $ mkdir -p $HOME/.todo'
55         einfo
56         einfo 'and make sure to copy the default todo'
57         einfo 'configuration file in the same location:'
58         einfo "  $ bzcat /usr/share/doc/${PF}/todo.cfg.bz2 > \$HOME/.todo/config"
59         einfo
60         einfo 'Alternatively, you can use XDG directories instead:'
61         einfo '  $ mkdir -p $HOME/.local/share/todo'
62         einfo '  $ mkdir -p $HOME/.config/todo'
63         einfo "  $ bzcat /usr/share/doc/${PF}/todo.cfg.bz2 > \$HOME/.config/todo/config"
64         einfo
65         einfo 'You can then edit this file as you see fit.'
66         einfo 'Enjoy!'
67         einfo
68 }