[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

A couple of packaging refreshments for ufsutils



Hi,

First of all, many thanks for maintaining the ufsutils and all the other
FreeBSD/kFreeBSD-related packages!

What do you think about the attached series of patches that aim to
refresh the ufsutils packaging a little bit? :)

Thanks again for all you're all doing for Debian, and keep up the good work!

G'luck,
Peter

PS. I'm not subscribed to the list.

-- 
Peter Pentchev	roam@ringlet.net roam@FreeBSD.org peter@packetscale.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
What would this sentence be like if it weren't self-referential?
From fe7efe91ac01dca93ee5904bb7a1c746df202903 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 11:55:26 +0300
Subject: [PATCH 01/15] Refresh the patches before the 3.0 (quilt) conversion.

---
 debian/patches/00_mount.patch       |   10 +++++-----
 debian/patches/00_param.patch       |    8 ++++----
 debian/patches/01_libufs.patch      |    4 ++--
 debian/patches/02_badsect.ufs.patch |    2 +-
 debian/patches/02_dumpfs.ufs.patch  |    4 ++--
 debian/patches/02_ffsinfo.patch     |    2 +-
 debian/patches/02_fsck.ufs.patch    |   18 ++++++++++--------
 debian/patches/02_fsdb.ufs.patch    |    2 +-
 debian/patches/02_mkfs.ufs.patch    |    2 +-
 debian/patches/02_tunefs.ufs.patch  |    2 +-
 10 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/debian/patches/00_mount.patch b/debian/patches/00_mount.patch
index 71d1135..bbe0507 100644
--- a/debian/patches/00_mount.patch
+++ b/debian/patches/00_mount.patch
@@ -35,7 +35,7 @@ Index: ufsutils/freebsd/sys/mount.h
  #define	STATFS_VERSION	0x20030518	/* current version number */
  struct statfs {
  	uint32_t f_version;		/* structure version number */
-@@ -216,6 +213,7 @@
+@@ -224,6 +221,7 @@
  } while (0)
  
  #endif /* _KERNEL */
@@ -43,7 +43,7 @@ Index: ufsutils/freebsd/sys/mount.h
  
  /*
   * User specifiable flags.
-@@ -391,6 +389,7 @@
+@@ -404,6 +402,7 @@
  	char		*np_index;	/* Index file */
  };
  
@@ -51,7 +51,7 @@ Index: ufsutils/freebsd/sys/mount.h
  /*
   * Filesystem configuration information. One of these exists for each
   * type of filesystem supported by the kernel. These are searched at
-@@ -428,6 +427,7 @@
+@@ -441,6 +440,7 @@
  	int	vfc_flags;
  };
  #endif
@@ -59,7 +59,7 @@ Index: ufsutils/freebsd/sys/mount.h
  
  /*
   * NB: these flags refer to IMPLEMENTATION properties, not properties of
-@@ -492,6 +492,7 @@
+@@ -505,6 +505,7 @@
  #define VQ_FLAG4000	0x4000	/* placeholder */
  #define VQ_FLAG8000	0x8000	/* placeholder */
  
@@ -67,7 +67,7 @@ Index: ufsutils/freebsd/sys/mount.h
  #ifdef _KERNEL
  /* Point a sysctl request at a vfsidctl's data. */
  #define VCTLTOREQ(vc, req)						\
-@@ -753,5 +754,5 @@
+@@ -766,5 +767,5 @@
  __END_DECLS
  
  #endif /* _KERNEL */
diff --git a/debian/patches/00_param.patch b/debian/patches/00_param.patch
index 930fbda..57fa7f5 100644
--- a/debian/patches/00_param.patch
+++ b/debian/patches/00_param.patch
@@ -46,7 +46,7 @@ Index: ufsutils/freebsd/sys/param.h
  
  #define	NBBY	8		/* number of bits in a byte */
  #define	NBPW	sizeof(int)	/* number of bytes per word (integer) */
-@@ -256,6 +264,7 @@
+@@ -258,6 +266,7 @@
  #define	MIN(a,b) (((a)<(b))?(a):(b))
  #define	MAX(a,b) (((a)>(b))?(a):(b))
  
