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

Guillem Jover guillem at alioth.debian.org
Wed Oct 9 05:53:27 UTC 2013


Author: guillem
Date: 2013-10-09 05:53:27 +0000 (Wed, 09 Oct 2013)
New Revision: 5024

Removed:
   trunk/ufsutils/debian/patches/02_badsect.ufs.patch
   trunk/ufsutils/debian/patches/02_dump.ufs.patch
   trunk/ufsutils/debian/patches/02_ffsinfo.patch
   trunk/ufsutils/debian/patches/99_makefiles.patch
Modified:
   trunk/ufsutils/debian/changelog
   trunk/ufsutils/debian/control
   trunk/ufsutils/debian/patches/00_libport.patch
   trunk/ufsutils/debian/patches/01_libufs.patch
   trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
   trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
   trunk/ufsutils/debian/patches/02_fsck.ufs.patch
   trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
   trunk/ufsutils/debian/patches/02_growfs.ufs.patch
   trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
   trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
   trunk/ufsutils/debian/patches/series
   trunk/ufsutils/debian/rules
Log:
Switch to use the upstream build system

This reduces substantially the patchset size. And will make upgrading
the code base to newer versions easier.

Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/changelog	2013-10-09 05:53:27 UTC (rev 5024)
@@ -17,6 +17,8 @@
   * Remove unneeded debian/ufsutils.dirs file.
   * Reword warning about not enabling _FILE_OFFSET_BITS=64 on GNU/kFreeBSD,
     fix typos, and remove repeated text.
+  * Switch to use the upstream build system. Add a Build-Depends on
+    freebsd-buildutils for pmake.
 
  -- Robert Millan <rmh at debian.org>  Thu, 08 Dec 2011 13:40:32 +0100
 

Modified: trunk/ufsutils/debian/control
===================================================================
--- trunk/ufsutils/debian/control	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/control	2013-10-09 05:53:27 UTC (rev 5024)
@@ -4,6 +4,7 @@
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd at lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32 at debian.org>, Guillem Jover <guillem at debian.org>, Robert Millan <rmh at debian.org>
 Build-Depends: dpkg-dev (>= 1.15.7), debhelper (>= 7), pkg-config,
+ freebsd-buildutils,
  libbsd-dev (>= 0.4.0),
  libedit-dev,
  libc0.1-dev (>= 2.10.1) [kfreebsd-any]

Modified: trunk/ufsutils/debian/patches/00_libport.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_libport.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/00_libport.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,10 +1,10 @@
 ---
- lib/port/Makefile       |   12 ++++++
- lib/port/blockdev.c     |   92 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ lib/port/Makefile       |   19 +++++++++
+ lib/port/blockdev.c     |   92 ++++++++++++++++++++++++++++++++++++++++++++++++
  lib/port/blockdev.h     |    8 ++++
  lib/port/getdisklabel.c |    7 +++
- lib/port/port.h         |   22 ++++++++++++
- 5 files changed, 141 insertions(+)
+ lib/port/port.h         |   22 +++++++++++
+ 5 files changed, 148 insertions(+)
 
 --- /dev/null
 +++ b/lib/port/getdisklabel.c
@@ -149,16 +149,23 @@
 +#endif
 --- /dev/null
 +++ b/lib/port/Makefile
-@@ -0,0 +1,12 @@
-+LIB = port
-+LIB_type = static
-+LIBSRCS = blockdev.c getdisklabel.c
+@@ -0,0 +1,19 @@
++# ufsutils local portability library
 +
-+ALL_CFLAGS = -D_LIBPORT
-+ifdef LIBPORT_DEBUG
-+ALL_CFLAGS += -D_LIBPORT_DEBUGGING
-+endif
++LIB=	port
 +
-+INCLUDES =
++# We only want a static library
++NO_PIC=1
 +
-+include ../../Makefile.common
++SRCS=	blockdev.c getdisklabel.c
++INCS=	blockdev.h port.h
++
++WARNS?=	2
++
++CFLAGS+= -D_LIBPORT
++.if defined(LIBPORT_DEBUG)
++CFLAGS+= -D_LIBPORT_DEBUGGING
++.endif
++CFLAGS+= -I${.CURDIR}
++
++.include <bsd.lib.mk>

Modified: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/01_libufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,15 +1,14 @@
 ---
- lib/libufs/Makefile  |   30 ++++++++++--------------------
- lib/libufs/block.c   |    4 ++++
+ lib/libufs/block.c   |    2 ++
  lib/libufs/type.c    |    4 +++-
  sys/ufs/ffs/fs.h     |    5 ++++-
  sys/ufs/ufs/dinode.h |    2 ++
  sys/ufs/ufs/dir.h    |    2 ++
- 6 files changed, 25 insertions(+), 22 deletions(-)
+ 5 files changed, 13 insertions(+), 2 deletions(-)
 
 --- a/lib/libufs/type.c
 +++ b/lib/libufs/type.c
-@@ -111,7 +111,7 @@
+@@ -111,7 +111,7 @@ again:	if ((ret = stat(name, &st)) < 0)
  	if (ret >= 0 && S_ISREG(st.st_mode)) {
  		/* Possibly a disk image, give it a try.  */
  		;
@@ -18,7 +17,7 @@
  		/* This is what we need, do nothing. */
  		;
  	} else if ((fs = getfsfile(name)) != NULL) {
-@@ -134,8 +134,10 @@
+@@ -134,8 +134,10 @@ again:	if ((ret = stat(name, &st)) < 0)
  			ERROR(disk, "could not find special device");
  			return (-1);
  		}
@@ -41,7 +40,7 @@
  /*
   * Each disk drive contains some number of filesystems.
   * A filesystem consists of a number of cylinder groups.
-@@ -504,7 +507,7 @@
+@@ -504,7 +507,7 @@ struct cg {
   * Turn filesystem block numbers into disk block addresses.
   * This maps filesystem blocks to device size blocks.
   */
