Gentoo Archives: gentoo-commits

From: "Javier Villavicencio (the_paya)" <the_paya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-lib: metadata.xml ChangeLog freebsd-lib-7.1.ebuild
Date: Thu, 22 Jan 2009 21:02:33
Message-Id: E1LQ6h5-0007fv-5m@stork.gentoo.org
1 the_paya 09/01/22 21:02:31
2
3 Modified: metadata.xml ChangeLog
4 Added: freebsd-lib-7.1.ebuild
5 Log:
6 Import of the 7.1 ebuilds from gentoo-bsd overlay.
7 (Portage version: 2.2_rc23/cvs/FreeBSD i386)
8
9 Revision Changes Path
10 1.3 sys-freebsd/freebsd-lib/metadata.xml
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/metadata.xml?rev=1.3&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/metadata.xml?rev=1.3&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/metadata.xml?r1=1.2&r2=1.3
15
16 Index: metadata.xml
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/metadata.xml,v
19 retrieving revision 1.2
20 retrieving revision 1.3
21 diff -u -r1.2 -r1.3
22 --- metadata.xml 22 Aug 2008 22:10:05 -0000 1.2
23 +++ metadata.xml 22 Jan 2009 21:02:31 -0000 1.3
24 @@ -3,7 +3,7 @@
25 <pkgmetadata>
26 <herd>bsd</herd>
27 <use>
28 - <flag name='gpib'>Enable gpib support (TODO improve description)</flag>
29 - <flag name='hesiod'>Enable hesiod support</flag>
30 + <flag name='gpib'>Enable General Purpose Interface Bus support</flag>
31 + <flag name='hesiod'>Enable support for net-dns/hesiod</flag>
32 </use>
33 </pkgmetadata>
34
35
36
37 1.63 sys-freebsd/freebsd-lib/ChangeLog
38
39 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?rev=1.63&view=markup
40 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?rev=1.63&content-type=text/plain
41 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?r1=1.62&r2=1.63
42
43 Index: ChangeLog
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v
46 retrieving revision 1.62
47 retrieving revision 1.63
48 diff -u -r1.62 -r1.63
49 --- ChangeLog 8 Jan 2009 17:41:58 -0000 1.62
50 +++ ChangeLog 22 Jan 2009 21:02:31 -0000 1.63
51 @@ -1,6 +1,14 @@
52 # ChangeLog for sys-freebsd/freebsd-lib
53 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
54 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.62 2009/01/08 17:41:58 aballier Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.63 2009/01/22 21:02:31 the_paya Exp $
56 +
57 +*freebsd-lib-7.1 (22 Jan 2009)
58 +
59 + 22 Jan 2009; Javier Villavicencio <the_paya@g.o>
60 + +files/freebsd-lib-7.0-CVE-2008-1391.patch,
61 + +files/freebsd-lib-7.1-types.h-fix.patch, metadata.xml,
62 + +freebsd-lib-7.1.ebuild:
63 + Import 7.1 ebuilds from gentoo-bsd overlay.
64
65 08 Jan 2009; Alexis Ballier <aballier@g.o>
66 -freebsd-lib-6.2-r2.ebuild, -freebsd-lib-6.2-r3.ebuild:
67
68
69
70 1.1 sys-freebsd/freebsd-lib/freebsd-lib-7.1.ebuild
71
72 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-7.1.ebuild?rev=1.1&view=markup
73 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-7.1.ebuild?rev=1.1&content-type=text/plain
74
75 Index: freebsd-lib-7.1.ebuild
76 ===================================================================
77 # Copyright 1999-2009 Gentoo Foundation
78 # Distributed under the terms of the GNU General Public License v2
79 # $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-7.1.ebuild,v 1.1 2009/01/22 21:02:31 the_paya Exp $
80
81 inherit bsdmk freebsd flag-o-matic toolchain-funcs
82
83 DESCRIPTION="FreeBSD's base system libraries"
84 SLOT="7.0"
85 KEYWORDS="~sparc-fbsd ~x86-fbsd"
86
87 IUSE="atm bluetooth ssl hesiod ipv6 kerberos nis gpib build bootstrap crosscompile_opts_headers-only"
88
89 # Crypto is needed to have an internal OpenSSL header
90 # sys is needed for libalias, probably we can just extract that instead of
91 # extracting the whole tarball
92 SRC_URI="mirror://gentoo/${LIB}.tar.bz2
93 mirror://gentoo/${CONTRIB}.tar.bz2
94 mirror://gentoo/${CRYPTO}.tar.bz2
95 mirror://gentoo/${LIBEXEC}.tar.bz2
96 mirror://gentoo/${ETC}.tar.bz2
97 mirror://gentoo/${INCLUDE}.tar.bz2
98 nis? ( mirror://gentoo/${USBIN}.tar.bz2 )
99 build? (
100 mirror://gentoo/${SYS}.tar.bz2 )"
101
102 if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
103 RDEPEND="ssl? ( dev-libs/openssl )
104 hesiod? ( net-dns/hesiod )
105 kerberos? ( virtual/krb5 )
106 !sys-freebsd/freebsd-headers"
107 DEPEND="${RDEPEND}
108 >=sys-devel/flex-2.5.31-r2
109 =sys-freebsd/freebsd-sources-${RV}*
110 !bootstrap? ( app-arch/bzip2 )"
111
112 PROVIDE="virtual/libc
113 virtual/os-headers"
114
115 else
116 SRC_URI="${SRC_URI}
117 mirror://gentoo/${SYS}.tar.bz2"
118 fi
119
120 DEPEND="${DEPEND}
121 =sys-freebsd/freebsd-mk-defs-${RV}*"
122
123 S="${WORKDIR}/lib"
124
125 export CTARGET=${CTARGET:-${CHOST}}
126 if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
127 export CTARGET=${CATEGORY/cross-}
128 fi
129
130 pkg_setup() {
131 [ -c /dev/zero ] || \
132 die "You forgot to mount /dev; the compiled libc would break."
133
134 if ! use ssl && use kerberos; then
135 eerror "If you want kerberos support you need to enable ssl support, too."
136 fi
137
138 use atm || mymakeopts="${mymakeopts} NO_ATM= "
139 use bluetooth || mymakeopts="${mymakeopts} NO_BLUETOOTH= "
140 use hesiod || mymakeopts="${mymakeopts} NO_HESIOD_LIBC= "
141 use ssl || mymakeopts="${mymakeopts} NO_OPENSSL= NO_CRYPT= "
142 use ipv6 || mymakeopts="${mymakeopts} NO_INET6= "
143 use kerberos || mymakeopts="${mymakeopts} NO_KERBEROS= "
144 use nis || mymakeopts="${mymakeopts} NO_NIS= "
145 use gpib || mymakeopts="${mymakeopts} NO_GPIB= "
146
147 mymakeopts="${mymakeopts} NO_OPENSSH= NO_BIND= NO_SENDMAIL= NO_LIBC_R="
148
149 if [ "${CTARGET}" != "${CHOST}" ]; then
150 mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
151 mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
152 fi
153 }
154
155 PATCHES="${FILESDIR}/${PN}-bsdxml.patch
156 ${FILESDIR}/${PN}-6.0-pmc.patch
157 ${FILESDIR}/${PN}-6.0-gccfloat.patch
158 ${FILESDIR}/${PN}-6.0-flex-2.5.31.patch
159 ${FILESDIR}/${PN}-6.1-csu.patch
160 ${FILESDIR}/${PN}-6.2-bluetooth.patch
161 ${FILESDIR}/${PN}-new_as.patch
162 ${FILESDIR}/${PN}-7.0-CVE-2008-1391.patch"
163
164 # Here we disable and remove source which we don't need or want
165 # In order:
166 # - ncurses stuff
167 # - archiving libraries (have their own ebuild)
168 # - sendmail libraries (they are installed by sendmail)
169 # - SNMP library and dependency (have their own ebuilds)
170 #
171 # The rest are libraries we already have somewhere else because
172 # they are contribution.
173 # Note: libtelnet is an internal lib used by telnet and telnetd programs
174 # as it's not used in freebsd-lib package itself, it's pointless building
175 # it here.
176 REMOVE_SUBDIRS="ncurses
177 libz libbz2 libarchive \
178 libsm libsmdb libsmutil \
179 libbegemot libbsnmp \
180 libpam libpcap bind libwrap libmagic \
181 libcom_err libtelnet
182 libedit"
183
184 src_unpack() {
185 freebsd_src_unpack
186
187 sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
188 sed -i.bak -e 's:histedit.h::' "${WORKDIR}/include/Makefile"
189
190 # Upstream Display Managers default to using VT7
191 # We should make FreeBSD allow this by default
192 local x=
193 for x in "${WORKDIR}"/etc/etc.*/ttys ; do
194 sed -i.bak \
195 -e '/ttyv5[[:space:]]/ a\
196 # Display Managers default to VT7.\
197 # If you use the xdm init script, keep ttyv6 commented out\
198 # unless you force a different VT for the DM being used.' \
199 -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
200 || die "Failed to sed ${x}"
201 rm "${x}".bak
202 done
203
204 # Don't install the hesiod man page or header
205 rm "${WORKDIR}"/include/hesiod.h || die
206 sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die
207 sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \
208 "${WORKDIR}"/lib/libc/net/Makefile.inc || die
209
210 # Apply this patch for Gentoo/FreeBSD/SPARC64 to build correctly
211 # from catalyst, then don't do anything else
212 if use build; then
213 cd "${WORKDIR}"
214 # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it
215 # shouldn't be a symlink to /usr/src/sys (which should be already patched)
216 epatch "${FILESDIR}"/${PN}-7.1-types.h-fix.patch
217 # Preinstall includes so we don't use the system's ones.
218 mkdir "${WORKDIR}/include_proper" || die "Couldn't create ${WORKDIR}/include_proper"
219 install_includes "/include_proper"
220 return 0
221 fi
222
223 if [ "${CTARGET}" = "${CHOST}" ]; then
224 ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys" || die "Couldn't make sys symlink!"
225 else
226 sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
227 "${S}/libc/rpc/Makefile.inc" \
228 "${S}/libc/yp/Makefile.inc"
229 fi
230
231 if install --version 2> /dev/null | grep -q GNU; then
232 sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
233 fi
234
235 # Preinstall includes so we don't use the system's ones.
236 mkdir "${WORKDIR}/include_proper" || die "Couldn't create ${WORKDIR}/include_proper"
237 install_includes "/include_proper"
238
239 # Let arch-specific includes to be found
240 local machine
241 machine=$(tc-arch-kernel ${CTARGET})
242 ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine" || \
243 die "Couldn't make ${machine}/include symlink."
244
245 use bootstrap && dummy_mk libstand
246 }
247
248 src_compile() {
249 cd "${WORKDIR}/include"
250 $(freebsd_get_bmake) CC=$(tc-getCC) || die "make include failed"
251
252 use crosscompile_opts_headers-only && return 0
253
254 # Don't use ssp until properly fixed
255 append-flags $(test-flags -fno-stack-protector -fno-stack-protector-all)
256
257 strip-flags
258 if [ "${CTARGET}" != "${CHOST}" ]; then
259 export YACC='yacc -by'
260 CHOST=${CTARGET} tc-export CC LD CXX
261
262 local machine
263 machine=$(tc-arch-kernel ${CTARGET})
264
265 local csudir
266 if [ -d "${S}/csu/${machine}-elf" ]; then
267 csudir="${S}/csu/${machine}-elf"
268 else
269 csudir="${S}/csu/${machine}"
270 fi
271 cd "${csudir}"
272 $(freebsd_get_bmake) ${mymakeopts} || die "make csu failed"
273
274 append-flags "-isystem /usr/${CTARGET}/usr/include"
275 append-flags "-isystem ${WORKDIR}/lib/libutil"
276 append-flags "-isystem ${WORKDIR}/lib/msun/${machine/i386/i387}"
277 append-flags "-B ${csudir}"
278 append-ldflags "-B ${csudir}"
279
280 cd "${S}/libc"
281 $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
282 cd "${S}/msun"
283 $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
284 else
285 # Forces to use the local copy of headers as they might be outdated in
286 # the system
287 append-flags "-isystem '${WORKDIR}/include_proper'"
288
289 cd "${S}"
290 NOFLAGSTRIP=yes freebsd_src_compile
291 fi
292 }
293
294 src_install() {
295 [ "${CTARGET}" = "${CHOST}" ] \
296 && INCLUDEDIR="/usr/include" \
297 || INCLUDEDIR="/usr/${CTARGET}/usr/include"
298 dodir ${INCLUDEDIR}
299 einfo "Installing for ${CTARGET} in ${CHOST}.."
300 install_includes ${INCLUDEDIR}
301
302 # Install math.h when crosscompiling, at this point
303 if [ "${CHOST}" != "${CTARGET}" ]; then
304 insinto "/usr/${CTARGET}/usr/include"
305 doins "${S}/msun/src/math.h"
306 fi
307
308 use crosscompile_opts_headers-only && return 0
309
310 if [ "${CTARGET}" != "${CHOST}" ]; then
311 local csudir
312 if [ -d "${S}/csu/$(tc-arch-kernel ${CTARGET})-elf" ]; then
313 csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})-elf"
314 else
315 csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})"
316 fi
317 cd "${csudir}"
318 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install \
319 FILESDIR="/usr/${CTARGET}/usr/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install csu failed"
320
321 cd "${S}/libc"
322 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
323 SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
324
325 cd "${S}/msun"
326 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
327 INCLUDEDIR="/usr/${CTARGET}/usr/include" \
328 SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
329
330 dosym "usr/include" "/usr/${CTARGET}/sys-include"
331 else
332 cd "${S}"
333 mkinstall || die "Install failed"
334 fi
335
336 # Don't install the rest of the configuration files if crosscompiling
337 if [ "${CTARGET}" != "${CHOST}" ] ; then
338 # This is to get it stripped with the correct tools, otherwise it gets
339 # stripped with the host strip.
340 export CHOST=${CTARGET}
341 return 0
342 fi
343
344 # Add symlinks (-> libthr) for legacy threading libraries, since these are
345 # not built by us (they are disabled in FreeBSD-7 anyway).
346 dosym libthr.a /usr/lib/libpthread.a
347 dosym libthr.so /usr/lib/libpthread.so
348 dosym libthr.a /usr/lib/libc_r.a
349 dosym libthr.so /usr/lib/libc_r.so
350
351 # Add symlink (-> libthr) so previously built binaries still work.
352 dosym libthr.so.3 /lib/libpthread.so.2
353 dosym libthr.so.3 /lib/libc_r.so.6
354
355 # Compatibility symlinks to run FreeBSD 5.x binaries (ABI is mostly
356 # identical, remove when problems will actually happen)
357 dosym /lib/libc.so.7 /usr/lib/libc.so.6
358 dosym /lib/libc.so.6 /usr/lib/libc.so.5
359 dosym /lib/libm.so.4 /usr/lib/libm.so.3
360 dosym /lib/libm.so.5 /usr/lib/libm.so.4
361
362 # install libstand files
363 dodir /usr/include/libstand
364 insinto /usr/include/libstand
365 doins "${S}"/libstand/*.h
366
367 cd "${WORKDIR}/etc/"
368 insinto /etc
369 doins auth.conf nls.alias mac.conf netconfig
370
371 # Install ttys file
372
373 doins "etc.${MACHINE}"/*
374
375 dodir /etc/sandbox.d
376
377 # Generate ldscripts, otherwise bad thigs are supposed to happen
378 gen_usr_ldscript libalias_cuseeme.so libalias_dummy.so libalias_ftp.so \
379 libalias_irc.so libalias_nbt.so libalias_pptp.so libalias_skinny.so \
380 libalias_smedia.so
381 # These show on QA warnings too, however they're pretty much bsd only,
382 # aka, no autotools for them.
383 # libbsdxml.so libcam.so libcrypt.so libdevstat.so libgeom.so \
384 # libipsec.so libipx.so libkiconv.so libkvm.so libmd.so libsbuf.so libufs.so \
385 # libutil.so
386
387 cat - > "${D}"/etc/sandbox.d/00freebsd <<EOF
388 # /dev/crypto is used mostly by OpenSSL on *BSD platforms
389 # leave it available as packages might use OpenSSL commands
390 # during compile or install phase.
391 SANDBOX_PREDICT="/dev/crypto"
392 EOF
393 }
394
395 install_includes()
396 {
397 local INCLUDEDIR="$1"
398
399 # The idea is to be called from either install or unpack.
400 # During unpack it's required to install them as portage's user.
401 if [[ "${EBUILD_PHASE}" == "install" ]]; then
402 local DESTDIR="${D}"
403 BINOWN="root"
404 BINGRP="wheel"
405 else
406 local DESTDIR="${WORKDIR}"
407 [[ -z "${USER}" ]] && USER="portage"
408 BINOWN="${USER}"
409 [[ -z "${GROUPS}" ]] && GROUPS="portage"
410 BINGRP="${GROUPS}"
411 fi
412
413 # Must exist before we use it.
414 [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes."
415 cd "${WORKDIR}/include"
416
417 if [[ $(tc-arch-kernel) == "x86_64" ]]; then
418 local MACHINE="amd64"
419 else
420 local MACHINE="$(tc-arch-kernel)"
421 fi
422
423 einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
424 $(freebsd_get_bmake) installincludes \
425 MACHINE=${MACHINE} DESTDIR="${DESTDIR}" \
426 INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
427 BINGRP="${BINGRP}" || die "install_includes() failed"
428 einfo "includes installed ok."
429 }