Permalink
Browse files

Enable/disable pyzfs explicity in spec

Add --with/without pyzfs to rpm build

Explicitly enable or disable pyzfs during configure based on
what will be packaged.  Configuration test should not make
packaging fail if python-cffi is installed.

Partially Addresses Issue 7882

Signed-off-by: Nathaniel Clark <nathaniel.clark@misrule.us>
  • Loading branch information...
utopiabound committed Dec 4, 2018
1 parent c40a112 commit 205916d06e19275bdbeee2879e66be354e8964c3
Showing with 12 additions and 3 deletions.
  1. +1 −1 config/always-pyzfs.m4
  2. +11 −2 rpm/generic/zfs.spec.in
@@ -116,7 +116,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
AC_SUBST([PYZFS_ENABLED], [$enable_pyzfs])
AS_IF([test "x$enable_pyzfs" = xyes], [
DEFINE_PYZFS='--define "_pyzfs 1"'
DEFINE_PYZFS='--with pyzfs'
],[
DEFINE_PYZFS=''
])
@@ -52,6 +52,7 @@
%bcond_with debuginfo
%bcond_with asan
%bcond_with systemd
%bcond_with pyzfs
# Python permits the !/usr/bin/python shebang for scripts that are cross
# compatible between python2 and python3, but Fedora 28 does not. Fedora
@@ -240,7 +241,7 @@ Requires: grep
This package contains a dracut module used to construct an initramfs
image which is ZFS aware.
%if 0%{?_pyzfs}
%if %{with pyzfs}
%package -n pyzfs
Summary: Python wrapper for libzfs_core
Group: Development/Languages/Python
@@ -252,6 +253,7 @@ Requires: libffi
Requires: python >= 2.7
Requires: python-cffi
%if 0%{?rhel}%{?fedora}%{?suse_version}
BuildRequires: python-cffi
BuildRequires: python-devel
BuildRequires: libffi-devel
%endif
@@ -292,6 +294,12 @@ image which is ZFS aware.
%define asan --disable-asan
%endif
%if %{with pyzfs}
%define pyzfs --enable-pyzfs
%else
%define pyzfs --disable-pyzfs
%endif
%if 0%{?_systemd}
%define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --with-systemdmodulesloaddir=%{_modulesloaddir} --with-systemdgeneratordir=%{_systemdgeneratordir} --disable-sysvinit
%define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target zfs-import.target
@@ -311,6 +319,7 @@ image which is ZFS aware.
%{debug} \
%{debuginfo} \
%{asan} \
%{pyzfs} \
%{systemd}
make %{?_smp_mflags}
@@ -426,7 +435,7 @@ systemctl --system daemon-reload >/dev/null || true
%doc contrib/dracut/README.dracut.markdown
%{_dracutdir}/modules.d/*
%if 0%{?_pyzfs}
%if %{with pyzfs}
%files -n pyzfs
%doc contrib/pyzfs/README
%doc contrib/pyzfs/LICENSE

0 comments on commit 205916d

Please sign in to comment.