/[gentoo-alt]/trunk/sys-apps/gawk/gawk-3.1.4-r4.ebuild
Gentoo

Contents of /trunk/sys-apps/gawk/gawk-3.1.4-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 242 - (show annotations) (download)
Sun Feb 27 23:26:00 2005 UTC (10 years, 1 month ago) by angusyoung
File size: 3812 byte(s)
Bumped gawk from 3.1.4 to 3.1.4-r4

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 inherit eutils toolchain-funcs
6
7 XML_PATCH=patch_3.1.4__xml_20040920
8 DESCRIPTION="GNU awk pattern-matching language"
9 HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
10 SRC_URI="mirror://gnu/gawk/${P}.tar.gz
11 xml? ( http://home1.vr-web.de/~Juergen.Kahrs/${XML_PATCH} )"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
16 IUSE="nls build xml"
17
18 RDEPEND="virtual/libc
19 xml? ( dev-libs/expat )"
20 DEPEND="${RDEPEND}
21 nls? ( sys-devel/gettext )"
22
23 SXML=${WORKDIR}/xmlgawk
24 SFFS=${WORKDIR}/filefuncs
25
26 src_unpack() {
27 unpack ${P}.tar.gz
28
29 if ! use x86-fbsd; then
30 # Copy filefuncs module's source over ...
31 cp -PR "${FILESDIR}"/filefuncs "${SFFS}"/ || die "cp failed"
32 fi
33
34 cd "${S}"
35
36 epatch "${FILESDIR}"/${P}-disable-DFA.patch #78227
37 epatch "${FILESDIR}"/${PN}-3.1.3-getpgrp_void.patch #fedora
38
39 # Patch below breaks compilation on Gentoo/FreeBSD
40 ! use x86-fbsd && epatch "${FILESDIR}"/${P}-nextc.patch #fedora
41
42 epatch "${FILESDIR}"/${P}-uplow.patch #fedora
43
44 # support for dec compiler.
45 [[ $(tc-getCC) == "ccc" ]] && epatch ${FILESDIR}/${PN}-3.1.2-dec-alpha-compiler.diff
46
47 if use xml ; then
48 mkdir "${SXML}"
49 cp -a "${S}"/* "${SXML}"/
50 cd "${SXML}"
51 EPATCH_OPTS="-p2 -g0" epatch "${DISTDIR}"/${XML_PATCH} #57857
52 fi
53
54 # Patch below breaks compilation on Gentoo/FreeBSD
55 if ! use x86-fbsd; then
56 cd "${S}"
57 epatch "${FILESDIR}"/${P}-flonum.patch #fedora
58 fi
59 }
60
61 src_compile() {
62 econf --bindir=/bin $(use_enable nls) || die
63 emake || die "make failed"
64
65 if use xml ; then
66 cd "${SXML}"
67 econf $(use_enable nls) || die
68 emake || die "xmlgawk make failed"
69 fi
70
71 if ! use x86-fbsd; then
72 cd "${SFFS}"
73 emake AWKINCDIR="${S}" CC=$(tc-getCC) || die "filefuncs emake failed"
74 fi
75 }
76
77 src_install() {
78 make install DESTDIR="${D}" || die "install failed"
79 if use xml ; then
80 newbin "${SXML}"/gawk xmlgawk || die "xmlgawk failed"
81 insinto /usr/include/awk
82 doins "${SXML}"/xml_puller.h || die "xml inc failed"
83 fi
84
85 if ! use x86-fbsd; then
86 cd "${SFFS}"
87 make \
88 DESTDIR="${D}" \
89 AWKINCDIR="${S}" \
90 LIBDIR="$(get_libdir)" \
91 install \
92 || die "filefuncs install failed"
93 fi
94
95 dodir /usr/bin
96 # In some rare cases, (p)gawk gets installed as (p)gawk- and not
97 # (p)gawk-${PV} .. Also make sure that /bin/(p)gawk is a symlink
98 # to /bin/(p)gawk-${PV}.
99 local x=
100 for x in gawk pgawk igawk ; do
101 local binpath
102 [[ ${x} == "gawk" ]] \
103 && binpath="/bin" \
104 || binpath="/usr/bin"
105
106 if [[ -f ${D}/bin/${x} && ! -f ${D}/bin/${x}-${PV} ]] ; then
107 mv -f ${D}/bin/${x} ${D}/${binpath}/${x}-${PV}
108 elif [[ -f ${D}/bin/${x}- && ! -f ${D}/bin/${x}-${PV} ]] ; then
109 mv -f ${D}/bin/${x}- ${D}/${binpath}/${x}-${PV}
110 elif [[ ${binpath} == "/usr/bin" && -f ${D}/bin/${x}-${PV} ]] ; then
111 mv -f ${D}/bin/${x}-${PV} ${D}/${binpath}/${x}-${PV}
112 fi
113
114 rm -f ${D}/bin/${x}
115 dosym ${x}-${PV} ${binpath}/${x}
116 [[ ${binpath} == "/usr/bin" ]] && dosym /usr/bin/${x}-${PV} /bin/${x}
117 done
118
119 if ! use x86-fbsd ; then
120 rm -f "${D}"/bin/awk
121 dosym gawk-${PV} /bin/awk
122 # Compat symlinks
123 dodir /usr/bin
124 dosym /bin/gawk-${PV} /usr/bin/awk
125 fi
126
127 dosym /bin/gawk-${PV} /usr/bin/gawk
128
129 # Install headers
130 insinto /usr/include/awk
131 doins "${S}"/*.h || die "ins headers failed"
132 # We do not want 'acconfig.h' in there ...
133 rm -f "${D}"/usr/include/awk/acconfig.h
134
135 if ! use build ; then
136 cd "${S}"
137 ! use x86-fbsd && dosym gawk.1.gz /usr/share/man/man1/awk.1.gz
138 dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README
139 docinto README_d
140 dodoc README_d/*
141 docinto awklib
142 dodoc awklib/ChangeLog
143 docinto pc
144 dodoc pc/ChangeLog
145 docinto posix
146 dodoc posix/ChangeLog
147 else
148 rm -r "${D}"/usr/share
149 fi
150 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20