@@ -54,9 +54,9 @@ Index: ufsutils/freebsd/sys/param.h
  #ifdef _KERNEL
  /*
   * Basic byte order function prototypes for non-inline functions.
-@@ -319,4 +328,5 @@
- #define __OpenSolaris_version 20060731
- #endif
+@@ -305,4 +314,5 @@
+ #define ctodb(db)			/* calculates pages to devblks */ \
+ 	((db) << (PAGE_SHIFT - DEV_BSHIFT))
  
 +#endif
  #endif	/* _SYS_PARAM_H_ */
diff --git a/debian/patches/01_libufs.patch b/debian/patches/01_libufs.patch
index a052de3..d86a8d2 100644
--- a/debian/patches/01_libufs.patch
+++ b/debian/patches/01_libufs.patch
@@ -36,7 +36,7 @@ Index: ufsutils/include/ufs/ffs/fs.h
  /*
   * Each disk drive contains some number of filesystems.
   * A filesystem consists of a number of cylinder groups.
-@@ -502,7 +502,7 @@
+@@ -502,7 +505,7 @@
   * Turn filesystem block numbers into disk block addresses.
   * This maps filesystem blocks to device size blocks.
   */
@@ -76,7 +76,7 @@ Index: ufsutils/libufs/Makefile
 --- ufsutils.orig/libufs/Makefile
 +++ ufsutils/libufs/Makefile
 @@ -1,26 +1,17 @@
- # $FreeBSD: src/lib/libufs/Makefile,v 1.14.8.1 2009/04/15 03:14:26 kensmith Exp $
+ # $FreeBSD: src/lib/libufs/Makefile,v 1.14.10.1 2010/02/10 00:26:20 kensmith Exp $
  
  LIB=	ufs
 -SHLIBDIR?= /lib
diff --git a/debian/patches/02_badsect.ufs.patch b/debian/patches/02_badsect.ufs.patch
index 4c961c9..9da6b58 100644
--- a/debian/patches/02_badsect.ufs.patch
+++ b/debian/patches/02_badsect.ufs.patch
@@ -4,7 +4,7 @@ Index: ufsutils/badsect.ufs/Makefile
 +++ ufsutils/badsect.ufs/Makefile
 @@ -1,9 +1,13 @@
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD: src/sbin/badsect/Makefile,v 1.8 2003/02/22 21:33:42 johan Exp $
+ # $FreeBSD: src/sbin/badsect/Makefile,v 1.8.36.1 2010/02/10 00:26:20 kensmith Exp $
  
 -PROG=	badsect
 -DPADD=	${LIBUFS}
diff --git a/debian/patches/02_dumpfs.ufs.patch b/debian/patches/02_dumpfs.ufs.patch
index a9c54e8..499e271 100644
--- a/debian/patches/02_dumpfs.ufs.patch
+++ b/debian/patches/02_dumpfs.ufs.patch
@@ -2,7 +2,7 @@ Index: ufsutils/dumpfs.ufs/dumpfs.c
 ===================================================================
 --- ufsutils.orig/dumpfs.ufs/dumpfs.c
 +++ ufsutils/dumpfs.ufs/dumpfs.c
-@@ -62,6 +62,7 @@
+@@ -68,6 +68,7 @@
  #include <fcntl.h>
  #include <fstab.h>
  #include <libufs.h>
@@ -16,7 +16,7 @@ Index: ufsutils/dumpfs.ufs/Makefile
 +++ ufsutils/dumpfs.ufs/Makefile
 @@ -1,9 +1,13 @@
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD: src/sbin/dumpfs/Makefile,v 1.9 2003/11/14 13:13:23 johan Exp $
+ # $FreeBSD: src/sbin/dumpfs/Makefile,v 1.9.34.1 2010/02/10 00:26:20 kensmith Exp $
  
 -PROG=	dumpfs
 -DPADD=	${LIBUFS}
