[Glibc-bsd-commits] r2683 - in trunk/ufsutils/debian: . patches

Aurelien Jarno aurel32 at alioth.debian.org
Thu Jul 30 12:27:55 UTC 2009


Author: aurel32
Date: 2009-07-30 12:27:54 +0000 (Thu, 30 Jul 2009)
New Revision: 2683

Added:
   trunk/ufsutils/debian/patches/04_sysctlnametomib.patch
Modified:
   trunk/ufsutils/debian/changelog
   trunk/ufsutils/debian/control
   trunk/ufsutils/debian/patches/02_fsck.ufs.patch
   trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
   trunk/ufsutils/debian/patches/99_makefiles.patch
   trunk/ufsutils/debian/patches/series
   trunk/ufsutils/debian/rules
Log:
  * Add patches/04_sysctlnametomib.patch to avoid linking with libfreebsd.



Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/changelog	2009-07-30 12:27:54 UTC (rev 2683)
@@ -4,6 +4,7 @@
     experimental package.
   * Remove the libufs2 library and link statically instead. It is small, not
     really usable, and anyway comes without -dev package.
+  * Add patches/04_sysctlnametomib.patch to avoid linking with libfreebsd.
   * Bump Standard-Versions to 3.8.2 (no changes).
 
  -- Aurelien Jarno <aurel32 at debian.org>  Thu, 30 Jul 2009 13:57:13 +0200

Modified: trunk/ufsutils/debian/control
===================================================================
--- trunk/ufsutils/debian/control	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/control	2009-07-30 12:27:54 UTC (rev 2683)
@@ -3,8 +3,7 @@
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd at lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32 at debian.org>, Guillem Jover <guillem at debian.org>
-Build-Depends: debhelper (>= 7), quilt, libedit-dev, libncurses5-dev,
- libfreebsd-dev [kfreebsd-i386 kfreebsd-amd64], libbsd-dev
+Build-Depends: debhelper (>= 7), quilt, libedit-dev, libncurses5-dev, libbsd-dev
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.8.2

Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2009-07-30 12:27:54 UTC (rev 2683)
@@ -548,7 +548,7 @@
 +	../mount/getmntopts.c
  
 -.PATH:	${.CURDIR}/../../sys/ufs/ffs ${.CURDIR}/../mount
-+LDADD += -L../libport -lport -L. -l$(LIB) -L../libufs -lufs -lbsd -lfreebsd
++LDADD += -L../libport -lport -L. -l$(LIB) -L../libufs -lufs -lbsd
 +INCLUDES = -I. -I../libufs -I../mount
 +
 +include ../Makefile.common

Modified: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2009-07-30 12:27:54 UTC (rev 2683)
@@ -102,7 +102,7 @@
 +MAN = fsdb.8:fsdb.ufs.8
 +SRCS = fsdb.c fsdbutil.c
 +WARNS = 0
-+LDADD += -ledit -ltermcap -L../libufs -lufs -lbsd -L../fsck.ufs -lfsck.ufs -lfreebsd
++LDADD += -ledit -ltermcap -L../libufs -lufs -lbsd -L../fsck.ufs -lfsck.ufs
 +DPADD += ${LIBEDIT} ${LIBTERMCAP}
 +INCLUDES = -I../fsck.ufs
  

