1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-6.9-r1.ebuild,v 1.18 2007/09/15 02:31:17 vapier Exp $
5 inherit eutils flag-o-matic toolchain-funcs autotools
8 DESCRIPTION
="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
9 HOMEPAGE
="http://www.gnu.org/software/coreutils/"
10 SRC_URI
="ftp://alpha.gnu.org/gnu/coreutils/${P}.tar.bz2
11 mirror://gnu/${PN}/${P}.tar.bz2
12 mirror://gentoo/${P}.tar.bz2
13 mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2
14 http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.bz2"
18 KEYWORDS
="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
19 IUSE
="acl nls selinux static xattr"
21 RDEPEND
="selinux? ( sys-libs/libselinux )
23 xattr? ( sys-apps/attr )
24 nls? ( >=sys-devel/gettext-0.15 )
26 >=sys-libs/ncurses-5.3-r5"
28 >=sys-devel/automake-1.10
29 >=sys-devel/autoconf-2.61
30 >=sys-devel/m4-1.4-r1"
33 # fixup expr for #123342
34 if [[ $
(/bin
/expr a
: '\(a\)') != "a" ]] ; then
35 if [[ -x /bin
/busybox
]] ; then
36 ln -sf /bin
/busybox
/bin
/expr
38 eerror
"Your expr binary appears to be broken, please fix it."
39 eerror
"For more info, see http://bugs.gentoo.org/123342"
40 die
"your expr is broke"
49 epatch
"${FILESDIR}"/gnulib-futimens-rename.
patch #180764
50 sed -i 's:\<futimens\>:gl_futimens:' src
/{copy
,touch}.c
52 PATCHDIR
="${WORKDIR}/patch"
53 #rm -f "${PATCHDIR}"/generic/001_*progress* # we don't want to do this
55 # Apply the ACL/SELINUX patches.
57 EPATCH_MULTI_MSG
="Applying SELINUX patches ..." \
58 EPATCH_SUFFIX
="patch" epatch
"${PATCHDIR}"/selinux
60 EPATCH_MULTI_MSG
="Applying ACL patches ..." \
61 EPATCH_SUFFIX
="patch" epatch
"${PATCHDIR}"/acl
64 EPATCH_SUFFIX
="patch" epatch
"${PATCHDIR}"/generic
65 chmod a
+rx
tests
/sort
/sort-mb-tests
66 chmod a
+rx
tests
/ls
/x-option
68 # Since we've patched many .c files, the make process will try to
69 # re-build the manpages by running `./bin --help`. When doing a
70 # cross-compile, we can't do that since 'bin' isn't a native bin.
71 # Also, it's not like we changed the usage on any of these things,
72 # so let's just update the timestamps and skip the help2man step.
74 # There's no reason for this crap to use the private version
75 sed -i 's:__mempcpy:mempcpy:g' lib
/*.c
77 AT_M4DIR
="m4" eautoreconf
81 if ! type -p cvs
> /dev
/null
; then
82 # Fix issues with gettext's autopoint if cvs is not installed,
84 export AUTOPOINT
="/bin/true"
88 [[ ${USERLAND} == "GNU" ]] || myconf
="${myconf} --bindir=/usr/libexec/gnu"
89 if echo "#include <regex.h>" | $
(tc-getCPP
) > /dev
/null
; then
90 myconf
="${myconf} --without-included-regex"
93 # cross-compile workaround #177061
94 [[ ${CHOST} == *-linux* ]] && export fu_cv_sys_stat_statvfs
=yes
96 use static
&& append-ldflags
-static
101 $
(use_enable xattr
) \
102 $
(use_enable selinux
) \
109 # Non-root tests will fail if the full path isnt
110 # accessible to non-root users
111 chmod -R go-w
"${WORKDIR}"
112 chmod a
+rx
"${WORKDIR}"
114 export RUN_EXPENSIVE_TESTS
="yes"
115 #export FETISH_GROUPS="portage wheel"
116 make check || die
"make check failed"
120 emake
install DESTDIR
="${D}" || die
121 rm -f "${D}"/usr
/lib
/charset.
alias
122 dodoc AUTHORS ChangeLog
* NEWS README
* THANKS TODO
124 # remove files provided by other packages
125 rm "${D}"/usr
/bin
/{kill,uptime
} # procps
126 rm "${D}"/usr
/bin
/{groups
,su
} # shadow
127 rm "${D}"/usr
/bin
/hostname
# net-tools
128 rm "${D}"/usr
/share
/man
/man
1/{groups
,kill,hostname
,su
,uptime
}.1
131 newins src
/dircolors.hin DIR_COLORS
133 if [[ ${USERLAND} == "GNU" ]] ; then
136 # move critical binaries into /bin (required by FHS)
137 local fhs
="cat chgrp chmod chown cp date dd df echo false ln ls
138 mkdir mknod mv pwd rm rmdir stty sync true uname"
139 mv ${fhs} ..
/..
/bin
/ || die
"could not move fhs bins"
140 # move critical binaries into /bin (common scripts)
141 local com
="basename chroot cut dir dirname du env expr head mkfifo
142 readlink seq sleep sort tail touch tr tty vdir wc yes"
143 mv ${com} ..
/..
/bin
/ || die
"could not move common bins"
144 # create a symlink for uname in /usr/bin/ since autotools require it
146 for x
in ${com} uname
; do
147 dosym
/bin
/${x} /usr
/bin
/${x} || die
150 # For now, drop the man pages, collides with the ones of the system.
151 rm -rf "${D}"/usr
/share
/man
156 ewarn
"Make sure you run 'hash -r' in your active shells."
157 ewarn
"This is a modified version of the official ebuild plus"
158 ewarn
"progress bar patch"