Accepting request 424097 from home:jeff_mahoney:branches:filesystems

- Add new btrfsprogs-udev-rules package to contain the udev rules.
- Fix packaging for udev rules:
  - btrfs builtin didn't exist prior to udev v190, so the rules must
    depend on that version.
- Added patch:
  * btrfsprogs-only-install-udev-rules-for-udev-190.patch

OBS-URL: https://build.opensuse.org/request/show/424097
OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=248
This commit is contained in:
Dirk Mueller 2016-09-01 07:27:43 +00:00 committed by Git OBS Bridge
parent d26204a4e9
commit a37838da0e
3 changed files with 79 additions and 10 deletions

View File

@ -0,0 +1,32 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: btrfsprogs: only install udev rules for udev >= 190
Patch-mainline: Submitted, linux-btrfs 30 Aug 2016
Prior to udev v190, there was no btrfs builtin helper. Installing it on
systems with an older udev will cause problems.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
configure.ac | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 97e89f2..8fd8f42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,7 +161,13 @@ PKG_STATIC(UUID_LIBS_STATIC, [uuid])
PKG_CHECK_MODULES(ZLIB, [zlib])
PKG_STATIC(ZLIB_LIBS_STATIC, [zlib])
-UDEVDIR="$(pkg-config udev --variable=udevdir)"
+# udev v190 introduced the btrfs builtin and a udev rule to use it.
+# Our udev rule gives us the friendly dm names but isn't required (or valid)
+# on earlier releases.
+UDEVDIR=
+if pkg-config udev --atleast-version 190; then
+ UDEVDIR="$(pkg-config udev --variable=udevdir)"
+fi
AC_SUBST(UDEVDIR)
dnl lzo library does not provide pkg-config, let use classic way

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Aug 30 20:11:10 UTC 2016 - jeffm@suse.com
- Add new btrfsprogs-udev-rules package to contain the udev rules.
- Fix packaging for udev rules:
- btrfs builtin didn't exist prior to udev v190, so the rules must
depend on that version.
- Added patch:
* btrfsprogs-only-install-udev-rules-for-udev-190.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 29 00:00:00 CEST 2016 - dsterba@suse.cz Mon Aug 29 00:00:00 CEST 2016 - dsterba@suse.cz

View File

@ -16,6 +16,10 @@
# #
%define udev_with_btrfs_builtin 190
%define udev_version %(rpm -q --queryformat %{VERSION} udev)
%define package_udev_rules %{udev_version} >= %{udev_with_btrfs_builtin}
# enable building of btrfsprogs-static # enable building of btrfsprogs-static
%if 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1315 %if 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1315
%define build_static 0 %define build_static 0
@ -42,6 +46,7 @@ Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch
Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch
Patch1000: local-version-override.patch Patch1000: local-version-override.patch
Patch1001: btrfsprogs-only-install-udev-rules-for-udev-190.patch
BuildRequires: asciidoc BuildRequires: asciidoc
BuildRequires: autoconf BuildRequires: autoconf
@ -56,6 +61,9 @@ BuildRequires: pkg-config
BuildRequires: suse-module-tools BuildRequires: suse-module-tools
%endif %endif
BuildRequires: udev BuildRequires: udev
%if 0%{?suse_version} == 1310
BuildRequires: libudev-devel
%endif
BuildRequires: xmlto BuildRequires: xmlto
BuildRequires: zlib-devel BuildRequires: zlib-devel
%if 0%{?suse_version} >= 1310 %if 0%{?suse_version} >= 1310
@ -64,6 +72,9 @@ Requires(postun): coreutils
%endif %endif
Supplements: filesystem(btrfs) Supplements: filesystem(btrfs)
Recommends: btrfsmaintenance Recommends: btrfsmaintenance
%if %{package_udev_rules}
Requires: btrfsprogs-udev-rules
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -107,12 +118,31 @@ Requires: libbtrfs0 = %{version}
This package contains the libraries and headers files for developers to This package contains the libraries and headers files for developers to
build applications to interface with btrfs. build applications to interface with btrfs.
# rpm < 4.6.0 (SLE11 uses 4.4) doesn't support noarch subpackages.
# Fortunately, it doesn't use systemd either so we can just skip it.
%if %{package_udev_rules}
%package udev-rules
Summary: Udev rules for configuring btrfs file systems
Group: System/Kernel
Conflicts: udev < %{udev_with_btrfs_builtin}
BuildArch: noarch
%description udev-rules
This package contains the udev rule file for configuring device mapper
devices that are components of btrfs file systems. It is meant to be
used with versions of udev that contain the "built-in" btrfs command
(v190 and newer). Older versions of udev will call the version of
"btrfs ready" contained in the btrfsprogs package, which does the right
thing.
%endif
%prep %prep
%setup -q -n btrfs-progs-v%{version} %setup -q -n btrfs-progs-v%{version}
%patch163 -p1 %patch163 -p1
%patch167 -p1 %patch167 -p1
%patch168 -p1 %patch168 -p1
%patch1000 -p1 %patch1000 -p1
%patch1001 -p1
%build %build
./autogen.sh ./autogen.sh
@ -168,11 +198,6 @@ rm -f %{buildroot}/%{_libdir}/*.a
install -m 0755 -d %{buildroot}/%{_datadir}/bash-completion/completions install -m 0755 -d %{buildroot}/%{_datadir}/bash-completion/completions
install -m 0644 btrfs-completion %{buildroot}/%{_datadir}/bash-completion/completions/btrfs install -m 0644 btrfs-completion %{buildroot}/%{_datadir}/bash-completion/completions/btrfs
# 13.1 does not have pkg-config but does have rules
%if 0%{?suse_version} == 1310
install -m 0755 -d %{buildroot}/usr/lib/udev/rules.d/64-btrfs-dm.rules
%endif
%if 0%{!?for_debugging:1} %if 0%{!?for_debugging:1}
DEBUG_FILES="/sbin/btrfs-find-root DEBUG_FILES="/sbin/btrfs-find-root
%{_sbindir}/btrfs-find-root %{_sbindir}/btrfs-find-root
@ -262,11 +287,6 @@ done
%dir %{_datadir}/bash-completion/completions %dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/btrfs %{_datadir}/bash-completion/completions/btrfs
%if 0%{?suse_version} >= 1200
%dir %{_udevrulesdir}
%{_udevrulesdir}/64-btrfs-dm.rules
%endif
%if 0%{?for_debugging:1} %if 0%{?for_debugging:1}
/sbin/btrfs-find-root /sbin/btrfs-find-root
%{_sbindir}/btrfs-find-root %{_sbindir}/btrfs-find-root
@ -304,4 +324,11 @@ done
%{_includedir}/btrfs/* %{_includedir}/btrfs/*
%{_libdir}/libbtrfs.so %{_libdir}/libbtrfs.so
%if %{package_udev_rules}
%files udev-rules
%defattr(-, root, root)
%dir %{_udevrulesdir}
%{_udevrulesdir}/64-btrfs-dm.rules
%endif
%changelog %changelog