diff --git a/debian/patches/02_ffsinfo.patch b/debian/patches/02_ffsinfo.patch
index 389f0bf..027f94a 100644
--- a/debian/patches/02_ffsinfo.patch
+++ b/debian/patches/02_ffsinfo.patch
@@ -3,7 +3,7 @@ Index: ufsutils/ffsinfo/Makefile
 --- ufsutils.orig/ffsinfo/Makefile
 +++ ufsutils/ffsinfo/Makefile
 @@ -4,16 +4,12 @@
- # $FreeBSD: src/sbin/ffsinfo/Makefile,v 1.7 2004/04/01 20:31:48 johan Exp $
+ # $FreeBSD: src/sbin/ffsinfo/Makefile,v 1.7.32.1 2010/02/10 00:26:20 kensmith Exp $
  #
  
 -GROWFS= ${.CURDIR}/../growfs
diff --git a/debian/patches/02_fsck.ufs.patch b/debian/patches/02_fsck.ufs.patch
index 23d920d..042a624 100644
--- a/debian/patches/02_fsck.ufs.patch
+++ b/debian/patches/02_fsck.ufs.patch
@@ -4,7 +4,7 @@ Index: ufsutils/fsck.ufs/gjournal.c
 +++ ufsutils/fsck.ufs/gjournal.c
 @@ -54,6 +54,9 @@
  #include <sys/cdefs.h>
- __FBSDID("$FreeBSD: src/sbin/fsck_ffs/gjournal.c,v 1.2.8.1 2009/04/15 03:14:26 kensmith Exp $");
+ __FBSDID("$FreeBSD: src/sbin/fsck_ffs/gjournal.c,v 1.2.2.1.2.1 2010/02/10 00:26:20 kensmith Exp $");
  
 +
 +#if HAVE_UFS_SNAPSHOT
@@ -35,7 +35,7 @@ Index: ufsutils/fsck.ufs/fsck_ffs.8
 --- ufsutils.orig/fsck.ufs/fsck_ffs.8
 +++ ufsutils/fsck.ufs/fsck_ffs.8
 @@ -30,11 +30,11 @@
- .\" $FreeBSD: src/sbin/fsck_ffs/fsck_ffs.8,v 1.34.2.5.2.2 2009/04/27 19:15:33 delphij Exp $
+ .\" $FreeBSD: src/sbin/fsck_ffs/fsck_ffs.8,v 1.34.2.6.2.1 2010/02/10 00:26:20 kensmith Exp $
  .\"
  .Dd January 25, 2009
 -.Dt FSCK_FFS 8
@@ -144,7 +144,7 @@ Index: ufsutils/fsck.ufs/inode.c
 --- ufsutils.orig/fsck.ufs/inode.c
 +++ ufsutils/fsck.ufs/inode.c
 @@ -36,7 +36,7 @@
- __FBSDID("$FreeBSD: src/sbin/fsck_ffs/inode.c,v 1.38.2.1.2.1 2009/04/15 03:14:26 kensmith Exp $");
+ __FBSDID("$FreeBSD: src/sbin/fsck_ffs/inode.c,v 1.38.2.1.4.1 2010/02/10 00:26:20 kensmith Exp $");
  
  #include <sys/param.h>
 -#include <sys/stdint.h>
@@ -396,7 +396,7 @@ Index: ufsutils/fsck.ufs/pass1.c
 ===================================================================
 --- ufsutils.orig/fsck.ufs/pass1.c
 +++ ufsutils/fsck.ufs/pass1.c
-@@ -317,9 +317,11 @@
+@@ -319,9 +319,11 @@
  	inoinfo(inumber)->ino_type = IFTODT(mode);
  	badblk = dupblk = 0;
  	idesc->id_number = inumber;
@@ -413,7 +413,7 @@ Index: ufsutils/fsck.ufs/setup.c
 --- ufsutils.orig/fsck.ufs/setup.c
 +++ ufsutils/fsck.ufs/setup.c
 @@ -36,11 +36,14 @@
- __FBSDID("$FreeBSD: src/sbin/fsck_ffs/setup.c,v 1.50.2.2.2.2 2009/04/27 19:15:33 delphij Exp $");
+ __FBSDID("$FreeBSD: src/sbin/fsck_ffs/setup.c,v 1.50.2.3.2.1 2010/02/10 00:26:20 kensmith Exp $");
  
  #include <sys/param.h>
 +#include <sys/types.h>
