/[gentoo-alt]/trunk/prefix-overlay/sys-apps/gawk/gawk-3.1.5.ebuild
Gentoo

Contents of /trunk/prefix-overlay/sys-apps/gawk/gawk-3.1.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 909 - (show annotations) (download)
Tue Nov 29 21:04:28 2005 UTC (8 years, 9 months ago) by grobian
File size: 3157 byte(s)
Implemented gnuprefix USE-flag that allows us to get a non-g-prefixed
awk in the prefix.  Awksome, eh?


1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/gawk-3.1.5.ebuild,v 1.6 2005/10/13 00:11:25 kito Exp $
4
5 EAPI="prefix"
6
7 inherit eutils toolchain-funcs
8
9 DESCRIPTION="GNU awk pattern-matching language"
10 HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
11 SRC_URI="mirror://gnu/gawk/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~x86"
16 IUSE="nls build gnuprefix"
17 #todo: gnuprefix should become global I think
18
19 RDEPEND=""
20 DEPEND="${RDEPEND}
21 nls? ( sys-devel/gettext )"
22
23 SFFS=${WORKDIR}/filefuncs
24
25 src_unpack() {
26 unpack ${P}.tar.gz
27
28 # Copy filefuncs module's source over ...
29 cp -pPR "${FILESDIR}"/filefuncs "${SFFS}" || die "cp failed"
30
31 cd "${S}"
32 epatch "${FILESDIR}"/${P}-core.patch
33 epatch "${FILESDIR}"/${P}-gcc4.patch
34 epatch "${FILESDIR}"/${PN}-3.1.3-getpgrp_void.patch #fedora
35 # support for dec compiler.
36 [[ $(tc-getCC) == "ccc" ]] && epatch "${FILESDIR}"/${PN}-3.1.2-dec-alpha-compiler.diff
37 }
38
39 src_compile() {
40 econf \
41 $(with_bindir) \
42 --libexec=${PREFIX}/usr/lib/misc \
43 $(use_enable nls) \
44 --enable-switch \
45 || die
46 emake || die "emake failed"
47
48 cd "${SFFS}"
49 emake CC=$(tc-getCC) || die "filefuncs emake failed"
50 }
51
52 src_install() {
53 make install DESTDIR="${DEST}" || die "install failed"
54 cd "${SFFS}"
55 make LIBDIR="$(get_libdir)" install || die "filefuncs install failed"
56
57 dodir /usr/bin
58 # In some rare cases, (p)gawk gets installed as (p)gawk- and not
59 # (p)gawk-${PV} ... Also make sure that /bin/(p)gawk is a symlink
60 # to /bin/(p)gawk-${PV}.
61 local binpath x
62 for x in gawk pgawk igawk ; do
63 [[ ${x} == "gawk" ]] \
64 && binpath="/bin" \
65 || binpath="/usr/bin"
66
67 if [[ -f ${D}/bin/${x} && ! -f ${D}/bin/${x}-${PV} ]] ; then
68 mv -f "${D}"/bin/${x} "${D}"/${binpath}/${x}-${PV}
69 elif [[ -f ${D}/bin/${x}- && ! -f ${D}/bin/${x}-${PV} ]] ; then
70 mv -f "${D}"/bin/${x}- "${D}"/${binpath}/${x}-${PV}
71 elif [[ ${binpath} == "${PREFIX}/usr/bin" && -f ${D}/bin/${x}-${PV} ]] ; then
72 mv -f "${D}"/bin/${x}-${PV} "${D}"/${binpath}/${x}-${PV}
73 fi
74
75 rm -f "${D}"/bin/${x}
76 dosym ${x}-${PV} ${binpath}/${x}
77 [[ ${binpath} == "/usr/bin" ]] && dosym /usr/bin/${x}-${PV} /bin/${x}
78 done
79
80 rm -f "${D}"/bin/awk
81 dodir /usr/bin
82 # Compat symlinks
83 dosym /bin/gawk-${PV} /usr/bin/gawk
84 dosym gawk-${PV} /bin/awk
85 dosym /bin/gawk-${PV} /usr/bin/awk
86 use gnuprefix && rm -f "${D}"/{,usr/}bin/awk{,-${PV}}
87
88 # Install headers
89 insinto /usr/include/awk
90 doins "${S}"/*.h || die "ins headers failed"
91 # We do not want 'acconfig.h' in there ...
92 rm -f "${D}"/usr/include/awk/acconfig.h
93
94 if ! use build ; then
95 cd "${S}"
96 rm -f "${D}"/usr/share/man/man1/pgawk.1
97 dosym gawk.1.gz /usr/share/man/man1/pgawk.1.gz
98 use gnuprefix || dosym gawk.1.gz /usr/share/man/man1/awk.1.gz
99 dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README
100 docinto README_d
101 dodoc README_d/*
102 docinto awklib
103 dodoc awklib/ChangeLog
104 docinto pc
105 dodoc pc/ChangeLog
106 docinto posix
107 dodoc posix/ChangeLog
108 else
109 rm -r "${D}"/usr/share
110 fi
111 }

  ViewVC Help
Powered by ViewVC 1.1.20