Use https by default
[gentoo.git] / app-editors / nano / nano-2.3.1.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="3"
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 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
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_prepare() {
28         if [[ ! -e configure ]] ; then
29                 ./autogen.sh || die
30         fi
31 }
32
33 src_configure() {
34         local myconf=""
35         use ncurses \
36                 && myconf="--without-slang" \
37                 || myconf="${myconf} $(use_with slang)"
38
39         econf \
40                 --bindir="${EPREFIX}"/bin \
41                 $(use_enable !minimal color) \
42                 $(use_enable !minimal multibuffer) \
43                 $(use_enable !minimal nanorc) \
44                 --disable-wrapping-as-root \
45                 $(use_enable spell speller) \
46                 $(use_enable justify) \
47                 $(use_enable debug) \
48                 $(use_enable nls) \
49                 $(use_enable unicode utf8) \
50                 $(use_enable minimal tiny) \
51                 ${myconf}
52 }
53
54 src_install() {
55         emake DESTDIR="${D}" install || die
56
57         dodoc ChangeLog README doc/nanorc.sample AUTHORS BUGS NEWS TODO
58         dohtml doc/faq.html
59         insinto /etc
60         newins doc/nanorc.sample nanorc
61
62         dodir /usr/bin
63         dosym /bin/nano /usr/bin/nano
64
65         insinto /usr/share/nano
66         local f
67         for f in "${FILESDIR}"/*.nanorc ; do
68                 [[ -e ${ED}/usr/share/nano/${f##*/} ]] && continue
69                 doins "${f}" || die
70                 echo "# include \"/usr/share/nano/${f##*/}\"" >> "${ED}"/etc/nanorc
71         done
72 }
73
74 pkg_postinst() {
75         einfo "More helpful info about nano, visit the GDP page:"
76         einfo "https://www.gentoo.org/doc/en/nano-basics-guide.xml"
77 }