summaryrefslogtreecommitdiffstats
path: root/rpm/redhat
diff options
context:
space:
mode:
Diffstat (limited to 'rpm/redhat')
-rw-r--r--rpm/redhat/.gitignore3
-rw-r--r--rpm/redhat/Makefile.am1
l---------rpm/redhat/zfs-dkms.spec.in1
-rw-r--r--rpm/redhat/zfs-kmod.spec.in86
l---------rpm/redhat/zfs.spec.in1
5 files changed, 92 insertions, 0 deletions
diff --git a/rpm/redhat/.gitignore b/rpm/redhat/.gitignore
new file mode 100644
index 000000000..7f5daafdd
--- /dev/null
+++ b/rpm/redhat/.gitignore
@@ -0,0 +1,3 @@
+/zfs-dkms.spec
+/zfs-kmod.spec
+/zfs.spec
diff --git a/rpm/redhat/Makefile.am b/rpm/redhat/Makefile.am
new file mode 100644
index 000000000..89b13640d
--- /dev/null
+++ b/rpm/redhat/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = zfs.spec.in zfs-kmod.spec.in zfs-dkms.spec.in
diff --git a/rpm/redhat/zfs-dkms.spec.in b/rpm/redhat/zfs-dkms.spec.in
new file mode 120000
index 000000000..ffa051baa
--- /dev/null
+++ b/rpm/redhat/zfs-dkms.spec.in
@@ -0,0 +1 @@
+../generic/zfs-dkms.spec.in \ No newline at end of file
diff --git a/rpm/redhat/zfs-kmod.spec.in b/rpm/redhat/zfs-kmod.spec.in
new file mode 100644
index 000000000..ecc809bc6
--- /dev/null
+++ b/rpm/redhat/zfs-kmod.spec.in
@@ -0,0 +1,86 @@
+%bcond_with debug
+%bcond_with debug_dmu_tx
+
+Name: @PACKAGE@-kmod
+Version: @VERSION@
+Release: @RELEASE@%{?dist}
+
+Summary: Kernel module(s)
+Group: System Environment/Kernel
+License: @ZFS_META_LICENSE@
+URL: http://zfsonlinux.org/
+BuildRequires: %kernel_module_package_buildreqs
+BuildRequires: kmod-spl-devel = %{version}
+Source0: @PACKAGE@-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# Additional dependency information for the kmod sub-package must be specified
+# by generating a preamble text file which kmodtool can append to the spec file.
+%(/bin/echo -e "\
+Requires: spl-kmod\n\
+Requires: @PACKAGE@ = %{version}\n\
+Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
+
+%description
+This package contains the ZFS kernel modules.
+
+%define kmod_name @PACKAGE@
+%define debug_package %{nil}
+
+%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
+
+%define ksrc %{_usrsrc}/kernels/%{kverrel}
+%define kobj %{ksrc}
+%define splsrc %{_usrsrc}/spl-%{version}
+%define splobj %{splsrc}/%{kverrel}
+
+%package -n kmod-%{kmod_name}-devel
+Summary: ZFS kernel module(s) devel common
+Group: System Environment/Kernel
+Requires: kmod-spl-devel = %{version}
+
+%description -n kmod-%{kmod_name}-devel
+This package provides the header files and objects to build kernel modules
+which depend on the spl kernel module.
+
+%prep
+if ! [ -d "%{ksrc}" ]; then
+ echo "Kernel build directory isn't set properly, cannot continue"
+ exit 1
+fi
+
+%if %{with debug}
+%define debug --enable-debug
+%else
+%define debug --disable-debug
+%endif
+
+%if %{with debug_dmu_tx}
+%define debug_dmu_tx --enable-debug-dmu-tx
+%else
+%define debug_dmu_tx --disable-debug-dmu-tx
+%endif
+
+%setup -n %{kmod_name}-%{version}
+%build
+%configure \
+ --with-config=kernel \
+ --with-linux=%{ksrc} \
+ --with-linux-obj=%{kobj} \
+ --with-spl="%{splsrc}" \
+ --with-spl-obj="%{splobj}" \
+ %{debug} \
+ %{debug_dmu_tx}
+make %{?_smp_mflags}
+
+%install
+make install \
+ DESTDIR=${RPM_BUILD_ROOT} \
+ INSTALL_MOD_DIR=extra/%{kmod_name}
+%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -n kmod-%{kmod_name}-devel
+%{_usrsrc}/%{kmod_name}-%{version}
diff --git a/rpm/redhat/zfs.spec.in b/rpm/redhat/zfs.spec.in
new file mode 120000
index 000000000..4c8079166
--- /dev/null
+++ b/rpm/redhat/zfs.spec.in
@@ -0,0 +1 @@
+../generic/zfs.spec.in \ No newline at end of file