Added: trunk/ufsutils/debian/patches/04_sysctlnametomib.patch
===================================================================
--- trunk/ufsutils/debian/patches/04_sysctlnametomib.patch	                        (rev 0)
+++ trunk/ufsutils/debian/patches/04_sysctlnametomib.patch	2009-07-30 12:27:54 UTC (rev 2683)
@@ -0,0 +1,83 @@
+# This patch is a hack until we get sysctlnametomib() in glibc. It
+# should be removed and replaced with a build-depends on libc0.1-dev 
+# (>= 2.10) when available.
+
+--- /dev/null
++++ b/libport/sysctlnametomib.c
+@@ -0,0 +1,55 @@
++/*
++ * Copyright 2001 The FreeBSD Project. All Rights Reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY
++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED.  IN NO EVENT SHALL THE FREEBSD PROJECT BE LIABLE FOR
++ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#ifdef __FreeBSD_kernel__
++
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <string.h>
++
++/*
++ * This function uses a presently undocumented interface to the kernel
++ * to walk the tree and get the type so it can print the value.
++ * This interface is under work and consideration, and should probably
++ * be killed with a big axe by the first person who can find the time.
++ * (be aware though, that the proper interface isn't as obvious as it
++ * may seem, there are various conflicting requirements.
++ */
++int
++sysctlnametomib(const char *name, int *mibp, size_t *sizep)
++{
++	int oid[2];
++	int error;
++
++	oid[0] = 0;
++	oid[1] = 3;
++
++	*sizep *= sizeof (int);
++	error = sysctl(oid, 2, mibp, sizep, (void *)name, strlen(name));
++	*sizep /= sizeof (int);
++	return (error);
++}
++#endif
+--- a/libport/Makefile
++++ b/libport/Makefile
+@@ -1,6 +1,6 @@
+ LIB = port
+ LIB_type = static
+-LIBSRCS = blockdev.c
++LIBSRCS = blockdev.c sysctlnametomib.c
+ 
+ ALL_CFLAGS = -D_LIBPORT
+ ifdef LIBPORT_DEBUG
+--- a/fsdb.ufs/Makefile
++++ b/fsdb.ufs/Makefile
+@@ -6,7 +6,7 @@
+ MAN = fsdb.8:fsdb.ufs.8
+ SRCS = fsdb.c fsdbutil.c
+ WARNS = 0
+-LDADD += -ledit -ltermcap -L../libufs -lufs -lbsd -L../fsck.ufs -lfsck.ufs
++LDADD += -ledit -ltermcap -L../libufs -lufs -lbsd -L../fsck.ufs -lfsck.ufs -L../libport -lport
+ DPADD += ${LIBEDIT} ${LIBTERMCAP}
+ INCLUDES = -I../fsck.ufs
+ 

Modified: trunk/ufsutils/debian/patches/99_makefiles.patch
===================================================================
--- trunk/ufsutils/debian/patches/99_makefiles.patch	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/patches/99_makefiles.patch	2009-07-30 12:27:54 UTC (rev 2683)
@@ -48,7 +48,7 @@
 +mandir = $(datadir)/man
 +man8dir = $(mandir)/man8
 +
-+#LDADD += -lbsd -lfreebsd
++#LDADD += -lbsd
 +CFLAGS ?= -Wall -g -O2
 +ALL_CFLAGS += -I../include -include port/port.h -include bsd/bsd.h -D_GNU_SOURCE
 +# -DHAVE_BSD_ERRNO -DHAVE_BSD_SIGNALS -DHAVE_BSD_STATFS -DHAVE_BSD_DISKLABEL -DHAVE_BSD_MOUNT -DHAVE_UFS_SNAPSHOT -DHAVE_BSD_SYSCTL

Modified: trunk/ufsutils/debian/patches/series
===================================================================
--- trunk/ufsutils/debian/patches/series	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/patches/series	2009-07-30 12:27:54 UTC (rev 2683)
@@ -15,4 +15,5 @@
 02_mkfs.ufs.patch
 02_tunefs.ufs.patch
 03_ufsmount.patch
+04_sysctlnametomib.patch
 99_makefiles.patch

Modified: trunk/ufsutils/debian/rules
===================================================================
--- trunk/ufsutils/debian/rules	2009-07-30 11:59:11 UTC (rev 2682)
+++ trunk/ufsutils/debian/rules	2009-07-30 12:27:54 UTC (rev 2683)
@@ -15,10 +15,9 @@
 
 DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
-# on GNU/kFreeBSD we need additional library
-ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
-LDADD += -lfreebsd
-else
+# GNU/kFreeBSD already have off_t 64bit. It must not be enabled,
+# as it would change size of ino_t
+ifneq (kfreebsd,$(DEB_HOST_ARCH_OS))
 # really only on other systems, as GNU/kFreeBSD already have off_t 64bit
 # on GNU/kFreeBSD it must not be enabled, as it would change size of ino_t
 CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CURDIR)/freebsd




More information about the Glibc-bsd-commits mailing list