Use https by default
[gentoo.git] / app-editors / nano / nano-2.1.10.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=2
6 inherit eutils
7 if [[ ${PV} == "9999" ]] ; then
8         ESVN_REPO_URI="svn://svn.savannah.gnu.org/nano/trunk/nano"
9         inherit subversion
10 else
11         MY_P=${PN}-${PV/_}
12         SRC_URI="http://www.nano-editor.org/dist/v${PV:0:3}/${MY_P}.tar.gz"
13 fi
14
15 DESCRIPTION="GNU GPL'd Pico clone with more functionality"
16 HOMEPAGE="http://www.nano-editor.org/"
17
18 LICENSE="GPL-3"
19 SLOT="0"
20 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
21 IUSE="debug justify minimal ncurses nls slang spell unicode"
22
23 DEPEND=">=sys-libs/ncurses-5.2[unicode?]
24         nls? ( sys-devel/gettext )
25         !ncurses? ( slang? ( sys-libs/slang ) )"
26
27 src_unpack() {
28         if [[ ${PV} == "9999" ]] ; then
29                 subversion_src_unpack
30         else
31                 unpack ${A}
32         fi
33         cd "${S}"
34         if [[ ! -e configure ]] ; then
35                 ./autogen.sh || die "autogen failed"
36         fi
37 }
38
39 src_configure() {
40         local myconf=""
41         use ncurses \
42                 && myconf="--without-slang" \
43                 || myconf="${myconf} $(use_with slang)"
44
45         econf \
46                 --bindir=/bin \
47                 $(use_enable !minimal color) \
48                 $(use_enable !minimal multibuffer) \
49                 $(use_enable !minimal nanorc) \
50                 --disable-wrapping-as-root \
51                 $(use_enable spell speller) \
52                 $(use_enable justify) \
53                 $(use_enable debug) \
54                 $(use_enable nls) \
55                 $(use_enable unicode utf8) \
56                 $(use_enable minimal tiny) \
57                 ${myconf} \
58                 || die "configure failed"
59 }
60
61 src_install() {
62         emake DESTDIR="${D}" install || die
63
64         dodoc ChangeLog README doc/nanorc.sample AUTHORS BUGS NEWS TODO
65         dohtml doc/faq.html
66         insinto /etc
67         newins doc/nanorc.sample nanorc
68
69         dodir /usr/bin
70         dosym /bin/nano /usr/bin/nano
71
72         insinto /usr/share/nano
73         local f
74         for f in "${FILESDIR}"/*.nanorc ; do
75                 [[ -e ${D}/usr/share/nano/${f##*/} ]] && continue
76                 doins "${f}" || die
77                 echo "# include \"/usr/share/nano/${f##*/}\"" >> "${D}"/etc/nanorc
78         done
79 }
80
81 pkg_postinst() {
82         einfo "More helpful info about nano, visit the GDP page:"
83         einfo "https://www.gentoo.org/doc/en/nano-basics-guide.xml"
84 }