provide dkms subpackage to build module [release 2.1.6-2mamba;Sat Nov 19 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 20:03:58 +01:00
parent a692c5e6e2
commit ea4127a94c
2 changed files with 92 additions and 14 deletions

View File

@ -0,0 +1,41 @@
From b4a2c0b184c9c9599421b15a430fb88deb5dbd17 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Sun, 28 Oct 2018 15:01:58 -0400
Subject: [PATCH] only build the module in dkms.conf
---
scripts/dkms.mkconf | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf
index 88c289383..5a859a0e0 100755
--- a/scripts/dkms.mkconf
+++ b/scripts/dkms.mkconf
@@ -28,14 +28,7 @@ PACKAGE_CONFIG="${pkgcfg}"
PRE_BUILD="configure
--prefix=/usr
--with-config=kernel
- --with-linux=\$(
- if [ -e "\${kernel_source_dir/%build/source}" ]
- then
- echo "\${kernel_source_dir/%build/source}"
- else
- echo "\${kernel_source_dir}"
- fi
- )
+ --with-linux="\${kernel_source_dir}"
--with-linux-obj="\${kernel_source_dir}"
\$(
[[ -n \"\${ICP_ROOT}\" ]] && \\
@@ -68,7 +53,7 @@ POST_BUILD="scripts/dkms.postbuild
-t \${dkms_tree}
"
AUTOINSTALL="yes"
-MAKE[0]="make"
+MAKE[0]="make -C module/"
STRIP[0]="\$(
[[ -r \${PACKAGE_CONFIG} ]] \\
&& source \${PACKAGE_CONFIG} \\
--
2.19.1

View File

@ -1,6 +1,6 @@
Name: zfs Name: zfs
Version: 2.1.6 Version: 2.1.6
Release: 1mamba Release: 2mamba
Summary: An advanced file system and volume manager Summary: An advanced file system and volume manager
Group: System/Tools Group: System/Tools
Vendor: openmamba Vendor: openmamba
@ -8,13 +8,12 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://zfsonlinux.org URL: https://zfsonlinux.org
Source: https://github.com/zfsonlinux/zfs.git/zfs-%{version}/zfs-%{version}.tar.bz2 Source: https://github.com/zfsonlinux/zfs.git/zfs-%{version}/zfs-%{version}.tar.bz2
Patch0: zfs-2.1.6-only-build-the-module-in-dkms.conf.patch
License: Common Development and Distribution License License: Common Development and Distribution License
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libaio-devel BuildRequires: libaio-devel
BuildRequires: libaudit-devel
BuildRequires: libblkid-devel BuildRequires: libblkid-devel
BuildRequires: libcap-ng-devel
BuildRequires: libe2fs-devel BuildRequires: libe2fs-devel
BuildRequires: libkrb5-devel BuildRequires: libkrb5-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
@ -24,6 +23,7 @@ BuildRequires: libtirpc-devel
BuildRequires: libudev-devel BuildRequires: libudev-devel
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
BuildRequires: libz-devel BuildRequires: libz-devel
BuildRequires: perl-devel
BuildRequires: python3.7dist(cffi) BuildRequires: python3.7dist(cffi)
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
@ -33,6 +33,14 @@ ZFS is an advanced file system and volume manager which was originally developed
ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers. ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers.
Full documentation for installing ZoL on your favorite Linux distribution can be found at: http://zfsonlinux.org Full documentation for installing ZoL on your favorite Linux distribution can be found at: http://zfsonlinux.org
%package dkms
Group: System/Kernel and Hardware/Drivers
Summary: %{name} kernel module with DKMS build support
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description dkms
This package contains the %{name} kernel module with DKMS build support.
%package -n lib%{name} %package -n lib%{name}
Group: System/Libraries Group: System/Libraries
Summary: Shared libraries for %{name} Summary: Shared libraries for %{name}
@ -62,6 +70,7 @@ This package contains the Python libraries for %{name}.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .only-build-the-module-in-dkms.conf
#-D -T #-D -T
#:<< _EOF #:<< _EOF
./autogen.sh ./autogen.sh
@ -81,16 +90,43 @@ This package contains the Python libraries for %{name}.
%make %make
# Create dkms.conf
./scripts/dkms.mkconf -n zfs -v %{version} -f dkms.conf
./scripts/make_gitrev.sh include/zfs_gitrev.h
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall %makeinstall
# We use dracut not initramfs-tools
rm -rf %{buildroot}%{_datadir}/initramfs-tools
# Install dkms with module source dir
dkmsdir=%{buildroot}%{_prefix}/src/zfs-%{version}
install -d ${dkmsdir}/{config,scripts}
cp -a configure dkms.conf Makefile.in META zfs_config.h.in zfs.release.in include/ module/ ${dkmsdir}/
cp config/compile config/config.* config/missing config/*sh ${dkmsdir}/config/
cp scripts/enum-extract.pl scripts/dkms.postbuild ${dkmsdir}/scripts/
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name} -p /sbin/ldconfig %post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig %postun -n lib%{name} -p /sbin/ldconfig
%preun dkms
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
:
%posttrans dkms
if [ $1 -ge 1 ]; then
# clean any legacy alternatives symlink
dkms remove -q -m %{name} -v %{version} --all --rpm_safe_upgrade
dkms add -q -m %{name} -v %{version}
dkms install -q -m %{name} -v %{version}
fi
:
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_sysconfdir}/zfs %dir %{_sysconfdir}/zfs
@ -124,27 +160,16 @@ This package contains the Python libraries for %{name}.
%{_udevrulesdir}/*.rules %{_udevrulesdir}/*.rules
%{_prefix}/lib/udev/vdev_id %{_prefix}/lib/udev/vdev_id
%{_prefix}/lib/udev/zvol_id %{_prefix}/lib/udev/zvol_id
%{_datadir}/initramfs-tools/hooks/zfsunlock
%{_datadir}/initramfs-tools/zfsunlock
%{_datadir}/pam-configs/zfs_key %{_datadir}/pam-configs/zfs_key
%dir %{_prefix}/lib/dracut/modules.d/90zfs
%{_prefix}/lib/dracut/modules.d/90zfs/*
%{_prefix}/lib/modules-load.d/zfs.conf
%{_presetdir}/50-zfs.preset %{_presetdir}/50-zfs.preset
%{_unitdir}/zfs-*.service %{_unitdir}/zfs-*.service
%{_unitdir}/zfs-*.timer %{_unitdir}/zfs-*.timer
%{_unitdir}/zfs.target %{_unitdir}/zfs.target
%{_unitdir}/zfs-volumes.target %{_unitdir}/zfs-volumes.target
%{_datadir}/initramfs-tools/conf-hooks.d/zfs
%{_datadir}/initramfs-tools/hooks/zfs
%{_datadir}/initramfs-tools/scripts/zfs
%dir %{_datadir}/zfs %dir %{_datadir}/zfs
%{_datadir}/zfs/* %{_datadir}/zfs/*
%{_unitdir}/zfs-import.target %{_unitdir}/zfs-import.target
%{_prefix}/lib/systemd/system-generators/zfs-mount-generator %{_prefix}/lib/systemd/system-generators/zfs-mount-generator
%{_prefix}/lib/dracut/modules.d/02zfsexpandknowledge/module-setup.sh
%{_datadir}/initramfs-tools/conf.d/zfs
%{_datadir}/initramfs-tools/scripts/local-top/zfs
%{_mandir}/man1/arcstat.1.gz %{_mandir}/man1/arcstat.1.gz
%{_mandir}/man1/raidz_test.1* %{_mandir}/man1/raidz_test.1*
%{_mandir}/man1/test-runner.1* %{_mandir}/man1/test-runner.1*
@ -180,6 +205,15 @@ This package contains the Python libraries for %{name}.
#%{_mandir}/man8/zfsconcepts.8* #%{_mandir}/man8/zfsconcepts.8*
#%{_mandir}/man8/zfsprops.8* #%{_mandir}/man8/zfsprops.8*
%files dkms
%defattr(-,root,root)
%{_prefix}/lib/dracut/modules.d/02zfsexpandknowledge/module-setup.sh
%dir %{_prefix}/lib/dracut/modules.d/90zfs
%{_prefix}/lib/dracut/modules.d/90zfs/*
%{_prefix}/lib/modules-load.d/zfs.conf
%dir %{_prefix}/src/zfs-%{version}
%{_prefix}/src/zfs-%{version}/*
%files -n lib%{name} %files -n lib%{name}
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/libnvpair.so.* %{_libdir}/libnvpair.so.*
@ -229,6 +263,9 @@ This package contains the Python libraries for %{name}.
%{python3_sitelib}/pyzfs-*-py*.egg-info/* %{python3_sitelib}/pyzfs-*-py*.egg-info/*
%changelog %changelog
* Sat Nov 19 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.6-2mamba
- provide dkms subpackage to build module
* Sun Oct 23 2022 Automatic Build System <autodist@mambasoft.it> 2.1.6-1mamba * Sun Oct 23 2022 Automatic Build System <autodist@mambasoft.it> 2.1.6-1mamba
- automatic version update by autodist - automatic version update by autodist