[Glibc-bsd-commits] r6070 - trunk/zfsutils/debian

stevenc-guest at alioth.debian.org stevenc-guest at alioth.debian.org
Thu Jun 9 23:41:44 UTC 2016


Author: stevenc-guest
Date: 2016-06-09 23:41:44 +0000 (Thu, 09 Jun 2016)
New Revision: 6070

Modified:
   trunk/zfsutils/debian/changelog
   trunk/zfsutils/debian/compat
   trunk/zfsutils/debian/control
   trunk/zfsutils/debian/rules
Log:
Merge packaging improvements from freebsd-utils:
* Now using debhelper compat v9
* Now using Standards-Version 3.9.8 (no changes needed).
* Add Build-Depends: dpkg-dev (>= 1.16.1.1) and use buildflags.mk
  to set CFLAGS, respecting DEB_BUILD_OPTIONS flags such as noopt
* Enable hardening=+all, which includes PIE, relro and stack protector
* Use architecture.mk instead of individual calls to dpkg-architecture
* Use new preferred hostname for upstream SVN with HTTPS
  (svn.freebsd.org).
* Make get-orig-source tarball reproducible
* Use the proper host architecture compiler


Modified: trunk/zfsutils/debian/changelog
===================================================================
--- trunk/zfsutils/debian/changelog	2016-06-09 23:28:19 UTC (rev 6069)
+++ trunk/zfsutils/debian/changelog	2016-06-09 23:41:44 UTC (rev 6070)
@@ -26,6 +26,16 @@
   * Abort on any error during svn export
   * Rename ztest executable to zfstest, to avoid conflict with zutils
     (Closes: #825268)
+  * Now using debhelper compat v9
+  * Now using Standards-Version 3.9.8 (no changes needed).
+  * Add Build-Depends: dpkg-dev (>= 1.16.1.1) and use buildflags.mk
+    to set CFLAGS, respecting DEB_BUILD_OPTIONS flags such as noopt
+  * Enable hardening=+all, which includes PIE, relro and stack protector
+  * Use architecture.mk instead of individual calls to dpkg-architecture
+  * Use new preferred hostname for upstream SVN with HTTPS
+    (svn.freebsd.org).
+  * Make get-orig-source tarball reproducible
+  * Use the proper host architecture compiler
 
   [ Guillem Jover ]
   * Switch to use system libmd

Modified: trunk/zfsutils/debian/compat
===================================================================
--- trunk/zfsutils/debian/compat	2016-06-09 23:28:19 UTC (rev 6069)
+++ trunk/zfsutils/debian/compat	2016-06-09 23:41:44 UTC (rev 6070)
@@ -1 +1 @@
-7
+9

Modified: trunk/zfsutils/debian/control
===================================================================
--- trunk/zfsutils/debian/control	2016-06-09 23:28:19 UTC (rev 6069)
+++ trunk/zfsutils/debian/control	2016-06-09 23:41:44 UTC (rev 6070)
@@ -7,7 +7,8 @@
  Robert Millan <rmh at debian.org>,
  Arno Töll <arno at debian.org>,
  Steven Chamberlain <steven at pyro.eu.org>,
-Build-Depends: debhelper (>= 7.0.50~),
+Build-Depends: debhelper (>= 9),
+ dpkg-dev (>= 1.16.1.1),
  freebsd-buildutils (>= 9.0-5~),
  libbsd-dev (>= 0.3.0),
  libmd-dev,
@@ -19,7 +20,7 @@
  systemtap-sdt-dev
 Vcs-Browser: http://anonscm.debian.org/viewvc/glibc-bsd/trunk/zfsutils/
 Vcs-Svn: svn://anonscm.debian.org/glibc-bsd/trunk/zfsutils/
-Standards-Version: 3.9.3
+Standards-Version: 3.9.8
 
 Package: libuutil2
 Section: libs

Modified: trunk/zfsutils/debian/rules
===================================================================
--- trunk/zfsutils/debian/rules	2016-06-09 23:28:19 UTC (rev 6069)
+++ trunk/zfsutils/debian/rules	2016-06-09 23:41:44 UTC (rev 6070)
@@ -1,26 +1,45 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 # Sample debian/rules that uses debhelper.
-SHELL=bash
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export SHELL = bash
 
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
-CFLAGS = -Wall -Wno-unknown-pragmas -g -pipe -fPIC -I. \
-         -D_GNU_SOURCE -DNEED_SOLARIS_BOOLEAN \
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+full_version	:= $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g')
+tar_version	:= $(shell echo $(full_version) | sed -e 's/-.*//g')
+svn_revision	:= $(shell echo $(full_version) | sed -e 's/.*~svn\([0-9]*\)[+-].*/\1/g')
+version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
+major		:= $(shell echo $(version) | sed -e 's/\..*//g')
+revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
+
+include /usr/share/dpkg/architecture.mk
+
+# Determine host architecture compiler
+ifeq ($(origin CC),default)
+CC := $(DEB_HOST_GNU_TYPE)-gcc
+endif
+ifeq ($(origin CXX),default)
+CXX := $(DEB_HOST_GNU_TYPE)-g++
+endif
+
+# Use hardening flags
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# Pre-define CFLAGS, for hardening, debug and optimisation level
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+CFLAGS += -Wall -Wno-unknown-pragmas -g -pipe -fPIC -I. \
+	-D_GNU_SOURCE -DNEED_SOLARIS_BOOLEAN \
+	-Werror=implicit-function-declaration \
 	-isystem /usr/include/freebsd \
-	-Werror=implicit-function-declaration \
 	$(NULL)
 
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
-
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 
@@ -28,21 +47,15 @@
 	BSD_MAKEFLAGS += -j$(NUMJOBS)
 endif
 
-full_version	:= $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g')
-tar_version	:= $(shell echo $(full_version) | sed -e 's/-.*//g')
-svn_revision	:= $(shell echo $(full_version) | sed -e 's/.*~svn\([0-9]*\)[+-].*/\1/g')
-version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
-major           := $(shell echo $(version) | sed -e 's/\..*//g')
-revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
+SVN_BASE	:= https://svn.freebsd.org/base
+#SVN		:= $(SVN_BASE)/release/$(version).0
+SVN		:= $(SVN_BASE)/releng/$(version)
+#SVN		:= $(SVN_BASE)/stable/$(major)
+#SVN		:= $(SVN_BASE)/head
 
-#SVN		:= https://svn0.us-west.freebsd.org/base/release/$(version).0
-SVN		:= https://svn0.us-west.freebsd.org/base/releng/$(version)
-#SVN		:= https://svn0.us-west.freebsd.org/base/stable/$(major)
-#SVN		:= https://svn0.us-west.freebsd.org/base/head
-
 SOURCE = zfsutils
 ORIGDIR = $(SOURCE)-$(tar_version)
-TARNAME = $(SOURCE)_$(tar_version).orig.tar.gz
+TARNAME = $(SOURCE)_$(tar_version).orig.tar.xz
 
 PATH := /usr/lib/freebsd:$(PATH)
 DESTDIR = $(CURDIR)/debian/tmp
@@ -86,7 +99,16 @@
 	         ; do \
 	    svn export --ignore-keywords -r $(svn_revision) $(SVN)/$$i $(ORIGDIR)/$$i || exit ; \
 	done
-	tar --numeric-owner --owner 0 --group 0 -czf ../$(TARNAME) $(ORIGDIR)
+	# Clamp timestamps to be no newer than last changelog entry, see
+	# https://wiki.debian.org/ReproducibleBuilds/TimestampsInTarball
+	find $(ORIGDIR) -newermt "@$(SOURCE_DATE_EPOCH)" -print0 \
+	 | xargs -0r touch --no-dereference --date="@$(SOURCE_DATE_EPOCH)"
+	# Create tarball with files sorted in a stable order, see
+	# https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs
+	find $(ORIGDIR) -print0 | LC_ALL=C sort -z \
+	 | tar --null --no-recursion --files-from - \
+	    --numeric-owner --owner 0 --group 0 \
+	    -cJf ../$(TARNAME)
 	rm -rf $(ORIGDIR)
 
 build: build-arch build-indep




More information about the Glibc-bsd-commits mailing list