mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Add DKMS package on Debian-based distributions
* config/deb.am: Enable building DKMS packages for Debian * rpm/generic/spl-dkms.spec.in: Adjust spec to be Debian-compatible * Condition kernel-devel Requires to RPM distros * 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 #657
This commit is contained in:
parent
0cefc9dbcd
commit
28920ea334
@ -50,5 +50,6 @@ etags:
|
|||||||
tags: ctags etags
|
tags: ctags etags
|
||||||
|
|
||||||
pkg: @DEFAULT_PACKAGE@
|
pkg: @DEFAULT_PACKAGE@
|
||||||
|
pkg-dkms: @DEFAULT_PACKAGE@-dkms
|
||||||
pkg-kmod: @DEFAULT_PACKAGE@-kmod
|
pkg-kmod: @DEFAULT_PACKAGE@-kmod
|
||||||
pkg-utils: @DEFAULT_PACKAGE@-utils
|
pkg-utils: @DEFAULT_PACKAGE@-utils
|
||||||
|
@ -29,23 +29,27 @@ deb-local:
|
|||||||
fi)
|
fi)
|
||||||
|
|
||||||
deb-kmod: deb-local rpm-kmod
|
deb-kmod: deb-local rpm-kmod
|
||||||
if CONFIG_KERNEL
|
|
||||||
name=${PACKAGE}; \
|
name=${PACKAGE}; \
|
||||||
version=${VERSION}-${RELEASE}; \
|
version=${VERSION}-${RELEASE}; \
|
||||||
arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
||||||
pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
|
pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
|
||||||
fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
|
||||||
$(RM) $$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
|
deb-utils: deb-local rpm-utils
|
||||||
if CONFIG_USER
|
|
||||||
name=${PACKAGE}; \
|
name=${PACKAGE}; \
|
||||||
version=${VERSION}-${RELEASE}; \
|
version=${VERSION}-${RELEASE}; \
|
||||||
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
||||||
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
||||||
fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
|
||||||
$(RM) $$pkg1
|
$(RM) $$pkg1
|
||||||
endif
|
|
||||||
|
|
||||||
deb: deb-kmod deb-utils
|
deb: deb-kmod deb-dkms deb-utils
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
|
%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
|
||||||
|
|
||||||
|
%if ! 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
|
||||||
|
%define not_rpm 1
|
||||||
|
%endif
|
||||||
|
|
||||||
%define module @PACKAGE@
|
%define module @PACKAGE@
|
||||||
%define mkconf scripts/dkms.mkconf
|
%define mkconf scripts/dkms.mkconf
|
||||||
|
|
||||||
@ -18,7 +22,9 @@ BuildArch: noarch
|
|||||||
|
|
||||||
Requires: dkms >= 2.2.0.2
|
Requires: dkms >= 2.2.0.2
|
||||||
Requires: gcc, make, perl
|
Requires: gcc, make, perl
|
||||||
|
%if 0%{?rhel}%{?fedora}%{?mageia}%{?suse_version}
|
||||||
Requires: kernel-devel
|
Requires: kernel-devel
|
||||||
|
%endif
|
||||||
Provides: %{module}-kmod = %{version}
|
Provides: %{module}-kmod = %{version}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -69,7 +75,7 @@ DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
|
|||||||
if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
|
if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
|
||||||
echo -e
|
echo -e
|
||||||
echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
|
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
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user