@@ -522,7 +522,7 @@ Index: ufsutils/fsck.ufs/Makefile
 --- ufsutils.orig/fsck.ufs/Makefile
 +++ ufsutils/fsck.ufs/Makefile
 @@ -1,19 +1,18 @@
- # $FreeBSD: src/sbin/fsck_ffs/Makefile,v 1.18.8.1 2009/04/15 03:14:26 kensmith Exp $
+ # $FreeBSD: src/sbin/fsck_ffs/Makefile,v 1.18.12.1 2010/02/10 00:26:20 kensmith Exp $
  #	@(#)Makefile	8.2 (Berkeley) 4/27/95
  
 -PROG=	fsck_ffs
@@ -554,8 +554,10 @@ Index: ufsutils/fsck.ufs/Makefile
 +include ../Makefile.common
  
 -.include <bsd.prog.mk>
---- a/fsck.ufs/fsck.h
-+++ b/fsck.ufs/fsck.h
+Index: ufsutils/fsck.ufs/fsck.h
+===================================================================
+--- ufsutils.orig/fsck.ufs/fsck.h
++++ ufsutils/fsck.ufs/fsck.h
 @@ -63,6 +63,7 @@
  #include <unistd.h>
  #include <stdlib.h>
diff --git a/debian/patches/02_fsdb.ufs.patch b/debian/patches/02_fsdb.ufs.patch
index c210835..e92d5a1 100644
--- a/debian/patches/02_fsdb.ufs.patch
+++ b/debian/patches/02_fsdb.ufs.patch
@@ -86,7 +86,7 @@ Index: ufsutils/fsdb.ufs/Makefile
 +++ ufsutils/fsdb.ufs/Makefile
 @@ -2,15 +2,13 @@
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD: src/sbin/fsdb/Makefile,v 1.19 2004/10/09 15:56:34 le Exp $
+ # $FreeBSD: src/sbin/fsdb/Makefile,v 1.19.24.1 2010/02/10 00:26:20 kensmith Exp $
  
 -PROG=	fsdb
 -MAN=	fsdb.8
diff --git a/debian/patches/02_mkfs.ufs.patch b/debian/patches/02_mkfs.ufs.patch
index 397bc61..3ecd6a5 100644
--- a/debian/patches/02_mkfs.ufs.patch
+++ b/debian/patches/02_mkfs.ufs.patch
@@ -111,7 +111,7 @@ Index: ufsutils/mkfs.ufs/Makefile
 +++ ufsutils/mkfs.ufs/Makefile
 @@ -1,17 +1,20 @@
  #	@(#)Makefile	8.2 (Berkeley) 3/27/94
- # $FreeBSD: src/sbin/newfs/Makefile,v 1.22 2003/02/11 03:06:45 jmallett Exp $
+ # $FreeBSD: src/sbin/newfs/Makefile,v 1.22.34.1 2010/02/10 00:26:20 kensmith Exp $
  
 -PROG=	newfs
 -DPADD=	${LIBUFS}
diff --git a/debian/patches/02_tunefs.ufs.patch b/debian/patches/02_tunefs.ufs.patch
index 44b6066..2dae56b 100644
--- a/debian/patches/02_tunefs.ufs.patch
+++ b/debian/patches/02_tunefs.ufs.patch
@@ -65,7 +65,7 @@ Index: ufsutils/tunefs.ufs/Makefile
 +++ ufsutils/tunefs.ufs/Makefile
 @@ -1,9 +1,12 @@
  #	@(#)Makefile	8.1 (Berkeley) 6/5/93
- # $FreeBSD: src/sbin/tunefs/Makefile,v 1.8 2003/01/23 08:15:05 ru Exp $
+ # $FreeBSD: src/sbin/tunefs/Makefile,v 1.8.36.1 2010/02/10 00:26:20 kensmith Exp $
  
 -PROG=	tunefs
 -DPADD=	${LIBUFS}
