LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File zfs.spec of Package zfs (Project home:X0F:HSF:Kernel)

#
# spec file for package zfs
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           zfs
Version:        0.8.0~rc4
Release:        0
%define rver	0.8.0-rc4
Summary:        The ZFS filesystem and utilities
License:        CDDL-1.0 AND GPL-2.0-or-later
Group:          System/Filesystems
Url:            http://zfsonlinux.org/
#Github-URL:	http://github.com/zfsonlinux/zfs
#Git-Clone:	git://github.com/zfsonlinux/zfs
Source:         https://github.com/zfsonlinux/zfs/releases/download/zfs-%rver/zfs-%rver.tar.gz
Source1:        https://github.com/zfsonlinux/zfs/releases/download/zfs-%rver/zfs-%rver.tar.gz.asc
Source2:        %{name}.keyring
BuildRequires:  fdupes
BuildRequires:  kernel-devel
BuildRequires:  kernel-syms
BuildRequires:  libattr-devel
BuildRequires:  libelf-devel
BuildRequires:  libtirpc-devel
BuildRequires:  libtool
BuildRequires:  modutils
BuildRequires:  nasm
BuildRequires:  pkg-config
BuildRequires:  python
BuildRequires:  python3-devel
BuildRequires:  sudo
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(blkid)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  pkgconfig(libselinux)
BuildRequires:  pkgconfig(uuid)
BuildRequires:  pkgconfig(zlib)
# Files collide, but zypper does not recognize that (bnc#673720)
Conflicts:      zfs-fuse

%define services zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target zfs-import.target
%kernel_module_package -n zfs -p %name-preamble -x xen

%description
ZFS is a combined file system and logical volume manager designed by
Sun Microsystems. The features of ZFS include protection against data
corruption, support for high storage capacities, integration of the
concepts of filesystem and volume management, snapshots and
copy-on-write clones, continuous integrity checking and automatic
repair, RAID-Z and native NFSv4 ACLs.

ZFS on Linux, which is also known as ZoL, includes fully functional
and stable SPA, DMU, ZVOL, and ZPL layers.

%package -n libnvpair1
Summary:        A tools library for manipulating <name, value> pairs
License:        CDDL-1.0
Group:          System/Libraries

%description -n libnvpair1
ZFS is an advanced file system and volume manager which was
originally developed by Sun Microsystems.

The nvpair library provides routines packing an unpacking nv pairs
for transporting data across process boundaries, transporting between
kernel and userland, and possibly saving onto disk files.

%package -n libuutil1
Summary:        ZFS utility library
License:        CDDL-1.0
Group:          System/Libraries

%description -n libuutil1
ZFS is an advanced file system and volume manager which was
originally developed by Sun Microsystems.

The uutil library contains various utility and wrapper functions used
by the ZFS userland.

%package -n libzfs2
Summary:        ZFS filesystem access library
License:        CDDL-1.0
Group:          System/Libraries

%description -n libzfs2
ZFS is an advanced file system and volume manager which was
originally developed by Sun Microsystems.

%package -n libzfs_core1
Summary:        ZFS filesystem access library
License:        CDDL-1.0
Group:          System/Libraries

%description -n libzfs_core1
libzfs_core is intended to replace libzfs, and has the following
characteristics:
Thread safety, committed interface (stable API), programmatic
error handling and clear atomicity.

%package -n libzpool2
Summary:        Zpool interface
License:        CDDL-1.0
Group:          System/Libraries

%description -n libzpool2
ZFS is an advanced file system and volume manager which was
originally developed by Sun Microsystems.

The zpool library contains
- Emulation of kernel services in userland
- Routines needed by more than one client of libzpool

%package sudo
Summary:        Sudo configuration for the ZFS userspace utilities
License:        CDDL-1.0
Group:          System/Management
Requires:       %{name} = %{version}
Supplements:    packageand(zfs:sudo)
BuildArch:      noarch

%description sudo
zfs-sudo includes sudoers configuration files to allow for easier
delegation of ZFS administrative tasks to unprivileged users (at a finer
level of granularity than giving full root access).

%package devel
Summary:        Development files for the ZFS userspace utilities
License:        CDDL-1.0
Group:          Development/Libraries/C and C++
Requires:       libnvpair1 = %version
Requires:       libuutil1 = %version
Requires:       libzfs2 = %version
Requires:       libzpool2 = %version

%description devel
ZFS is a combined file system and logical volume manager designed by
Sun Microsystems. The features of ZFS include protection against data
corruption, support for high storage capacities, integration of the
concepts of filesystem and volume management, snapshots and
copy-on-write clones, continuous integrity checking and automatic
repair, RAID-Z and native NFSv4 ACLs.