@@ -72,48 +71,9 @@
  /*
   * Theoretically, directories can be more than 2Gb in length, however, in
   * practice this seems unlikely. So, we define the type doff_t as a 32-bit
---- a/lib/libufs/Makefile
-+++ b/lib/libufs/Makefile
-@@ -1,27 +1,16 @@
- # $FreeBSD$
- 
- LIB=	ufs
--SHLIBDIR?= /lib
-+SHLIB_MAJOR= 2
- 
--SRCS=	block.c cgroup.c inode.c sblock.c type.c
-+LIBSRCS=	block.c cgroup.c inode.c sblock.c type.c
- INCS=	libufs.h
- 
--MAN=	bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
--MLINKS+= bread.3 bwrite.3
--MLINKS+= bread.3 berase.3
--MLINKS+= cgread.3 cgread1.3
--MLINKS+= cgread.3 cgwrite1.3
--MLINKS+= sbread.3 sbwrite.3
--MLINKS+= ufs_disk_close.3 ufs_disk_fillout.3
--MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3
--MLINKS+= ufs_disk_close.3 ufs_disk_write.3
-+LIB_type = static
-+ALL_CFLAGS+= -D_LIBUFS
-+ifdef LIBUFS_DEBUG
-+ALL_CFLAGS+= -D_LIBUFS_DEBUGGING
-+endif
-+INCLUDES = -I.
- 
--WARNS?=	2
--
--CFLAGS+= -D_LIBUFS
--.if defined(LIBUFS_DEBUG)
--CFLAGS+= -D_LIBUFS_DEBUGGING
--.endif
--CFLAGS+= -I${.CURDIR}
--
--.include <bsd.lib.mk>
-+include ../../Makefile.common
 --- a/lib/libufs/block.c
 +++ b/lib/libufs/block.c
-@@ -30,7 +30,9 @@
+@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
  
  #include <sys/param.h>
  #include <sys/mount.h>

Deleted: trunk/ufsutils/debian/patches/02_badsect.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_badsect.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_badsect.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,25 +0,0 @@
----
- sbin/badsect/Makefile |   14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
---- a/sbin/badsect/Makefile
-+++ b/sbin/badsect/Makefile
-@@ -1,9 +1,13 @@
- #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD$
- 
--PROG=	badsect
--DPADD=	${LIBUFS}
--LDADD=	-lufs
--MAN=	badsect.8
-+PROG = badsect.ufs
-+SRCS = badsect.c
-+WARNS = 0
-+MAN = badsect.8:badsect.ufs.8
-+
-+INCLUDES = -I../../lib/libufs
-+LDADD += -L../../lib/libufs -lufs
-+
-+include ../../Makefile.common
- 
--.include <bsd.prog.mk>

Modified: trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,11 +1,10 @@
 ---
- sbin/bsdlabel/Makefile   |   16 ++++++----------
  sbin/bsdlabel/bsdlabel.c |   13 +++++++++++--
- 2 files changed, 17 insertions(+), 12 deletions(-)
+ 1 file changed, 11 insertions(+), 2 deletions(-)
 
 --- a/sbin/bsdlabel/bsdlabel.c
 +++ b/sbin/bsdlabel/bsdlabel.c
-@@ -60,7 +60,9 @@
+@@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$");
  #include <sys/file.h>
  #include <sys/stat.h>
  #include <sys/wait.h>
@@ -15,7 +14,7 @@
  #define DKTYPENAMES
  #define FSTYPENAMES
  #define MAXPARTITIONS	26
-@@ -69,7 +71,7 @@
+@@ -69,7 +71,7 @@ __FBSDID("$FreeBSD$");
  #include <unistd.h>
  #include <string.h>
  #include <stdio.h>
@@ -24,7 +23,7 @@
  #include <stdlib.h>
  #include <signal.h>
  #include <stdarg.h>
-@@ -720,10 +722,12 @@
+@@ -720,10 +722,12 @@ editit(void)
  
  	omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
  	while ((pid = fork()) < 0) {
@@ -37,7 +36,7 @@
  		if (errno != EAGAIN) {
  			warn("fork");
  			return(0);
-@@ -1508,13 +1512,18 @@
+@@ -1508,13 +1512,18 @@ getvirginlabel(void)
  	 * to get any good ideas from the device, construct something
  	 * which is IBM-PC friendly.
  	 */
@@ -57,34 +56,3 @@
  		loclab.d_ntracks = 1;
  	else if (loclab.d_secperunit <= 63*16*1024)
  		loclab.d_ntracks = 16;
---- a/sbin/bsdlabel/Makefile
-+++ b/sbin/bsdlabel/Makefile
-@@ -4,14 +4,8 @@
- .PATH: ${.CURDIR}/../../sys/geom
- 
- PROG=	bsdlabel
--SRCS=	bsdlabel.c geom_bsd_enc.c
--#MAN=	bsdlabel.5
--MAN+=	bsdlabel.8
--
--.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
--LINKS=	${BINDIR}/bsdlabel ${BINDIR}/disklabel
--MLINKS=	bsdlabel.8 disklabel.8
--.endif
-+SRCS=	bsdlabel.c ../../sys/geom/geom_bsd_enc.c
-+MAN = bsdlabel.8:bsdlabel.8
- 
- DPADD=	${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
- LDADD=	-lgeom -lbsdxml -lsbuf
-@@ -19,7 +13,9 @@
- .include <bsd.prog.mk>
- 
- test: ${PROG}
--	sh ${.CURDIR}/runtest.sh
-+	sh ${CURDIR}/runtest.sh
- 
- testx: ${PROG}
--	sh -x ${.CURDIR}/runtest.sh
-+	sh -x ${CURDIR}/runtest.sh
-+
-+include ../../Makefile.common

Deleted: trunk/ufsutils/debian/patches/02_dump.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_dump.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_dump.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,24 +0,0 @@
----
- sbin/dump/Makefile |   11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
---- a/sbin/dump/Makefile
-+++ b/sbin/dump/Makefile
-@@ -15,9 +15,14 @@
- 
- PROG=	dump
- LINKS=	${BINDIR}/dump ${BINDIR}/rdump
--CFLAGS+=-DRDUMP
- SRCS=	itime.c main.c optr.c dumprmt.c tape.c traverse.c unctime.c cache.c
- MAN=	dump.8
--MLINKS=	dump.8 rdump.8
-+MLINKS+=dump.8 rdump.8
-+
-+ALL_CFLAGS = -DRDUMP
-+
-+LDADD += -L../../lib/libufs -lufs -L../../lib/port -lport
-+INCLUDES = -I../../sys -I${CURDIR}/../../libexec/rlogind
-+
-+include ../../Makefile.common
- 
--.include <bsd.prog.mk>

Modified: trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,11 +1,10 @@
 ---
- sbin/dumpfs/Makefile |   14 +++++++++-----
  sbin/dumpfs/dumpfs.c |    1 +
- 2 files changed, 10 insertions(+), 5 deletions(-)
+ 1 file changed, 1 insertion(+)
 
 --- a/sbin/dumpfs/dumpfs.c
 +++ b/sbin/dumpfs/dumpfs.c
-@@ -68,6 +68,7 @@
+@@ -68,6 +68,7 @@ static const char rcsid[] =
  #include <fcntl.h>
  #include <fstab.h>
  #include <libufs.h>
@@ -13,24 +12,3 @@
  #include <stdint.h>
  #include <stdio.h>
  #include <stdlib.h>
---- a/sbin/dumpfs/Makefile
-+++ b/sbin/dumpfs/Makefile
-@@ -1,9 +1,13 @@
- #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD$
- 
--PROG=	dumpfs
--DPADD=	${LIBUFS}
--LDADD=	-lufs
--MAN=	dumpfs.8
-+PROG = dumpfs.ufs
-+SRCS = dumpfs.c
-+WARNS = 0
-+MAN = dumpfs.8:dumpfs.ufs.8
-+
-+LDADD += -L../../lib/libufs/ -lufs
-+INCLUDES = -I../../lib/libufs
-+
-+include ../../Makefile.common
- 
--.include <bsd.prog.mk>

Deleted: trunk/ufsutils/debian/patches/02_ffsinfo.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_ffsinfo.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_ffsinfo.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,30 +0,0 @@
----
- sbin/ffsinfo/Makefile |   18 +++++++-----------
- 1 file changed, 7 insertions(+), 11 deletions(-)
-
---- a/sbin/ffsinfo/Makefile
-+++ b/sbin/ffsinfo/Makefile
-@@ -4,16 +4,12 @@
- # $FreeBSD$
- #
- 
--GROWFS= ${.CURDIR}/../growfs
--.PATH: ${GROWFS}
-+PROG = ffsinfo
-+SRCS = ffsinfo.c ../growfs/debug.c
-+MAN = ffsinfo.8:ffsinfo.8
- 
--PROG=	ffsinfo
--SRCS=	ffsinfo.c debug.c
--MAN=	ffsinfo.8
-+ALL_CFLAGS = -DFS_DEBUG -I../growfs -I../../lib/libufs
-+LDADD += -L../../lib/libufs -lufs
-+
-+include ../../Makefile.common
- 
--WARNS?=	0
--CFLAGS+=-DFS_DEBUG -I${GROWFS}
--DPADD=	${LIBUFS}
--LDADD=	-lufs
-- 
--.include <bsd.prog.mk>               

Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,5 +1,5 @@
 ---
- sbin/fsck_ffs/Makefile    |   27 ++++++++++++-------------
+ sbin/fsck_ffs/Makefile    |    2 -
  sbin/fsck_ffs/ea.c        |    2 -
  sbin/fsck_ffs/fsck.h      |    1 
  sbin/fsck_ffs/fsck_ffs.8  |    7 ++----
@@ -10,7 +10,7 @@
  sbin/fsck_ffs/pass1.c     |    2 +
  sbin/fsck_ffs/setup.c     |   14 +++++++++++++
  sbin/fsck_ffs/utilities.c |    6 +++--
- 11 files changed, 102 insertions(+), 26 deletions(-)
+ 11 files changed, 90 insertions(+), 13 deletions(-)
 
 --- a/sbin/fsck_ffs/gjournal.c
 +++ b/sbin/fsck_ffs/gjournal.c
@@ -24,14 +24,14 @@
  #include <sys/param.h>
  #include <sys/disklabel.h>
  #include <sys/mount.h>
-@@ -774,3 +777,4 @@
+@@ -774,3 +777,4 @@ gjournal_check(const char *filesys)
  	/* Write back updated statistics and super-block. */
  	putdisk();
  }
 +#endif
 --- a/sbin/fsck_ffs/ea.c
 +++ b/sbin/fsck_ffs/ea.c