-- 
1.7.4.1

From 5c482d7b992d50c50b428ab84ef68e7e5f7611b4 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 12:24:36 +0300
Subject: [PATCH 02/15] Convert to the 3.0 (quilt) source format.

---
 debian/README.source |   57 --------------------------------------------------
 debian/control       |    2 +-
 debian/rules         |    7 +-----
 debian/source/format |    1 +
 4 files changed, 3 insertions(+), 64 deletions(-)
 delete mode 100644 debian/README.source
 create mode 100644 debian/source/format

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 8646078..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,57 +0,0 @@
-This package uses quilt to manage all modifications to the upstream
-source.  Changes are stored in the source package as diffs in
-debian/patches and applied during the build.
-
-To configure quilt to use debian/patches instead of patches, you want
-either to export QUILT_PATCHES=debian/patches in your environment
-or use this snippet in your ~/.quiltrc:
-
-    for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
-        if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
-                export QUILT_PATCHES=debian/patches
-        fi
-    done
-
-To get the fully patched source after unpacking the source package, cd to
-the root level of the source package and run:
-
-    quilt push -a
-
-The last patch listed in debian/patches/series will become the current
-patch.
-
-To add a new set of changes, first run quilt push -a, and then run:
-
-    quilt new <patch>
-
-where <patch> is a descriptive name for the patch, used as the filename in
-debian/patches.  Then, for every file that will be modified by this patch,
-run:
-
-    quilt add <file>
-
-before editing those files.  You must tell quilt with quilt add what files
-will be part of the patch before making changes or quilt will not work
-properly.  After editing the files, run:
-
-    quilt refresh
-
-to save the results as a patch.
-
-Alternately, if you already have an external patch and you just want to
-add it to the build system, run quilt push -a and then:
-
-    quilt import -P <patch> /path/to/patch
-    quilt push -a
-
-(add -p 0 to quilt import if needed). <patch> as above is the filename to
-use in debian/patches.  The last quilt push -a will apply the patch to
-make sure it works properly.
-
-To remove an existing patch from the list of patches that will be applied,
-run:
-
-    quilt delete <patch>
-
-You may need to run quilt pop -a to unapply patches first before running
-this command.
diff --git a/debian/control b/debian/control
index 3feedcb..65bc44e 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 7), quilt, libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
+Build-Depends: debhelper (>= 7), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
 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.4
diff --git a/debian/rules b/debian/rules
index 3f0b846..598558e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-this = $(MAKE) -f debian/rules
 lib = libufs2
 
 DESTDIR = $(CURDIR)/debian/tmp
@@ -29,9 +28,7 @@ else
 	CFLAGS += -O2
 endif
 
-include /usr/share/quilt/quilt.make
-
-build: patch
+build:
 	dh_testdir
 	
 	CFLAGS="$(CFLAGS)" LDADD="$(LDADD)" $(MAKE)
@@ -42,8 +39,6 @@ clean:
 	
 	[ ! -f Makefile ] || $(MAKE) clean
 	
-	$(this) unpatch
-	
 	dh_clean
 
 install: build
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
-- 
1.7.4.1

From 85ed8353a9e4aad792901e3e56e56c26b2e055c1 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 12:52:34 +0300
Subject: [PATCH 03/15] Honor CPPFLAGS and LDFLAGS; do not link with CFLAGS.

---
 debian/patches/99_makefiles.patch |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/patches/99_makefiles.patch b/debian/patches/99_makefiles.patch
index da2dfba..4846c03 100644
--- a/debian/patches/99_makefiles.patch
+++ b/debian/patches/99_makefiles.patch
@@ -76,17 +76,17 @@ Index: ufsutils/Makefile.common
 +# General rules
 +
 +%.lo: %.c
-+	$(CC) -o $@ $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -DPIC -fPIC -c $<
++	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -DPIC -fPIC -c $<
 +
 +%.o: %.c
-+	$(CC) -o $@ $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -c $<
++	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $(CFLAGS) $(INCLUDES) -c $<
 +
 +# Objectives
 +
 +all:: libs $(PROG)
 +
 +$(PROG):: $(OBJS)
