Use https by default
[gentoo.git] / app-portage / portage-utils / portage-utils-0.53.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6
7 inherit flag-o-matic toolchain-funcs eutils
8
9 DESCRIPTION="small and fast portage helper tools written in C"
10 HOMEPAGE="https://wiki.gentoo.org/wiki/Portage-utils"
11 SRC_URI="mirror://gentoo/${P}.tar.xz
12         https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="nls static"
18
19 DEPEND="app-arch/xz-utils"
20 RDEPEND=""
21
22 src_prepare() {
23         epatch_user
24 }
25
26 src_configure() {
27         use static && append-ldflags -static
28
29         # Avoid slow configure+gnulib+make if on an up-to-date Linux system
30         if use prefix || ! use kernel_linux || \
31            has_version '<sys-libs/glibc-2.10'
32         then
33                 econf --with-eprefix="${EPREFIX}"
34         else
35                 tc-export CC
36         fi
37 }
38
39 src_compile() {
40         emake NLS=$(usex nls)
41 }
42
43 src_install() {
44         default
45
46         exeinto /etc/portage/bin
47         doexe "${FILESDIR}"/post_sync
48         insinto /etc/portage/postsync.d
49         doins "${FILESDIR}"/q-reinitialize
50
51         # Portage fixes shebangs, we just need to fix the paths in the files
52         sed -i \
53                 -e "s:\(/etc/portage/postsync.d\|/usr/bin/q\):${EPREFIX}&:g" \
54                 "${ED}"/etc/portage/bin/post_sync \
55                 "${ED}"/etc/portage/postsync.d/q-reinitialize || die
56 }
57
58 pkg_preinst() {
59         # preserve +x bit on postsync files #301721
60         local x
61         pushd "${ED}" >/dev/null
62         for x in etc/portage/postsync.d/* ; do
63                 [[ -x ${EROOT}/${x} ]] && chmod +x "${x}"
64         done
65 }
66
67 pkg_postinst() {
68         if [[ -z ${REPLACING_VERSIONS} ]] ; then
69                 elog "${EPREFIX}/etc/portage/postsync.d/q-reinitialize has been installed for convenience"
70                 elog "If you wish for it to be automatically run at the end of every --sync:"
71                 elog "   # chmod +x ${EPREFIX}/etc/portage/postsync.d/q-reinitialize"
72                 elog "Normally this should only take a few seconds to run but file systems"
73                 elog "such as ext3 can take a lot longer.  To disable, simply do:"
74                 elog "   # chmod -x ${EPREFIX}/etc/portage/postsync.d/q-reinitialize"
75         fi
76 }