add debian packaging files for zfs

This commit is contained in:
Dietmar Maurer
2015-01-10 15:51:28 +01:00
parent e7e8c3293d
commit 8d6c7ec564
43 changed files with 3360 additions and 89 deletions
@@ -0,0 +1,71 @@
From: Darik Horn <dajhorn@vanadac.com>
Date: Tue, 17 Jan 2012 19:45:07 -0600
Subject: Prevent manual builds in the DKMS source.
Print an instructive error messsage and exit if the `dkms.conf` file
exists when the userland is configured. (ie: `--with-config=user`)
A non-trivial number of people try to rebuild ZoL from the
`/usr/src/zfs` tree, which is modified to better satisfy Debian
packaging policy and contains only the module sources for DKMS.
Regardless, local installations usually break managed installations,
so this autotools test could be further enhanced to check whether
ZFS has a DKMS registration.
---
config/dkms.m4 | 14 ++++++++++++++
config/user.m4 | 1 +
config/zfs-build.m4 | 6 +++---
3 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 config/dkms.m4
diff --git a/config/dkms.m4 b/config/dkms.m4
new file mode 100644
index 0000000..cfa1152
--- /dev/null
+++ b/config/dkms.m4
@@ -0,0 +1,14 @@
+dnl #
+dnl # Prevent manual building in DKMS source tree.
+dnl #
+AC_DEFUN([ZFS_AC_DKMS_INHIBIT], [
+ AC_MSG_CHECKING([for dkms.conf file])
+ AS_IF([test -e dkms.conf], [
+ AC_MSG_ERROR([
+ *** ZFS should not be manually built in the DKMS source tree.
+ *** Remove all ZFS packages before compiling the ZoL sources.
+ *** Running "make install" breaks ZFS packages.])
+ ], [
+ AC_MSG_RESULT([not found])
+ ])
+])
diff --git a/config/user.m4 b/config/user.m4
index 3802437..f5a8827 100644
--- a/config/user.m4
+++ b/config/user.m4
@@ -2,6 +2,7 @@ dnl #
dnl # Default ZFS user configuration
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER], [
+ ZFS_AC_DKMS_INHIBIT
ZFS_AC_CONFIG_USER_UDEV
ZFS_AC_CONFIG_USER_SYSTEMD
ZFS_AC_CONFIG_USER_SYSVINIT
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 5ec94a0..41eec88 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -87,10 +87,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
ZFS_AC_CONFIG_ALWAYS
case "$ZFS_CONFIG" in
- kernel) ZFS_AC_CONFIG_KERNEL ;;
user) ZFS_AC_CONFIG_USER ;;
- all) ZFS_AC_CONFIG_KERNEL
- ZFS_AC_CONFIG_USER ;;
+ kernel) ZFS_AC_CONFIG_KERNEL ;;
+ all) ZFS_AC_CONFIG_USER
+ ZFS_AC_CONFIG_KERNEL ;;
srpm) ;;
*)
AC_MSG_RESULT([Error!])
@@ -0,0 +1,70 @@
From: Darik Horn <dajhorn@vanadac.com>
Date: Sat, 18 Oct 2014 14:23:11 -0500
Subject: Check for META and DCH consistency in autoconf.
If a debian/ packaging overlay exists, then the software versions defined in
the META and debian/changelog files must be the same to ensure that DKMS uses
correct paths and that users see the same version everywhere.
---
config/zfs-meta.m4 | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/config/zfs-meta.m4 b/config/zfs-meta.m4
index 7c92dd5..d174ccc 100644
--- a/config/zfs-meta.m4
+++ b/config/zfs-meta.m4
@@ -1,9 +1,10 @@
dnl #
dnl # DESCRIPTION:
-dnl # Read meta data from the META file. When building from a git repository
-dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated
-dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*. This allows
-dnl # for working builds to be uniquely identified using the git commit hash.
+dnl # Read meta data from the META file or the debian/changelog file if it
+dnl # exists. When building from a git repository the ZFS_META_RELEASE field
+dnl # will be overwritten if there is an annotated tag matching the form
+dnl # ZFS_META_NAME-ZFS_META_VERSION-*. This allows for working builds to be
+dnl # uniquely identified using the git commit hash.
dnl #
dnl # The META file format is as follows:
dnl # ^[ ]*KEY:[ \t]+VALUE$
@@ -49,6 +50,7 @@ AC_DEFUN([ZFS_AC_META], [
_zfs_ac_meta_type="none"
if test -f "$META"; then
_zfs_ac_meta_type="META file"
+ _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]);
if test -n "$ZFS_META_NAME"; then
@@ -66,8 +68,30 @@ AC_DEFUN([ZFS_AC_META], [
AC_SUBST([ZFS_META_VERSION])
fi
+ if test -n "${_dpkg_parsechangelog}"; then
+ _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
+ | cut -d- -f1)
+ if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
+ AC_MSG_ERROR([
+ *** Version $ZFS_META_VERSION in the META file is different than
+ *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
+ *** packaging require that these files have the same version.
+ ])
+ fi
+ fi
+
ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
- if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
+
+ if test -n "${_dpkg_parsechangelog}"; then
+ _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
+ | cut -d- -f2-)
+ if test -n "${_dpkg_release}"; then
+ ZFS_META_RELEASE=${_dpkg_release}
+ _zfs_ac_meta_type="dpkg-parsechangelog"
+ fi
+ elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
_match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
_alias=$(git describe --match=${_match} 2>/dev/null)
_release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
@@ -0,0 +1,41 @@
From: Darik Horn <dajhorn@vanadac.com>
Date: Sat, 18 Oct 2014 19:48:46 -0500
Subject: Add libuutil to LIBADD for libzfs and libzfs_core
Resolve spurious dpkg-shlibdeps warnings like this:
warning: symbol strlcpy used by libzfs_core.so found in none of the libraries
This happens because dpkg-shlibdeps does not recursively search for symbols.
Signed-off-by: Darik Horn <dajhorn@vanadac.com>
---
lib/libzfs/Makefile.am | 1 +
lib/libzfs_core/Makefile.am | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am
index 8b1f517..efdf84b 100644
--- a/lib/libzfs/Makefile.am
+++ b/lib/libzfs/Makefile.am
@@ -23,6 +23,7 @@ libzfs_la_SOURCES = \
libzfs_la_LIBADD = \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libshare/libshare.la \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la
diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am
index 0ecd208..6f0be5f 100644
--- a/lib/libzfs_core/Makefile.am
+++ b/lib/libzfs_core/Makefile.am
@@ -10,6 +10,7 @@ libzfs_core_la_SOURCES = \
$(top_srcdir)/lib/libzfs_core/libzfs_core.c
libzfs_core_la_LIBADD = \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(top_builddir)/lib/libnvpair/libnvpair.la \
+ $(top_builddir)/lib/libuutil/libuutil.la
libzfs_core_la_LDFLAGS = -version-info 1:0:0
@@ -0,0 +1,31 @@
From: Ned Bass <bass6@llnl.gov>
Date: Wed, 17 Dec 2014 11:01:42 -0800
Subject: vdev_id: use mawk-compatible regular expression
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
alternative. A regular expression in map_slot() contains an unquoted
empty string following the alternation (|) operator, which results in an
"missing operand" error with mawk. The solution is to rearrange the
expression so the alternation has two operands.
Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#136
Closes zfsonlinux/zfs#2965
---
cmd/vdev_id/vdev_id | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id
index b6752ba..6fddd12 100755
--- a/cmd/vdev_id/vdev_id
+++ b/cmd/vdev_id/vdev_id
@@ -116,7 +116,7 @@ map_slot() {
local MAPPED_SLOT=
MAPPED_SLOT=`awk "\\$1 == \"slot\" && \\$2 == ${LINUX_SLOT} && \
- \\$4 ~ /^(${CHANNEL}|)$/ { print \\$3; exit }" $CONFIG`
+ \\$4 ~ /^${CHANNEL}$|^$/ { print \\$3; exit }" $CONFIG`
if [ -z "$MAPPED_SLOT" ] ; then
MAPPED_SLOT=$LINUX_SLOT
fi
+4
View File
@@ -0,0 +1,4 @@
0001-Prevent-manual-builds-in-the-DKMS-source.patch
0002-Check-for-META-and-DCH-consistency-in-autoconf.patch
0003-Add-libuutil-to-LIBADD-for-libzfs-and-libzfs_core.patch
0005-vdev_id-use-mawk-compatible-regular-expression.patch