-+	$(CC) -o $@ $(ALL_CFLAGS) $(CFLAGS) $^ $(LDADD)
++	$(CC) -o $@ $(LDFLAGS) $^ $(LDADD)
 +
 +ifneq (,$(findstring static,$(LIB_type)))
 +LIB_targets += lib$(LIB).a
@@ -101,7 +101,7 @@ Index: ufsutils/Makefile.common
 +	ln -fs $^ $@
 +
 +$(SHLIB_SONAME):: $(LIBSOBJS)
-+	gcc -shared -Wl,-soname -Wl,$(SHLIB_SONAME) -o $@ $^ $(LDADD)
++	gcc $(LDFLAGS) -shared -Wl,-soname -Wl,$(SHLIB_SONAME) -o $@ $^ $(LDADD)
 +
 +lib$(LIB).a:: $(LIBOBJS)
 +	ar rcs $@ $^
-- 
1.7.4.1

From 22260a7d0543f29f06ed8bd690563245a58a8e6c Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 12:53:14 +0300
Subject: [PATCH 04/15] Use dpkg-buildflags to get CFLAGS, CPPFLAGS and LDFLAGS.

---
 debian/control |    2 +-
 debian/rules   |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/debian/control b/debian/control
index 65bc44e..660fbc1 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 7), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
+Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
 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.4
diff --git a/debian/rules b/debian/rules
index 598558e..c4f00f9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,11 @@ lib = libufs2
 
 DESTDIR = $(CURDIR)/debian/tmp
 
-CFLAGS = -Wall -g
+CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
+CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+
+CFLAGS += -Wall
 
 DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
@@ -22,16 +26,12 @@ ifneq (kfreebsd,$(DEB_HOST_ARCH_OS))
 CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CURDIR)/freebsd
 endif
 
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
+export CPPFLAGS CFLAGS LDFLAGS
 
 build:
 	dh_testdir
 	
-	CFLAGS="$(CFLAGS)" LDADD="$(LDADD)" $(MAKE)
+	$(MAKE)
 
 clean:
 	dh_testdir
-- 
1.7.4.1

From 74bc4e3440477a5a9fb9478f31fad64af1b8126c Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:08:57 +0300
Subject: [PATCH 05/15] Remove the duplicate section "utils".

---
 debian/control |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 660fbc1..67bc8eb 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,6 @@ Standards-Version: 3.8.4
 
 Package: ufsutils
 Architecture: any
-Section: utils
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Provides: fsck-backend
 Conflicts: hurd
-- 
1.7.4.1

From 7cc5dbbd5c881018ec905e774194671ff71966df Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:19:47 +0300
Subject: [PATCH 06/15] Convert the copyright file to the DEP 5 format.

As part of this conversion, drop the BSD common-license reference.
---
 debian/copyright |   37 +++++++++++++++----------------------
 1 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index 2d90cd3..2f2f4ba 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,20 +1,13 @@
-This package was debianized by Guillem Jover <guillem@debian.org> on
-Fri, 30 Apr 2004 06:35:50 +0200.
-
-The debian packages are maintained through Subversion on:
-
-    <svn://svn.debian.org/glibc-bsd/>
-
-The upstream source was downloaded and packaged from the FreeBSD CVS.
-Take a look at the debian/upstream.sh script.
-
-Upstream Authors:
-
-    The FreeBSD Project
-    Ported by Guillem Jover <guillem@debian.org>
-
+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=173
+Upstream-Name: FreeBSD
+Upstream-Contact: The FreeBSD Project
+Source: http://www.FreeBSD.org/
+Comment:
+ The upstream source was downloaded and packaged from the FreeBSD CVS.
+ Take a look at the debian/upstream.sh script.
+
+Files: *
 Copyright:
-
     Copyright (c) 1980-1983, 1985-1994 The Regents of the University of
     California.
     Copyright (c) 1994 Theo de Raadt
@@ -30,12 +23,16 @@ Copyright:
     Copyright (c) 2002-2003 Networks Associates Technology, Inc.
     Copyright (c) 2004 Guillem Jover
     Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
+License: BSD
 