-@@ -38,7 +38,7 @@
+@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
  
  #include <sys/param.h>
  #include <sys/time.h>
@@ -57,7 +57,7 @@
  .Nd file system consistency check and interactive repair
  .Sh SYNOPSIS
  .Nm
-@@ -349,5 +349,4 @@
+@@ -349,5 +349,4 @@ are fully enumerated and explained in Ap
  .Xr fstab 5 ,
  .Xr fsck 8 ,
  .Xr fsdb 8 ,
@@ -65,7 +65,7 @@
  .Xr reboot 8
 --- a/sbin/fsck_ffs/fsutil.c
 +++ b/sbin/fsck_ffs/fsutil.c
-@@ -38,7 +38,9 @@
+@@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$");
  #include <sys/param.h>
  #include <sys/time.h>
  #include <sys/types.h>
@@ -75,7 +75,7 @@
  #include <sys/disklabel.h>
  #include <sys/stat.h>
  #include <sys/disklabel.h>
-@@ -55,6 +57,7 @@
+@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
  #include <stdint.h>
  #include <stdio.h>
  #include <stdlib.h>
@@ -83,7 +83,7 @@
  #include <unistd.h>
  
  #include "fsck.h"
-@@ -277,11 +280,13 @@
+@@ -277,11 +280,13 @@ ckfini(int markclean)
  	if (bkgrdflag) {
  		unlink(snapname);
  		if ((!(sblock.fs_flags & FS_UNCLEAN)) != markclean) {
@@ -97,7 +97,7 @@
  			if (!preen) {
  				printf("\n***** FILE SYSTEM MARKED %s *****\n",
  				    markclean ? "CLEAN" : "DIRTY");
-@@ -639,7 +644,7 @@
+@@ -639,7 +644,7 @@ getpathname(char *namebuf, ino_t curdir,
  }
  
  void
@@ -106,7 +106,7 @@
  {
  
  	ckfini(0);
-@@ -652,7 +657,7 @@
+@@ -652,7 +657,7 @@ catch(int sig __unused)
   * so that reboot sequence may be interrupted.
   */
  void
@@ -115,7 +115,7 @@
  {
  	printf("returning to single-user after file system check\n");
  	returntosingle = 1;
-@@ -721,11 +726,13 @@
+@@ -721,11 +726,13 @@ pfatal(const char *fmt, ...)
  		 * Force foreground fsck to clean up inconsistency.
  		 */
  		if (bkgrdflag) {
@@ -129,7 +129,7 @@
  			fprintf(stdout, "CANNOT RUN IN BACKGROUND\n");
  			ckfini(0);
  			exit(EEXIT);
-@@ -742,6 +749,7 @@
+@@ -742,6 +749,7 @@ pfatal(const char *fmt, ...)
  	/*
  	 * Force foreground fsck to clean up inconsistency.
  	 */
@@ -137,7 +137,7 @@
  	if (bkgrdflag) {
  		cmd.value = FS_NEEDSFSCK;
  		cmd.size = 1;
-@@ -749,6 +757,7 @@
+@@ -749,6 +757,7 @@ pfatal(const char *fmt, ...)
  		    &cmd, sizeof cmd) == -1)
  			pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n");
  	}
@@ -147,7 +147,7 @@
  }
 --- a/sbin/fsck_ffs/inode.c
 +++ b/sbin/fsck_ffs/inode.c
-@@ -36,7 +36,7 @@
+@@ -36,7 +36,7 @@ static const char sccsid[] = "@(#)inode.
  __FBSDID("$FreeBSD$");
  
  #include <sys/param.h>
@@ -156,7 +156,7 @@
  #include <sys/time.h>
  #include <sys/sysctl.h>
  
-@@ -47,6 +47,7 @@
+@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
  #include <err.h>
  #include <pwd.h>
  #include <string.h>
@@ -166,7 +166,7 @@
  
 --- a/sbin/fsck_ffs/main.c
 +++ b/sbin/fsck_ffs/main.c
-@@ -45,9 +45,17 @@
+@@ -45,9 +45,17 @@ __FBSDID("$FreeBSD$");
  #include <sys/stat.h>
  #include <sys/file.h>
  #include <sys/time.h>
@@ -184,7 +184,7 @@
  #include <sys/uio.h>
  #include <sys/disklabel.h>
  
-@@ -62,14 +70,18 @@
+@@ -62,14 +70,18 @@ __FBSDID("$FreeBSD$");
  #include <paths.h>
  #include <stdint.h>
  #include <string.h>
@@ -204,7 +204,7 @@
  
  int
  main(int argc, char *argv[])
-@@ -79,10 +91,12 @@
+@@ -79,10 +91,12 @@ main(int argc, char *argv[])
  	struct itimerval itimerval;
  	int ret = 0;
  
@@ -218,7 +218,7 @@
  		switch (ch) {
  		case 'b':
  			skipclean = 0;
-@@ -126,6 +140,7 @@
+@@ -126,6 +140,7 @@ main(int argc, char *argv[])
  			yflag = 0;
  			break;
  
@@ -226,7 +226,7 @@
  		case 'p':
  			preen++;
  			/*FALLTHROUGH*/
-@@ -157,7 +172,9 @@
+@@ -157,7 +172,9 @@ main(int argc, char *argv[])
  		(void)signal(SIGINT, catch);
  	if (ckclean)
  		(void)signal(SIGQUIT, catchquit);
@@ -236,7 +236,7 @@
  	if (bkgrdflag) {
  		signal(SIGALRM, alarmhandler);
  		itimerval.it_interval.tv_sec = 5;
-@@ -204,8 +221,10 @@
+@@ -204,8 +221,10 @@ checkfilesys(char *filesys)
  	ufs2_daddr_t n_ffree, n_bfree;
  	struct dups *dp;
  	struct statfs *mntp;
@@ -247,7 +247,7 @@
  	ufs2_daddr_t blks;
  	struct iovec *iov;
  	char errmsg[255];
-@@ -226,10 +245,14 @@
+@@ -226,10 +245,14 @@ checkfilesys(char *filesys)
  	 * if it is listed among the mounted file systems. Failing that
  	 * check to see if it is listed in /etc/fstab.
  	 */
@@ -262,7 +262,7 @@
  		filesys = blockcheck(filesys);
  	/*
  	 * If -F flag specified, check to see whether a background check
-@@ -247,8 +270,10 @@
+@@ -247,8 +270,10 @@ checkfilesys(char *filesys)
  		if ((sblock.fs_flags & FS_DOSOFTDEP) == 0)
  			exit(5);	/* Not running soft updates */
  		size = MIBSIZE;
@@ -273,7 +273,7 @@
  		if ((mntp == NULL && sblock.fs_clean == 1) ||
  		    (mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
  			exit(7);	/* Filesystem clean, report it now */
-@@ -261,6 +286,7 @@
+@@ -261,6 +286,7 @@ checkfilesys(char *filesys)
  		if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
  			exit(3);	/* Cannot read superblock */
  		close(fsreadfd);
@@ -281,7 +281,7 @@
  		if ((sblock.fs_flags & FS_GJOURNAL) != 0) {
  			//printf("GJournaled file system detected on %s.\n",
  			//    filesys);
-@@ -278,6 +304,7 @@
+@@ -278,6 +304,7 @@ checkfilesys(char *filesys)
  				    "CANNOT RUN FAST FSCK\n");
  			}
  		}
@@ -289,7 +289,7 @@
  	}
  	/*
  	 * If we are to do a background check:
-@@ -286,6 +313,7 @@
+@@ -286,6 +313,7 @@ checkfilesys(char *filesys)
  	 *	return created snapshot file
  	 *	if not found, clear bkgrdflag and proceed with normal fsck
  	 */
@@ -297,7 +297,7 @@
  	if (bkgrdflag) {
  		if (mntp == NULL) {
  			bkgrdflag = 0;
-@@ -368,6 +396,7 @@
+@@ -368,6 +396,7 @@ checkfilesys(char *filesys)
  				filesys = snapname;
  		}
  	}
@@ -305,7 +305,7 @@
  
  	switch (setup(filesys)) {
  	case 0:
-@@ -375,7 +404,9 @@
+@@ -375,7 +404,9 @@ checkfilesys(char *filesys)
  			pfatal("CAN'T CHECK FILE SYSTEM.");
  		return (0);
  	case -1:
@@ -315,7 +315,7 @@
  		pwarn("clean, %ld free ", (long)(sblock.fs_cstotal.cs_nffree +
  		    sblock.fs_frag * sblock.fs_cstotal.cs_nbfree));
  		printf("(%lld frags, %lld blocks, %.1f%% fragmentation)\n",
-@@ -395,8 +426,10 @@
+@@ -395,8 +426,10 @@ checkfilesys(char *filesys)
  	 */
  	if (preen == 0) {
  		printf("** Last Mounted on %s\n", sblock.fs_fsmnt);
@@ -326,7 +326,7 @@
  		printf("** Phase 1 - Check Blocks and Sizes\n");
  	}
  	pass1();
-@@ -495,8 +528,13 @@
+@@ -495,8 +528,13 @@ checkfilesys(char *filesys)
  	/*
  	 * Check to see if the file system is mounted read-write.
  	 */
@@ -340,7 +340,7 @@
  	ckfini(resolved);
  
  	for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
-@@ -537,6 +575,8 @@
+@@ -537,6 +575,8 @@ chkdoreload(struct statfs *mntp)
  	 * it unless it is read-write, so we can continue using it
  	 * as safely as possible.
  	 */
@@ -349,7 +349,7 @@
  	if (mntp->f_flags & MNT_RDONLY) {
  		build_iovec(&iov, &iovlen, "fstype", "ffs", 4);
  		build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname,
-@@ -560,8 +600,12 @@
+@@ -560,8 +600,12 @@ chkdoreload(struct statfs *mntp)
  		return (1);
  	}
  	return (0);
@@ -362,7 +362,7 @@
  /*
   * Get the mount point information for name.
   */
-@@ -601,6 +645,7 @@
+@@ -601,6 +645,7 @@ getmntpt(const char *name)
  	statfsp = NULL;
  	return (statfsp);
  }
@@ -372,7 +372,7 @@
  usage(void)
 --- a/sbin/fsck_ffs/pass1.c
 +++ b/sbin/fsck_ffs/pass1.c
-@@ -357,9 +357,11 @@
+@@ -357,9 +357,11 @@ checkinode(ino_t inumber, struct inodesc
  	inoinfo(inumber)->ino_type = IFTODT(mode);
  	badblk = dupblk = 0;
  	idesc->id_number = inumber;
@@ -386,7 +386,7 @@
  	if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) {
 --- a/sbin/fsck_ffs/setup.c
 +++ b/sbin/fsck_ffs/setup.c
-@@ -36,11 +36,14 @@
+@@ -36,11 +36,14 @@ static const char sccsid[] = "@(#)setup.
  __FBSDID("$FreeBSD$");
  
  #include <sys/param.h>
@@ -401,7 +401,7 @@
  
  #include <ufs/ufs/dinode.h>
  #include <ufs/ffs/fs.h>
-@@ -51,6 +54,7 @@
+@@ -51,6 +54,7 @@ __FBSDID("$FreeBSD$");
  #include <limits.h>
  #include <stdint.h>
  #include <string.h>
@@ -409,7 +409,7 @@
  
  #include "fsck.h"
  
-@@ -87,6 +91,7 @@
+@@ -87,6 +91,7 @@ setup(char *dev)
  		}
  		return (0);
  	}
@@ -417,7 +417,7 @@
  	if ((statb.st_mode & S_IFMT) != S_IFCHR &&
  	    (statb.st_mode & S_IFMT) != S_IFBLK) {
  		if (bkgrdflag != 0 && (statb.st_flags & SF_SNAPSHOT) == 0) {
-@@ -121,6 +126,7 @@
+@@ -121,6 +126,7 @@ setup(char *dev)
  			}
  		}
  	}
@@ -425,7 +425,7 @@
  	if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
  		if (bkgrdflag) {
  			unlink(snapname);
-@@ -131,6 +137,7 @@
+@@ -131,6 +137,7 @@ setup(char *dev)
  	}
  	if (bkgrdflag) {
  		unlink(snapname);
@@ -433,7 +433,7 @@
  		size = MIBSIZE;
  		if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0||
  		    sysctlnametomib("vfs.ffs.adjblkcnt", adjblkcnt, &size) < 0||
-@@ -160,6 +167,7 @@
+@@ -160,6 +167,7 @@ setup(char *dev)
  		}
  		cmd.version = FFS_CMD_VERSION;
  		cmd.handle = fsreadfd;
@@ -441,7 +441,7 @@
  		fswritefd = -1;
  	}
  	if (preen == 0)
-@@ -471,6 +479,8 @@
+@@ -471,6 +479,8 @@ calcsb(char *dev, int devfd, struct fs *
  		return (0);
  	}
  	lp = getdisklabel(dev, devfd);
@@ -450,7 +450,7 @@
  	if (isdigit(*cp))
  		pp = &lp->d_partitions[0];
  	else
-@@ -521,13 +531,17 @@
+@@ -521,13 +531,17 @@ calcsb(char *dev, int devfd, struct fs *
  static struct disklabel *
  getdisklabel(char *s, int fd)
  {
@@ -470,7 +470,7 @@
  }
 --- a/sbin/fsck_ffs/utilities.c
 +++ b/sbin/fsck_ffs/utilities.c
-@@ -108,14 +108,16 @@
+@@ -108,14 +108,16 @@ retry:
  	return (origname);
  }
  
@@ -491,39 +491,15 @@
  }
 --- a/sbin/fsck_ffs/Makefile
 +++ b/sbin/fsck_ffs/Makefile
-@@ -1,19 +1,18 @@
- # $FreeBSD$
- #	@(#)Makefile	8.2 (Berkeley) 4/27/95
- 
--PROG=	fsck_ffs
--LINKS+=	${BINDIR}/fsck_ffs ${BINDIR}/fsck_ufs
--LINKS+=	${BINDIR}/fsck_ffs ${BINDIR}/fsck_4.2bsd
--MAN=	fsck_ffs.8
--MLINKS=	fsck_ffs.8 fsck_ufs.8 fsck_ffs.8 fsck_4.2bsd.8
--SRCS=	dir.c ea.c fsutil.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c \
--	pass4.c pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c gjournal.c \
--	getmntopts.c
--DPADD=	${LIBUFS}
+@@ -10,7 +10,7 @@ SRCS=	dir.c ea.c fsutil.c inode.c main.c
+ 	pass4.c pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c gjournal.c \
+ 	getmntopts.c
+ DPADD=	${LIBUFS}
 -LDADD=	-lufs
--WARNS?=	2
--CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mount
-+PROG = fsck.ufs
-+LIB = $(PROG)
-+LIB_type = static
-+SRCS = main.c
-+MAN = fsck_ffs.8:fsck.ufs.8
-+UFS_SRCS = ../../sys/ufs/ffs/ffs_subr.c ../../sys/ufs/ffs/ffs_tables.c
-+LIBSRCS= dir.c ea.c fsutil.c inode.c pass1.c pass1b.c pass2.c pass3.c \
-+	pass4.c pass5.c setup.c utilities.c $(UFS_SRCS) gjournal.c \
-+	../mount/getmntopts.c
++LDADD=	-lport -lufs
+ WARNS?=	2
+ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../mount
  
--.PATH:	${.CURDIR}/../../sys/ufs/ffs ${.CURDIR}/../mount
-+LDADD += -L../../lib/port -lport -L. -l$(LIB) -L../../lib/libufs -lufs
-+INCLUDES = -I. -I../../lib/libufs -I../mount
-+
-+include ../../Makefile.common
- 
--.include <bsd.prog.mk>
 --- a/sbin/fsck_ffs/fsck.h
 +++ b/sbin/fsck_ffs/fsck.h
 @@ -63,6 +63,7 @@

Modified: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,13 +1,13 @@
 ---
- sbin/fsdb/Makefile   |   19 ++++++++-----------
+ sbin/fsdb/Makefile   |    2 +-
  sbin/fsdb/fsdb.8     |    2 +-
  sbin/fsdb/fsdb.c     |   14 +++++++++++++-
  sbin/fsdb/fsdbutil.c |   13 ++++++++++++-
- 4 files changed, 34 insertions(+), 14 deletions(-)
+ 4 files changed, 27 insertions(+), 4 deletions(-)
 
 --- a/sbin/fsdb/fsdb.8
 +++ b/sbin/fsdb/fsdb.8
-@@ -263,7 +263,7 @@
+@@ -263,7 +263,7 @@ There are a bunch of other things that y
  .Nm
  does not implement.
  .Sh WARNING
@@ -18,7 +18,7 @@
  can repair.
 --- a/sbin/fsdb/fsdb.c
 +++ b/sbin/fsdb/fsdb.c
-@@ -35,13 +35,13 @@
+@@ -35,13 +35,13 @@ static const char rcsid[] =
  
  #include <sys/param.h>
  #include <sys/time.h>
@@ -33,7 +33,7 @@
  
  #include <ufs/ufs/dinode.h>
  #include <ufs/ufs/dir.h>
-@@ -60,6 +60,18 @@
+@@ -60,6 +60,18 @@ static int find_blks64(uint64_t *buf, in
  static int find_indirblks32(uint32_t blk, int ind_level, uint32_t *blknum);
  static int find_indirblks64(uint64_t blk, int ind_level, uint64_t *blknum);
  
@@ -54,7 +54,7 @@
  {
 --- a/sbin/fsdb/fsdbutil.c
 +++ b/sbin/fsdb/fsdbutil.c
-@@ -41,7 +41,6 @@
+@@ -41,7 +41,6 @@ static const char rcsid[] =
  #include <stdint.h>
  #include <string.h>
  #include <time.h>
@@ -62,7 +62,7 @@
  
  #include <ufs/ufs/dinode.h>
  #include <ufs/ffs/fs.h>
-@@ -51,6 +50,18 @@
+@@ -51,6 +50,18 @@ static const char rcsid[] =
  #include "fsdb.h"
  #include "fsck.h"
  
@@ -83,27 +83,12 @@
  static void printblocks(ino_t inum, union dinode *dp);
 --- a/sbin/fsdb/Makefile
 +++ b/sbin/fsdb/Makefile
-@@ -2,15 +2,12 @@
- #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD$
- 
--PROG=	fsdb
--MAN=	fsdb.8
--SRCS=	fsdb.c fsdbutil.c \
--	dir.c ea.c fsutil.c inode.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
--	pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c
--CFLAGS+= -I${.CURDIR}/../fsck_ffs
--WARNS?= 2
+@@ -9,7 +9,7 @@ SRCS=	fsdb.c fsdbutil.c \
+ 	pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c
+ CFLAGS+= -I${.CURDIR}/../fsck_ffs
+ WARNS?= 2
 -LDADD=	-ledit -ltermcap
--DPADD=	${LIBEDIT} ${LIBTERMCAP}
--.PATH:	${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs
-+PROG = fsdb.ufs
-+MAN = fsdb.8:fsdb.ufs.8
-+SRCS = fsdb.c fsdbutil.c
-+WARNS = 0
-+LDADD += -ledit -L../../lib/libufs -lufs -L../fsck_ffs -lfsck.ufs
-+DPADD += ${LIBEDIT}
-+INCLUDES = -I../fsck_ffs
++LDADD=	-ledit
+ DPADD=	${LIBEDIT} ${LIBTERMCAP}
+ .PATH:	${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs
  
--.include <bsd.prog.mk>
-+include ../../Makefile.common

Modified: trunk/ufsutils/debian/patches/02_growfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_growfs.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_growfs.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,11 +1,10 @@
 ---
- sbin/growfs/Makefile |   16 ++++++++++------
  sbin/growfs/growfs.c |    8 +++++++-
- 2 files changed, 17 insertions(+), 7 deletions(-)
+ 1 file changed, 7 insertions(+), 1 deletion(-)
 
 --- a/sbin/growfs/growfs.c
 +++ b/sbin/growfs/growfs.c
-@@ -51,10 +51,10 @@
+@@ -51,10 +51,10 @@ __FBSDID("$FreeBSD$");
  
  /* ********************************************************** INCLUDES ***** */
  #include <sys/param.h>
@@ -17,7 +16,7 @@
  
  #include <stdio.h>
  #include <paths.h>
-@@ -1925,10 +1925,12 @@
+@@ -1925,10 +1925,12 @@ get_dev_size(int fd, int *size)
     int sectorsize;
     off_t mediasize;
  
@@ -30,7 +29,7 @@
  
     if (sectorsize <= 0)
         errx(1, "bogus sectorsize: %d", sectorsize);
-@@ -2285,9 +2287,11 @@
+@@ -2285,9 +2287,11 @@ return_disklabel(int fd, struct disklabe
  		}
  		lp->d_checksum=sum;
  
@@ -42,7 +41,7 @@
  	}
  	free(lp);
  
-@@ -2311,8 +2315,10 @@
+@@ -2311,8 +2315,10 @@ get_disklabel(int fd)
  	if (!lab)
  		errx(1, "malloc failed");
  
@@ -53,28 +52,3 @@
  
      unlabeled++;
  
---- a/sbin/growfs/Makefile
-+++ b/sbin/growfs/Makefile
-@@ -6,12 +6,16 @@
- 
- #GFSDBG=
- 
--PROG=   growfs
-+PROG=	growfs.ufs
- SRCS=   growfs.c
--MAN=	growfs.8
-+MAN=	growfs.8:growfs.ufs.8
- 
--.if defined(GFSDBG)
--SRCS+=  debug.c
--.endif  
-+ifdef GFSDBG
-+SRCS +=  debug.c
-+ALL_CFLAGS = -DFS_DEBUG
-+endif
- 
--.include <bsd.prog.mk>      
-+LDADD += -L../../lib/libufs -lufs
-+INCLUDES =
-+
-+include ../../Makefile.common

Modified: trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_mkfs.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_mkfs.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,13 +1,13 @@
 ---
- sbin/newfs/Makefile |   22 ++++++++++------------
+ sbin/newfs/Makefile |    3 ++-
  sbin/newfs/mkfs.c   |    1 +
  sbin/newfs/newfs.8  |    4 ++--
  sbin/newfs/newfs.c  |   22 ++++++++++++++++++----
- 4 files changed, 31 insertions(+), 18 deletions(-)
+ 4 files changed, 23 insertions(+), 7 deletions(-)
 
 --- a/sbin/newfs/mkfs.c
 +++ b/sbin/newfs/mkfs.c
-@@ -53,6 +53,7 @@
+@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
  #include <stdint.h>
  #include <stdio.h>
  #include <unistd.h>
@@ -17,7 +17,7 @@
  #include <sys/types.h>
 --- a/sbin/newfs/newfs.c
 +++ b/sbin/newfs/newfs.c
-@@ -55,7 +55,9 @@
+@@ -55,7 +55,9 @@ __FBSDID("$FreeBSD$");
   */
  #include <sys/param.h>
  #include <sys/stat.h>
@@ -27,7 +27,7 @@
  #include <sys/disklabel.h>
  #include <sys/file.h>
  #include <sys/mount.h>
-@@ -133,6 +135,8 @@
+@@ -133,6 +135,8 @@ main(int argc, char *argv[])
  	off_t mediasize;
  	char part_name;		/* partition name, default to full disk */
  
@@ -36,7 +36,7 @@
  	part_name = 'c';
  	reserved = 0;
  	while ((ch = getopt(argc, argv,
-@@ -303,8 +307,9 @@
+@@ -303,8 +307,9 @@ main(int argc, char *argv[])
  	}
  	if (fstat(disk.d_fd, &st) < 0)
  		err(1, "%s", special);
@@ -48,7 +48,7 @@
  		is_file = 1;	/* assume it is a file */
  		dkname = special;
  		if (sectorsize == 0)
-@@ -312,10 +317,15 @@
+@@ -312,10 +317,15 @@ main(int argc, char *argv[])
  		mediasize = st.st_size;
  		/* set fssize from the partition */
  	} else {
@@ -65,7 +65,7 @@
  		getfssize(&fssize, special, mediasize / sectorsize, reserved);
  	}
  	pp = NULL;
-@@ -370,7 +380,7 @@
+@@ -370,7 +380,7 @@ main(int argc, char *argv[])
  			pp->p_size *= secperblk;
  	}
  	mkfs(pp, special);
@@ -74,7 +74,7 @@
  		if (realsectorsize != DEV_BSIZE)
  			pp->p_size /= realsectorsize / DEV_BSIZE;
  		if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
-@@ -415,8 +425,10 @@
+@@ -415,8 +425,10 @@ getdisklabel(char *s)
  		return &lab;
  	}
  
@@ -85,7 +85,7 @@
  	unlabeled++;
  	if (disktype) {
  		lp = getdiskbyname(disktype);
-@@ -441,8 +453,10 @@
+@@ -441,8 +453,10 @@ rewritelabel(char *s, struct disklabel *
  			errx(1, "cannot write label");
  		return;
  	}
@@ -98,40 +98,19 @@
  static void
 --- a/sbin/newfs/Makefile
 +++ b/sbin/newfs/Makefile
-@@ -1,20 +1,18 @@
- #	@(#)Makefile	8.2 (Berkeley) 3/27/94
- # $FreeBSD$
+@@ -5,7 +5,8 @@
  
--.PATH: ${.CURDIR}/../../sys/geom
--
--PROG=	newfs
--DPADD=	${LIBUFS}
+ PROG=	newfs
+ DPADD=	${LIBUFS}
 -LDADD=	-lufs
--SRCS=	newfs.c mkfs.c geom_bsd_enc.c
--
-+PROG=	mkfs.ufs
-+SRCS=	newfs.c mkfs.c ../../sys/geom/geom_bsd_enc.c
- WARNS?=	2
--MAN=	newfs.8
-+MAN=	newfs.8:mkfs.ufs.8
-+
-+LDADD += -L../../lib/libufs -lufs -L../../lib/port -lport
-+INCLUDES = -I../../lib/libufs -include ../../lib/port/blockdev.h
++LDADD=	-lufs -lport
++CFLAGS+= -include ../../lib/port/blockdev.h
+ SRCS=	newfs.c mkfs.c geom_bsd_enc.c
  
--.include <bsd.prog.mk>
-+include ../../Makefile.common
- 
- test:	${PROG}
--	sh ${.CURDIR}/runtest01.sh 
--	sh ${.CURDIR}/runtest00.sh | tee _.test
--	diff --ignore-matching-lines=FreeBSD _.test ${.CURDIR}/ref.test
-+	sh ${CURDIR}/runtest01.sh
-+	sh ${CURDIR}/runtest00.sh | tee _.test
-+	diff --ignore-matching-lines=FreeBSD _.test ${CURDIR}/ref.test
- 	echo All Tests Passed
+ WARNS?=	2
 --- a/sbin/newfs/newfs.8
 +++ b/sbin/newfs/newfs.8
-@@ -78,10 +78,10 @@
+@@ -78,10 +78,10 @@ The following options define the general
  .It Fl E
  Erase the content of the disk before making the filesystem.
  The reserved area in front of the superblock (for bootcode) will not be erased.

Modified: trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_tunefs.ufs.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/02_tunefs.ufs.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,11 +1,10 @@
 ---
- sbin/tunefs/Makefile |   13 ++++++++-----
  sbin/tunefs/tunefs.c |   15 +++++++++++++++
- 2 files changed, 23 insertions(+), 5 deletions(-)
+ 1 file changed, 15 insertions(+)
 
 --- a/sbin/tunefs/tunefs.c
 +++ b/sbin/tunefs/tunefs.c
-@@ -48,8 +48,15 @@
+@@ -48,8 +48,15 @@ __FBSDID("$FreeBSD$");
  #include <sys/mount.h>
  #include <sys/disklabel.h>
  #include <sys/stat.h>
@@ -21,7 +20,7 @@
  #include <ufs/ufs/dinode.h>
  #include <ufs/ffs/fs.h>
  
-@@ -84,8 +91,12 @@
+@@ -84,8 +91,12 @@ main(int argc, char *argv[])
  	int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue;
  	int ch, found_arg, i;
  	const char *chg[2];
@@ -34,7 +33,7 @@
  
  	if (argc < 3)
  		usage();
-@@ -253,9 +264,11 @@
+@@ -253,9 +264,11 @@ main(int argc, char *argv[])
  		goto err;
  	if (disk.d_name != special) {
  		special = disk.d_name;
@@ -46,7 +45,7 @@
  	}
  
  	if (pflag) {
-@@ -440,6 +453,7 @@
+@@ -440,6 +453,7 @@ main(int argc, char *argv[])
  	if (sbwrite(&disk, Aflag) == -1)
  		goto err;
  	ufs_disk_close(&disk);
@@ -54,7 +53,7 @@
  	if (active) {
  		bzero(&args, sizeof(args));
  		if (mount("ufs", on,
-@@ -447,6 +461,7 @@
+@@ -447,6 +461,7 @@ main(int argc, char *argv[])
  			err(9, "%s: reload", special);
  		warnx("file system reloaded");
  	}
@@ -62,23 +61,3 @@
  	exit(0);
  err:
  	if (disk.d_error != NULL)
---- a/sbin/tunefs/Makefile
-+++ b/sbin/tunefs/Makefile
-@@ -1,9 +1,12 @@
- #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD$
- 
--PROG=	tunefs
--DPADD=	${LIBUFS}
--LDADD=	-lufs
--MAN=	tunefs.8
-+PROG = tunefs.ufs
-+SRCS = tunefs.c
-+MAN = tunefs.8:tunefs.ufs.8
-+
-+LDADD += -L../../lib/libufs -lufs
-+INCLUDES = -I../../lib/libufs
-+
-+include ../../Makefile.common
- 
--.include <bsd.prog.mk>

Deleted: trunk/ufsutils/debian/patches/99_makefiles.patch
===================================================================
--- trunk/ufsutils/debian/patches/99_makefiles.patch	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/99_makefiles.patch	2013-10-09 05:53:27 UTC (rev 5024)
@@ -1,128 +0,0 @@
----
- Makefile        |   27 ++++++++++++++++
- Makefile.common |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 118 insertions(+)
-
---- /dev/null
-+++ b/Makefile
-@@ -0,0 +1,27 @@
-+#
-+# ufsutils Makefile
-+#
-+
-+#SUBDIRS = sbin/dump
-+SUBDIRS = lib/port lib/libufs sbin/badsect sbin/dumpfs sbin/fsck_ffs \
-+	  sbin/fsdb sbin/growfs sbin/newfs sbin/tunefs sbin/ffsinfo
-+
-+clean_targets = $(addsuffix -clean,$(SUBDIRS))
-+install_targets = $(addsuffix -install,$(SUBDIRS))
-+
-+all: $(SUBDIRS)
-+
-+$(SUBDIRS):
-+	$(MAKE) -C $@
-+
-+clean: $(clean_targets)
-+
-+$(clean_targets):
-+	$(MAKE) -C $(subst -clean,,$@) clean
-+
-+install: $(install_targets)
-+
-+$(install_targets):
-+	$(MAKE) -C $(subst -install,,$@) install
-+
-+.PHONY: all clean install $(SUBDIRS) $(clean_targets) $(install_targets)
---- /dev/null
-+++ b/Makefile.common
-@@ -0,0 +1,90 @@
-+#
-+# $Id: Makefile.common 45 2004-05-03 11:07:29Z guillem $
-+#
-+
-+prefix = /usr/local
-+exec_prefix = $(prefix)
-+sbindir = $(exec_prefix)/sbin
-+libdir = $(exec_prefix)/lib
-+datadir = $(prefix)/share
-+mandir = $(datadir)/man
-+man8dir = $(mandir)/man8
-+
-+CFLAGS ?= -Wall -g -O2
-+ALL_CFLAGS +=  -I../../sys -I../../lib/port -include port.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
-+
-+INSTALL = install
-+INSTALL_PROG = $(INSTALL)
-+INSTALL_DATA = $(INSTALL) -m 644
-+
-+ifdef PROG
-+OBJS = $(SRCS:.c=.o)
-+endif
-+
-+ifdef LIB
-+LIBSOBJS = $(LIBSRCS:.c=.lo)
-+LIBOBJS = $(LIBSRCS:.c=.o)
-+
-+ifndef LIB_type
-+LIB_type = static shared
-+endif
-+
-+SHLIB_MAJOR ?= 0
-+SHLIB_SONAME = lib$(LIB).so.$(SHLIB_MAJOR)
-+endif
-+
-+# General rules
-+
-+%.lo: %.c
-+	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -DPIC -fPIC -c $<
-+
-+%.o: %.c
-+	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -c $<
-+
-+# Objectives
-+
-+all:: libs $(PROG)
-+
-+$(PROG):: $(OBJS)
-+	$(CC) -o $@ $(LDFLAGS) $^ $(LDADD)
-+
-+ifneq (,$(findstring static,$(LIB_type)))
-+LIB_targets += lib$(LIB).a
-+endif
-+ifneq (,$(findstring shared,$(LIB_type)))
-+LIB_targets += lib$(LIB).so
-+endif
-+
-+libs:: $(LIB_targets)
-+
-+lib$(LIB).so:: $(SHLIB_SONAME)
-+	ln -fs $^ $@
-+
-+$(SHLIB_SONAME):: $(LIBSOBJS)
-+	gcc $(LDFLAGS) -shared -Wl,-soname -Wl,$(SHLIB_SONAME) -o $@ $^ $(LDADD)
-+
-+lib$(LIB).a:: $(LIBOBJS)
-+	ar rcs $@ $^
-+
-+# General targets
-+
-+clean::
-+	rm -f $(OBJS) $(PROG)
-+	rm -f $(LIBSOBJS) $(LIBOBJS)
-+	rm -f $(SHLIB_SONAME) lib$(LIB).so lib$(LIB).a
-+
-+install::
-+ifdef PROG
-+	$(INSTALL_PROG) $(PROG) $(DESTDIR)$(sbindir)
-+endif
-+ifdef MAN
-+	$(INSTALL_DATA) $(subst :, $(DESTDIR)$(man8dir)/,$(MAN))
-+endif
-+ifneq (,$(findstring static,$(LIB_type)))
-+	$(INSTALL_DATA) lib$(LIB).a $(DESTDIR)$(libdir)/lib$(LIB).a
-+endif
-+ifneq (,$(findstring shared,$(LIB_type)))
-+	$(INSTALL_DATA) lib$(LIB).so $(DESTDIR)$(libdir)/lib$(LIB).so
-+	$(INSTALL_DATA) $(SHLIB_SONAME) $(DESTDIR)$(libdir)/$(SHLIB_SONAME)
-+endif

Modified: trunk/ufsutils/debian/patches/series
===================================================================
--- trunk/ufsutils/debian/patches/series	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/patches/series	2013-10-09 05:53:27 UTC (rev 5024)
@@ -5,11 +5,8 @@
 00_param.patch
 00_portable_ufs_types.patch
 01_libufs.patch
-02_badsect.ufs.patch
 02_bsdlabel.ufs.patch
-02_dump.ufs.patch
 02_dumpfs.ufs.patch
-02_ffsinfo.patch
 02_fsck.ufs.patch
 02_fsdb.ufs.patch
 02_growfs.ufs.patch
@@ -18,4 +15,3 @@
 03_ufsmount.patch
 04_avoid_diocgdelete.patch
 05_wipe_otherfs.patch
-99_makefiles.patch

Modified: trunk/ufsutils/debian/rules
===================================================================
--- trunk/ufsutils/debian/rules	2013-10-09 05:53:22 UTC (rev 5023)
+++ trunk/ufsutils/debian/rules	2013-10-09 05:53:27 UTC (rev 5024)
@@ -7,13 +7,16 @@
 #export DH_VERBOSE=1
 
 DESTDIR = $(CURDIR)/debian/tmp
+libdir := $(DESTDIR)/lib
+sbindir := $(DESTDIR)/sbin
+man8dir := $(DESTDIR)/usr/share/man/man8
 
 DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
 CFLAGS := -Wall -Werror=implicit-function-declaration \
+          $(shell dpkg-buildflags --get CPPFLAGS) \
           $(shell dpkg-buildflags --get CFLAGS) \
           $(shell pkg-config --cflags libbsd-overlay)
-CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
 LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) \
            $(shell pkg-config --libs libbsd-overlay)
 
@@ -23,6 +26,28 @@
 CFLAGS += -D_FILE_OFFSET_BITS=64
 endif
 
+CFLAGS += -I$(CURDIR)/lib/port -include port.h \
+          -I$(CURDIR)/sys -I$(CURDIR)/lib/libufs \
+          -D_GNU_SOURCE
+LDFLAGS += -L$(CURDIR)/lib/port -L$(CURDIR)/lib/libufs
+
+PATH := /usr/lib/freebsd:$(PATH)
+PMAKE = CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+        NO_WERROR=1 NO_SHARED=NO NO_PROFILE=1 NO_PIC=1 WARNS=0 \
+        DESTDIR=$(DESTDIR) make
+
+SRCDIRS := \
+  lib/libufs \
+  sbin/badsect \
+  sbin/dumpfs \
+  sbin/ffsinfo \
+  sbin/fsck_ffs \
+  sbin/fsdb \
+  sbin/growfs \
+  sbin/newfs \
+  sbin/tunefs \
+  $(nil)
+
 SOURCE = $(shell dpkg-parsechangelog | sed -e '/^Source:/!d' -e 's/^Source: //g')
 VERSION = $(shell dpkg-parsechangelog | sed -e '/^Version:/!d' -e 's/^Version: //g' -e 's/-.*//g')
 SVN = http://svn.freebsd.org/base/release/$(VERSION).0
@@ -32,9 +57,12 @@
 get-orig-source:
 	rm -rf $(ORIGDIR)
 	mkdir -p $(ORIGDIR)/sys/sys $(ORIGDIR)/sys/geom
-	for i in sbin/badsect sbin/dump sbin/dumpfs sbin/fsck_ffs sbin/fsdb \
-		 sbin/growfs sbin/newfs sbin/tunefs sbin/bsdlabel \
-		 sbin/sunlabel sbin/ffsinfo sbin/mount lib/libufs sys/ufs \
+	for i in $(SRCDIRS) \
+		 sbin/bsdlabel \
+		 sbin/dump \
+		 sbin/mount \
+		 sbin/sunlabel \
+		 sys/ufs \
 		 sys/geom/geom_bsd_enc.c \
 		 sys/sys/disklabel.h sys/sys/mount.h sys/sys/param.h \
 		 sys/sys/ucred.h ; \
@@ -49,7 +77,10 @@
 build-arch:
 	dh_testdir
 
-	CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
+	$(PMAKE) -C lib/port
+	for d in $(SRCDIRS); do \
+		$(PMAKE) -C $$d; \
+	done
 
 build: build-indep build-arch
 
@@ -59,7 +90,10 @@
 	dh_testdir
 	dh_testroot
 
-	[ ! -f Makefile ] || $(MAKE) clean
+	[ ! -f lib/port/Makefile ] || $(PMAKE) -C lib/port clean
+	for d in $(SRCDIRS); do \
+		$(PMAKE) -C $$d clean; \
+	done
 
 	dh_clean
 
@@ -71,12 +105,39 @@
 	dh_prep
 	dh_installdirs
 
-	mkdir -p $(DESTDIR)/lib
-	mkdir -p $(DESTDIR)/sbin
-	mkdir -p $(DESTDIR)/usr/share/man/man8
+	mkdir -p $(libdir)
+	mkdir -p $(sbindir)
+	mkdir -p $(man8dir)
 
-	$(MAKE) install DESTDIR=$(DESTDIR) prefix=/usr exec_prefix=/
+	for d in $(SRCDIRS); do \
+		$(PMAKE) -C $$d install BINDIR=/sbin SHLIBDIR=/lib; \
+	done
 
+	# Rename files
+	mv $(sbindir)/badsect	$(sbindir)/badsect.ufs
+	mv $(sbindir)/dumpfs	$(sbindir)/dumpfs.ufs
+	mv $(sbindir)/fsck_ffs	$(sbindir)/fsck.ufs
+	mv $(sbindir)/fsdb	$(sbindir)/fsdb.ufs
+	mv $(sbindir)/growfs	$(sbindir)/growfs.ufs
+	mv $(sbindir)/newfs	$(sbindir)/mkfs.ufs
+	mv $(sbindir)/tunefs	$(sbindir)/tunefs.ufs
+
+	# Remove hardlinks
+	rm $(sbindir)/fsck_4.2bsd
+	rm $(sbindir)/fsck_ufs
+
+	mv $(man8dir)/badsect.8.gz	$(man8dir)/badsect.ufs.8.gz
+	mv $(man8dir)/dumpfs.8.gz	$(man8dir)/dumpfs.ufs.8.gz
+	mv $(man8dir)/fsck_ffs.8.gz	$(man8dir)/fsck.ufs.8.gz
+	mv $(man8dir)/fsdb.8.gz		$(man8dir)/fsdb.ufs.8.gz
+	mv $(man8dir)/growfs.8.gz	$(man8dir)/growfs.ufs.8.gz
+	mv $(man8dir)/newfs.8.gz	$(man8dir)/mkfs.ufs.8.gz
+	mv $(man8dir)/tunefs.8.gz	$(man8dir)/tunefs.ufs.8.gz
+
+	# Remove broken symlinks
+	rm $(man8dir)/fsck_4.2bsd.8.gz
+	rm $(man8dir)/fsck_ufs.8.gz
+
 install: install-indep install-arch
 
 .PHONY: clean install-indep install-arch install




More information about the Glibc-bsd-commits mailing list