Mercurial > hg > portage
comparison dev-lang/erlang/erlang-12.2.3.ebuild @ 34:cf0bab120617
merge pulled changes from Holgi's portage repo
author | Dirk Olmes <dirk.olmes@googlemail.com> |
---|---|
date | Fri, 13 Jun 2008 11:02:39 +0200 |
parents | 34f7f8bfe80e |
children |
comparison
equal
deleted
inserted
replaced
32:b23455d0adfe | 34:cf0bab120617 |
---|---|
1 # Copyright 1999-2008 Gentoo Foundation | |
2 # Distributed under the terms of the GNU General Public License v2 | |
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/erlang/erlang-12.2.2.ebuild,v 1.9 2008/05/28 19:47:35 pva Exp $ | |
4 | |
5 inherit autotools elisp-common eutils flag-o-matic multilib versionator | |
6 | |
7 # NOTE: If you need symlinks for binaries please tell maintainers or | |
8 # open up a bug to let it be created. | |
9 | |
10 # erlang uses a really weird versioning scheme which caused quite a few problems | |
11 # already. Thus we do a slight modification converting all letters to digits to | |
12 # make it more sane (see e.g. #26420) | |
13 | |
14 # the next line selects the right source. | |
15 MY_PV="R$(get_major_version)B-$(get_version_component_range 3)" | |
16 | |
17 # ATTN!! Take care when processing the C, etc version! | |
18 MY_P=otp_src_${MY_PV} | |
19 | |
20 DESCRIPTION="Erlang programming language, runtime environment, and large collection of libraries" | |
21 HOMEPAGE="http://www.erlang.org/" | |
22 SRC_URI="http://www.erlang.org/download/${MY_P}.tar.gz | |
23 doc? ( http://erlang.org/download/otp_doc_man_${MY_PV}.tar.gz | |
24 http://erlang.org/download/otp_doc_html_${MY_PV}.tar.gz )" | |
25 | |
26 LICENSE="EPL" | |
27 SLOT="0" | |
28 KEYWORDS="alpha amd64 ppc ppc64 sparc x86 ~x86-fbsd" | |
29 IUSE="doc emacs hipe java kpoll odbc sctp smp ssl tk" | |
30 | |
31 RDEPEND=">=dev-lang/perl-5.6.1 | |
32 ssl? ( >=dev-libs/openssl-0.9.7d ) | |
33 emacs? ( virtual/emacs ) | |
34 java? ( >=virtual/jdk-1.2 ) | |
35 odbc? ( dev-db/unixODBC )" | |
36 DEPEND="${RDEPEND} | |
37 sctp? ( net-misc/lksctp-tools ) | |
38 tk? ( dev-lang/tk )" | |
39 | |
40 S="${WORKDIR}/${MY_P}" | |
41 | |
42 SITEFILE=50erlang-gentoo.el | |
43 | |
44 src_unpack() { | |
45 unpack ${A} | |
46 cd "${S}" | |
47 | |
48 use odbc || sed -i 's: odbc : :' lib/Makefile | |
49 | |
50 # fix builds with glibc-2.8, bug 226063 | |
51 epatch "${FILESDIR}"/${P}-glibc28.patch | |
52 | |
53 # make sure we only link ssl dynamically | |
54 # will not be integrated by upstream for various reasons | |
55 sed -i '/SSL_DYNAMIC_ONLY=/s:no:yes:' erts/configure #184419 | |
56 | |
57 if use hipe; then | |
58 ewarn | |
59 ewarn "You enabled High performance Erlang. Be aware that this extension" | |
60 ewarn "can break the compilation in many ways, especially on hardened systems." | |
61 ewarn "Don't cry, don't file bugs, just disable it! If you have fix, tell us." | |
62 ewarn | |
63 fi | |
64 eautoreconf | |
65 } | |
66 | |
67 src_compile() { | |
68 use java || export JAVAC=false | |
69 | |
70 econf \ | |
71 --enable-threads \ | |
72 $(use_enable hipe) \ | |
73 $(use_with ssl) \ | |
74 $(use_enable sctp) \ | |
75 $(use_enable kpoll kernel-poll) \ | |
76 $(use_enable smp smp-support) \ | |
77 || die "econf failed" | |
78 emake -j1 || die "emake failed" | |
79 | |
80 if use emacs ; then | |
81 pushd lib/tools/emacs | |
82 elisp-compile *.el | |
83 popd | |
84 fi | |
85 } | |
86 | |
87 extract_version() { | |
88 sed -n -e "/^$2 = \(.*\)$/s::\1:p" "${S}/$1/vsn.mk" | |
89 } | |
90 | |
91 src_install() { | |
92 local ERL_LIBDIR=/usr/$(get_libdir)/erlang | |
93 local ERL_INTERFACE_VER=$(extract_version lib/erl_interface EI_VSN) | |
94 local ERL_ERTS_VER=$(extract_version erts VSN) | |
95 | |
96 emake -j1 INSTALL_PREFIX="${D}" install || die "install failed" | |
97 dodoc AUTHORS README | |
98 | |
99 dosym "${ERL_LIBDIR}/bin/erl" /usr/bin/erl | |
100 dosym "${ERL_LIBDIR}/bin/erlc" /usr/bin/erlc | |
101 dosym "${ERL_LIBDIR}/bin/ear" /usr/bin/ear | |
102 dosym "${ERL_LIBDIR}/bin/escript" /usr/bin/escript | |
103 dosym \ | |
104 "${ERL_LIBDIR}/lib/erl_interface-${ERL_INTERFACE_VER}/bin/erl_call" \ | |
105 /usr/bin/erl_call | |
106 dosym "${ERL_LIBDIR}/erts-${ERL_ERTS_VER}/bin/beam" /usr/bin/beam | |
107 | |
108 ## Remove ${D} from the following files | |
109 dosed "${ERL_LIBDIR}/bin/erl" | |
110 dosed "${ERL_LIBDIR}/bin/start" | |
111 grep -rle "${D}" "${D}/${ERL_LIBDIR}/erts-${ERL_ERTS_VER}" | xargs sed -i -e "s:${D}::g" | |
112 | |
113 ## Clean up the no longer needed files | |
114 rm "${D}/${ERL_LIBDIR}/Install" | |
115 | |
116 if use doc ; then | |
117 for i in "${WORKDIR}"/man/man* ; do | |
118 dodir "${ERL_LIBDIR}/${i##${WORKDIR}}" | |
119 done | |
120 for file in "${WORKDIR}"/man/man*/*.[1-9]; do | |
121 # Man page processing tools expect a capitalized "SEE ALSO" section | |
122 # header, has been reported upstream, should be fixed in R12 | |
123 sed -i -e 's,\.SH See Also,\.SH SEE ALSO,g' ${file} | |
124 # doman sucks so we can't use it | |
125 cp ${file} "${D}/${ERL_LIBDIR}"/man/man${file##*.}/ | |
126 done | |
127 # extend MANPATH, so the normal man command can find it | |
128 # see bug 189639 | |
129 dodir /etc/env.d/ | |
130 echo "MANPATH=\"${ERL_LIBDIR}/man\"" > "${D}/etc/env.d/90erlang" | |
131 dohtml -A README,erl,hrl,c,h,kwc,info -r \ | |
132 "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* | |
133 fi | |
134 | |
135 if use emacs ; then | |
136 pushd "${S}" | |
137 elisp-install erlang lib/tools/emacs/*.{el,elc} | |
138 elisp-site-file-install "${FILESDIR}"/${SITEFILE} | |
139 popd | |
140 fi | |
141 | |
142 # prepare erl for SMP, fixes bug #188112 | |
143 use smp && sed -i -e 's:\(exec.*erlexec\):\1 -smp:' \ | |
144 "${D}/${ERL_LIBDIR}/bin/erl" | |
145 } | |
146 | |
147 pkg_postinst() { | |
148 use emacs && elisp-site-regen | |
149 elog | |
150 elog "If you need a symlink to one of Erlang's binaries," | |
151 elog "please open a bug on http://bugs.gentoo.org/" | |
152 elog | |
153 elog "Gentoo's versioning scheme differs from the author's, so please refer to this version as ${MY_PV}" | |
154 elog | |
155 } | |
156 | |
157 pkg_postrm() { | |
158 use emacs && elisp-site-regen | |
159 } |