-License:
+Files: debian/*
+Copyright: 2004-2011 Guillem Jover <guillem@debian.org>
+License: BSD
 
+License: BSD
     Redistribution and use in source and binary forms, with or without
     modification, are permitted under the terms of the BSD License.
-
+    .
     THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -47,7 +44,3 @@ License:
     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.
-
-On Debian systems, the complete text of the BSD License can be
-found in `/usr/share/common-licenses/BSD'.
-
-- 
1.7.4.1

From 877135e5c584dda5dfaac75b3163e0178561cc54 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:24:23 +0300
Subject: [PATCH 07/15] dpkg-dev knows about Package-Type now.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 67bc8eb..7de0fa5 100644
--- a/debian/control
+++ b/debian/control
@@ -28,7 +28,7 @@ Description: UFS filesystems utilities
   * ffsinfo
 
 Package: ufsutils-udeb
-XC-Package-Type: udeb
+Package-Type: udeb
 Architecture: kfreebsd-any
 Section: debian-installer
 Depends: ${shlibs:Depends}, ${misc:Depends}
-- 
1.7.4.1

From 55b96d189e416612cb4cc9fdce4fffe8c12b6d30 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:28:36 +0300
Subject: [PATCH 08/15] Move the upstream source comment to the watch file.

---
 debian/copyright |    3 ---
 debian/watch     |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
 create mode 100644 debian/watch

diff --git a/debian/copyright b/debian/copyright
index 2f2f4ba..bcc3c05 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,9 +2,6 @@ Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=173
 Upstream-Name: FreeBSD
 Upstream-Contact: The FreeBSD Project
 Source: http://www.FreeBSD.org/
-Comment:
- The upstream source was downloaded and packaged from the FreeBSD CVS.
- Take a look at the debian/upstream.sh script.
 
 Files: *
 Copyright:
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..9e8de23
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+# The upstream source was downloaded and packaged from the FreeBSD CVS.
+# Take a look at the debian/upstream.sh script.
-- 
1.7.4.1

From c66b748208c90cd5681d4c56942b98bba72e8fc7 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:40:56 +0300
Subject: [PATCH 09/15] Bump Standards-Version to 3.9.1 with no changes.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 7de0fa5..c45bb24 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.or
 Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
 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.4
+Standards-Version: 3.9.1
 
 Package: ufsutils
 Architecture: any
-- 
1.7.4.1

From 5dd17168cbd68b62c081ef9b776679ee69383bcc Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 13:42:45 +0300
Subject: [PATCH 10/15] Drop the version on the libc0.1-dev dependency.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index c45bb24..e1f4422 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev (>= 2.10.1) [kfreebsd-any]
+Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.9.1
-- 
1.7.4.1

From c1ee853b11ee779dd4d3a4b7f65e38e01ecce3dd Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 16:15:24 +0300
Subject: [PATCH 11/15] Shorten the rules file by using the dh(1) helper.

---
 debian/rules |   39 ++++++---------------------------------
 1 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/debian/rules b/debian/rules
index c4f00f9..ad6e0d5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,8 +6,6 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-lib = libufs2
-
 DESTDIR = $(CURDIR)/debian/tmp
 
 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
@@ -29,29 +27,18 @@ endif
 export CPPFLAGS CFLAGS LDFLAGS
 
 build:
-	dh_testdir
-	
-	$(MAKE)
+	dh $@
 
 clean:
-	dh_testdir
-	dh_testroot
-	
-	[ ! -f Makefile ] || $(MAKE) clean
-	
-	dh_clean
+	dh $@
 
 install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-	
+	dh $@ --before auto_install
 	mkdir -p $(DESTDIR)/lib
 	mkdir -p $(DESTDIR)/sbin
 	mkdir -p $(DESTDIR)/usr/share/man/man8
-	
-	$(MAKE) install DESTDIR=$(DESTDIR) prefix=/usr exec_prefix=/
+	dh_auto_install -- prefix=/usr exec_prefix=/
+	dh $@ --remaining
 
 # Build architecture-independent files here.
 binary-indep:
@@ -59,21 +46,7 @@ binary-indep:
 
 # Build architecture-dependent files here.
 binary-arch: install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs -s
-	dh_installdocs -s
-	dh_install -s --sourcedir=debian/tmp
-	dh_installman -s
-	dh_link -s
-	dh_strip -s
-	dh_compress -s
-	dh_fixperms -s
-	dh_installdeb -s
-	dh_shlibdeps -s
-	dh_gencontrol -s
-	dh_md5sums -s
-	dh_builddeb -s
+	dh $@
 
 binary: binary-indep binary-arch
 
-- 
1.7.4.1

From 6c1242b6fe87560d035120b8585577d33fdf8795 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 17:21:41 +0300
Subject: [PATCH 12/15] Minimize the rules file by using debhelper overrides.

---
 debian/control |    2 +-
 debian/rules   |   22 ++--------------------
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/debian/control b/debian/control
index e1f4422..5282c2f 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
+Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.9.1
diff --git a/debian/rules b/debian/rules
index ad6e0d5..8f4eea1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,29 +26,11 @@ endif
 
 export CPPFLAGS CFLAGS LDFLAGS
 
-build:
-	dh $@
-
-clean:
-	dh $@
-
-install: build
-	dh $@ --before auto_install
+override_dh_auto_install:
 	mkdir -p $(DESTDIR)/lib
 	mkdir -p $(DESTDIR)/sbin
 	mkdir -p $(DESTDIR)/usr/share/man/man8
 	dh_auto_install -- prefix=/usr exec_prefix=/
-	dh $@ --remaining
 
-# Build architecture-independent files here.
-binary-indep:
-	# Nothing to do.
-
-# Build architecture-dependent files here.
-binary-arch: install
+%:
 	dh $@
-
-binary: binary-indep binary-arch
-
-.PHONY: build clean binary-indep binary-arch binary install
-
-- 
1.7.4.1

From 76efabe483ead94fd958cd0aa6c9499eb7fbc712 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 17:30:40 +0300
Subject: [PATCH 13/15] Bump the debhelper compat level to 8 with no changes.

---
 debian/compat  |    2 +-
 debian/control |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/compat b/debian/compat
index 7f8f011..45a4fb7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+8
diff --git a/debian/control b/debian/control
index 5282c2f..6da6053 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
+Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.9.1
-- 
1.7.4.1

From 83b74f4259e19ebe7ad4eca0207e611ca8acf853 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 17:37:39 +0300
Subject: [PATCH 14/15] Depend on libncurses-dev instead of libncurses5-dev.

---
 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 6da6053..1df06b0 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses5-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
+Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.9.1
-- 
1.7.4.1

From a375d4bc35b9f6900bc406314af2ca33d9b9dc76 Mon Sep 17 00:00:00 2001
From: Peter Pentchev <roam@ringlet.net>
Date: Wed, 30 Mar 2011 17:41:10 +0300
Subject: [PATCH 15/15] Harden the build by default.

This produces a harmless warning about ignoring the result from fgets();
since fgets() will always null-terminate the buffer, even on EOF, and
the next line runs a strcmp() on the buffer, this is indeed not a problem.
---
 debian/control |    2 +-
 debian/rules   |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
index 1df06b0..ea36426 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
-Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), libedit-dev, libncurses-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
+Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), hardening-includes, libedit-dev, libncurses-dev, libbsd-dev, libc0.1-dev [kfreebsd-any]
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/ufsutils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/ufsutils/
 Standards-Version: 3.9.1
diff --git a/debian/rules b/debian/rules
index 8f4eea1..927b364 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,6 +24,12 @@ ifneq (kfreebsd,$(DEB_HOST_ARCH_OS))
 CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CURDIR)/freebsd
 endif
 
+include /usr/share/hardening-includes/hardening.make
+ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
+CFLAGS+=	$(HARDENING_CFLAGS)
+LDFLAGS+=	$(HARDENING_LDFLAGS)
+endif
+
 export CPPFLAGS CFLAGS LDFLAGS
 
 override_dh_auto_install:
-- 
1.7.4.1

Attachment: signature.asc
Description: Digital signature


Reply to: