]> granicus.if.org Git - zfs/commitdiff
Add DKMS package on Debian-based distributions
authorNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 15 Oct 2017 20:00:44 +0000 (16:00 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 15 Oct 2017 20:00:44 +0000 (13:00 -0700)
* config/deb.am: Enable building DKMS packages for Debian
* rpm/generic/zfs-dkms.spec.in: Adjust spec to be Debian-compatible
  * Condition kernel-devel Req to RPM distros
  * Adjust the DKMS Req to have a minimum of a version only
  * Ensure that --rpm_safe_upgrade isn't used on non-RPM distros
* config/deb.am: Drop CONFIG_KERNEL and CONFIG_USER guards
* Makefile.am: Add pkg-dkms target

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Neal Gompa <ngompa@datto.com>
Closes #6044
Closes #6731

Makefile.am
config/deb.am
rpm/generic/zfs-dkms.spec.in

index 53a852832d9d0b20d1259d4cc5270866dd96c339..c51be2b4c5177f033206a15812fbeb7c0c65ed9a 100644 (file)
@@ -98,5 +98,6 @@ etags:
 tags: ctags etags
 
 pkg: @DEFAULT_PACKAGE@
+pkg-dkms: @DEFAULT_PACKAGE@-dkms
 pkg-kmod: @DEFAULT_PACKAGE@-kmod
 pkg-utils: @DEFAULT_PACKAGE@-utils
index 6665e4a2d408bd455f06a44a7b341cc45a701410..98e98e45f40233fd2bb142107ccd78c81e827e5a 100644 (file)
@@ -15,17 +15,23 @@ deb-local:
        fi)
 
 deb-kmod: deb-local rpm-kmod
-if CONFIG_KERNEL
        name=${PACKAGE}; \
        version=${VERSION}-${RELEASE}; \
        arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
        pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
        fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
        $(RM) $$pkg1
-endif
+
+
+deb-dkms: deb-local rpm-dkms
+       name=${PACKAGE}; \
+       version=${VERSION}-${RELEASE}; \
+       arch=`$(RPM) -qp $${name}-dkms-$${version}.src.rpm --qf %{arch} | tail -1`; \
+       pkg1=$${name}-dkms-$${version}.$${arch}.rpm; \
+       fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+       $(RM) $$pkg1
 
 deb-utils: deb-local rpm-utils
-if CONFIG_USER
        name=${PACKAGE}; \
        version=${VERSION}-${RELEASE}; \
        arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
@@ -58,6 +64,5 @@ if CONFIG_USER
        rmdir $${path_prepend}; \
        $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
            $$pkg8 $$pkg9;
-endif
 
-deb: deb-kmod deb-utils
+deb: deb-kmod deb-dkms deb-utils
index e432bc4142dba5719a161c7e0b4465542fc2d5d8..f6de4929704f8fc46cd79add324835a9cbd932eb 100644 (file)
@@ -1,5 +1,9 @@
 %{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
 
+%if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
+%define not_rpm 1
+%endif
+
 %define module  @PACKAGE@
 %define mkconf  scripts/dkms.mkconf
 
@@ -16,10 +20,12 @@ Source0:        %{module}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
-Requires:       dkms >= 2.2.0.3-20
+Requires:       dkms >= 2.2.0.3
 Requires:       spl-dkms = %{version}
 Requires:       gcc, make, perl
+%if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
 Requires:       kernel-devel
+%endif
 Provides:       %{module}-kmod = %{version}
 
 %description
@@ -69,7 +75,7 @@ DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
 if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
     echo -e
     echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
-    dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+    dkms remove -m %{module} -v %{version} --all %{!?not_rpm:--rpm_safe_upgrade}
 fi
 exit 0