This subpackage contains the development header files and libraries.
needed for compilation of third-party programs.

%prep
%setup -qn zfs-0.8.0

%build
# avoid failures on kernels with configs that force GPL-only symbols unto generic APIs
sed -i 's:CDDL:GPL:g' META
autoreconf -fiv
%if 0%{?suse_version} > 1500
export CFLAGS="%{optflags} -I/usr/include/rpc"
sed -e "s|#include <tirpc/rpc/xdr\.h>|#include_next <rpc/xdr.h>|" \
    -i lib/libspl/include/rpc/xdr.h
%endif
for flavor in %flavors_to_build; do
	rm -Rf "../obj-$flavor"
	cp -a . "../obj-$flavor"
	pushd "../obj-$flavor/"
	%configure --with-config=kernel --with-linux="/usr/src/linux" \
		--with-linux-obj="/usr/src/linux-obj/%_target_cpu/$flavor" \
		--sbindir="%_sbindir" ||
		{ cat config.log; exit 1; }
	make %{?_smp_mflags} V=1
	popd
done
%configure --with-config=user \
	--disable-sysvinit \
	--enable-systemd \
	--disable-static
make %{?_smp_mflags} V=1

%install
b="%buildroot"
for flavor in %flavors_to_build; do
	pushd "../obj-$flavor/"
	%make_install
	popd
done
%make_install
rm -f "$b/%_libdir"/*.la
rm -Rf "$b/usr/src"
# all dracut
rm -Rf "$b/%_datadir/initramfs-tools"
rm -Rf "$b/%_datadir/zfs/zfs-tests"
mkdir -p "$b/%_sbindir"
for s in %services; do
	ln -s service "$b/%_sbindir/rc${s%.service}"
done
# udev location different for SLES 15 and later
if [ -d "$b/lib/udev" ] ; then
        mv "$b/lib/udev" "$b/usr/lib/udev/"
fi

%fdupes %buildroot/%_prefix

%pre
%service_add_pre %services

%post
%service_add_post %services

%preun
%service_del_preun %services

%postun
%service_del_postun %services

%post   -n libnvpair1 -p /sbin/ldconfig
%postun -n libnvpair1 -p /sbin/ldconfig
%post   -n libuutil1 -p /sbin/ldconfig
%postun -n libuutil1 -p /sbin/ldconfig
%post   -n libzfs2 -p /sbin/ldconfig
%postun -n libzfs2 -p /sbin/ldconfig
%post   -n libzfs_core1 -p /sbin/ldconfig
%postun -n libzfs_core1 -p /sbin/ldconfig
%post   -n libzpool2 -p /sbin/ldconfig
%postun -n libzpool2 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%dir %_sysconfdir/zfs
%dir %_sysconfdir/zfs/zed.d
%dir %_sysconfdir/zfs/zpool.d
%config %_sysconfdir/zfs/*.example
%config %_sysconfdir/zfs/zed.d/*.sh
%config(noreplace) %_sysconfdir/zfs/zed.d/zed.rc
%config %_sysconfdir/zfs/zpool.d/*
%_bindir/arcstat
%_bindir/arc_summary
%_bindir/dbufstat
%_bindir/raidz_test
%_bindir/z*
%_sbindir/fsck.zfs
%_sbindir/rc*
%_sbindir/z*
%_mandir/man?/*.*
%_datadir/zfs/
/sbin/mount.zfs
%_prefix/lib/dracut/
%_prefix/lib/udev/
%_libexecdir/zfs/
%_unitdir/zfs*
%_presetdir/50-zfs.preset
/usr/lib/modules-load.d/
/usr/lib/systemd/

%files -n libnvpair1
%defattr(-,root,root)
%_libdir/libnvpair.so.1*

%files -n libuutil1
%defattr(-,root,root)
%_libdir/libuutil.so.1*

%files -n libzfs2
%defattr(-,root,root)
%_libdir/libzfs.so.2*

%files -n libzfs_core1
%defattr(-,root,root)
%_libdir/libzfs_core.so.1*

%files -n libzpool2
%defattr(-,root,root)
%_libdir/libzpool.so.2*

%files devel
%defattr(-,root,root)
%_includedir/libspl/
%_includedir/libzfs/
%_libdir/libnvpair.so
%_libdir/libuutil.so
%_libdir/libzfs.so
%_libdir/libzfs_core.so
%_libdir/libzpool.so
%_datadir/pkgconfig/*.pc

%files sudo
%defattr(-,root,root)
%config %_sysconfdir/sudoers.d/zfs

%changelog