-# TODO: PLDify init script
+# TODO:
+# - PLDify init script
+# - unpackaged initramfs-tools support:
+# /usr/share/initramfs-tools/conf-hooks.d/zfs
+# /usr/share/initramfs-tools/hooks/zfs
+# /usr/share/initramfs-tools/scripts/zfs
#
# Conditional build:
-%bcond_without dist_kernel # allow non-distribution kernel
%bcond_without kernel # don't build kernel modules
%bcond_without userspace # don't build userspace programs
%bcond_with verbose # verbose build (V=1)
#
-%if %{without kernel}
-%undefine with_dist_kernel
-%endif
-
# The goal here is to have main, userspace, package built once with
# simple release number, and only rebuild kernel packages with kernel
# version as part of release number, without the need to bump release
exit 1
%endif
-%if "%{_alt_kernel}" != "%{nil}"
-%if 0%{?build_kernels:1}
-%{error:alt_kernel and build_kernels are mutually exclusive}
-exit 1
-%endif
-%undefine with_userspace
-%global _build_kernels %{alt_kernel}
-%else
-%global _build_kernels %{?build_kernels:,%{?build_kernels}}
-%endif
-
%if %{without userspace}
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
%define _duplicate_files_terminate_build 0
-%define kbrs %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo -e "BuildRequires:kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2\\nBuildRequires:kernel%{_alt_kernel}-spl-devel >= 0.6.3" ; done)
-%define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done)
-%define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done)
-
+%define rel 1
%define pname zfs
-%define rel 2
Summary: Native Linux port of the ZFS filesystem
Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS
Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
-Version: 0.6.3
+Version: 0.7.5
Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
License: CDDL (ZFS), GPL v2+ (ZPIOS)
Group: Applications/System
-Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz
-# Source0-md5: 5bcc32c122934d421eba68e16826637d
+Source0: https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz
+# Source0-md5: 51c5dbef614120029491534375a5dd43
Patch0: %{pname}-link.patch
+Patch1: x32.patch
+Patch2: xattr-in-glibc.patch
URL: http://zfsonlinux.org/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: libtool
+BuildRequires: rpmbuild(macros) >= 1.701
%if %{with kernel}
-BuildRequires: rpmbuild(macros) >= 1.379
-%{?with_dist_kernel:%{expand:%kbrs}}
+%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
+%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
%endif
%if %{with userspace}
BuildRequires: libblkid-devel
Release: %{rel}@%{_kernel_ver_str}\
Group: Base/Kernel\
Requires(post,postun): /sbin/depmod\
-%if %{with dist_kernel}\
%requires_releq_kernel\
Requires(postun): %releq_kernel\
-%endif\
\
%description -n kernel%{_alt_kernel}-zfs\
ZFS Linux kernel modules.\
Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
Release: %{rel}@%{_kernel_ver_str}\
Group: Development/Building\
-%if %{with dist_kernel}\
Requires: kernel%{_alt_kernel}-headers\
Requires: kernel-zfs-common-devel\
-%endif\
\
%description -n kernel%{_alt_kernel}-zfs-devel\
ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
%defattr(644,root,root,755)\
%dir /lib/modules/%{_kernel_ver}/misc/avl\
/lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
+%dir /lib/modules/%{_kernel_ver}/misc/icp\
+/lib/modules/%{_kernel_ver}/misc/icp/icp.ko*\
%dir /lib/modules/%{_kernel_ver}/misc/nvpair\
/lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
%dir /lib/modules/%{_kernel_ver}/misc/unicode\
%configure \\\
--disable-silent-rules \\\
--with-config="kernel" \\\
- --with-linux=%{_kernelsrcdir}\
+ --with-linux=%{_kernelsrcdir}\\\
+ --with-linux-obj=%{_kernelsrcdir}\
\
%{__make} clean\
%{__make} %{?with_verbose:V=1}\
%{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
%{nil}
-%{?with_kernel:%{expand:%kpkg}}
+%{?with_kernel:%{expand:%create_kernel_packages}}
%prep
%setup -q -n %{pname}-%{version}
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
%{__libtoolize}
%{__autoconf}
%{__autoheader}
%{__automake}
-%{?with_kernel:%{expand:%bkpkg}}
+%{?with_kernel:%{expand:%build_kernel_packages}}
%if %{with userspace}
%configure \
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
DEFAULT_INIT_DIR=/etc/rc.d/init.d
+
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+%{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
+
+# Package these? These are integration tests of the implementation.
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zfs/{zfs-tests,test-runner,runfiles}
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{raidz_test,test-runner}.1*
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/raidz_test
%endif
%clean
%defattr(644,root,root,755)
%doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
%attr(755,root,root) /sbin/mount.zfs
+%attr(755,root,root) %{_bindir}/arc_summary.py
%attr(755,root,root) %{_bindir}/arcstat.py
%attr(755,root,root) %{_bindir}/dbufstat.py
+%attr(755,root,root) %{_bindir}/zgenhostid
%attr(755,root,root) %{_sbindir}/fsck.zfs
%attr(755,root,root) %{_sbindir}/zdb
%attr(755,root,root) %{_sbindir}/zed
%dir %{_sysconfdir}/zfs/zed.d
%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
-%attr(754,root,root) /etc/rc.d/init.d/zfs
+%dir %{_sysconfdir}/zfs/zpool.d
+%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zpool.d/*
+%attr(754,root,root) /etc/rc.d/init.d/zfs-import
+%attr(754,root,root) /etc/rc.d/init.d/zfs-mount
+%attr(754,root,root) /etc/rc.d/init.d/zfs-share
+%attr(754,root,root) /etc/rc.d/init.d/zfs-zed
+%config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
+/etc/zfs/zfs-functions
/usr/lib/modules-load.d/zfs.conf
/etc/systemd/system-preset/50-zfs.preset
-%{systemdunitdir}/zed.service
%{systemdunitdir}/zfs.target
+%{systemdunitdir}/zfs-import.target
%{systemdunitdir}/zfs-import-cache.service
%{systemdunitdir}/zfs-import-scan.service
%{systemdunitdir}/zfs-mount.service
%{systemdunitdir}/zfs-share.service
+%{systemdunitdir}/zfs-zed.service
%attr(755,root,root) /lib/udev/vdev_id
%attr(755,root,root) /lib/udev/zvol_id
/lib/udev/rules.d/60-zvol.rules
/lib/udev/rules.d/69-vdev.rules
/lib/udev/rules.d/90-zfs.rules
-%dir %{_libdir}/zfs
-%dir %{_libdir}/zfs/zed.d
-%attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
+%dir %{_libexecdir}/zfs
+%dir %{_libexecdir}/zfs/zed.d
+%attr(755,root,root) %{_libexecdir}/zfs/zed.d/*.sh
+%dir %{_libexecdir}/zfs/zpool.d
+%attr(755,root,root) %{_libexecdir}/zfs/zpool.d/*
%dir %{_datadir}/zfs
%attr(755,root,root) %{_datadir}/zfs/*.sh
%dir %{_datadir}/zfs/zpios-profile
%{_mandir}/man1/zpios.1*
%{_mandir}/man1/ztest.1*
%{_mandir}/man5/vdev_id.conf.5*
+%{_mandir}/man5/zfs-events.5*
%{_mandir}/man5/zfs-module-parameters.5*
%{_mandir}/man5/zpool-features.5*
%{_mandir}/man8/fsck.zfs.8*
%{_mandir}/man8/zdb.8*
%{_mandir}/man8/zed.8*
%{_mandir}/man8/zfs.8*
+%{_mandir}/man8/zgenhostid.8*
%{_mandir}/man8/zinject.8*
%{_mandir}/man8/zpool.8*
%{_mandir}/man8/zstreamdump.8*
%{_libdir}/libzpool.la
%{_includedir}/libspl
%{_includedir}/libzfs
+%{_pkgconfigdir}/libzfs.pc
+%{_pkgconfigdir}/libzfs_core.pc
%files static
%defattr(644,root,root,755)
%files -n dracut-zfs
%defattr(644,root,root,755)
-%doc dracut/README.dracut.markdown
+%doc contrib/dracut/README.dracut.markdown
+%dir %{dracutlibdir}/modules.d/02zfsexpandknowledge
+%attr(755,root,root) %{dracutlibdir}/modules.d/02zfsexpandknowledge/module-setup.sh
%dir %{dracutlibdir}/modules.d/90zfs
+%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
+%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-generator.sh
+%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
+%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-needshutdown.sh
%endif
%if %{with kernel}