2 %global _libdir
/%{_lib}
4 # Set the default udev directory based on distribution.
5 %if %{undefined _udevdir}
6 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
7 %global _udevdir
%{_prefix}/lib
/udev
9 %global _udevdir
/lib
/udev
13 # Set the default udevrule directory based on distribution.
14 %if %{undefined _udevruledir}
15 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
16 %global _udevruledir
%{_prefix}/lib
/udev
/rules.d
18 %global _udevruledir
/lib
/udev
/rules.d
22 # Set the default dracut directory based on distribution.
23 %if %{undefined _dracutdir}
24 %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
25 %global _dracutdir
%{_prefix}/lib
/dracut
27 %global _dracutdir
%{_prefix}/share
/dracut
31 # Set the default _initconfdir when undefined.
32 %if %{undefined _initconfdir}
33 %global _initconfdir
/etc
/sysconfig
41 # Python permits the !/usr/bin/python shebang for scripts that are cross
42 # compatible between python2 and python3, but Fedora 28 does not. Fedora
43 # wants us to choose python3 for cross-compatible scripts. Since we want
44 # to support python2 and python3 users, exclude our scripts from Fedora 28's
45 # RPM build check, so that we don't get a bunch of build warnings.
47 # Details: https://github.com/zfsonlinux/zfs/issues/7360
49 %global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|
test-runner.py|zts
-report.py
51 # Generic enable switch for systemd
56 # RHEL >= 7 comes with systemd
61 # Fedora >= 15 comes with systemd, but only >= 18 has
67 # opensuse >= 12.1 comes with systemd, but only >= 13.1
68 # has the proper macros
69 %if 0%{?suse_version} >= 1310
75 Release: @RELEASE@
%{?dist}
76 Summary: Commands to control the kernel modules and libraries
78 Group: System Environment
/Kernel
79 License: @ZFS_META_LICENSE@
80 URL: http
://zfsonlinux.org
/
81 Source0: %{name}-%{version}.tar.gz
82 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
83 Requires: libzpool2
= %{version}
84 Requires: libnvpair1
= %{version}
85 Requires: libuutil1
= %{version}
86 Requires: libzfs2
= %{version}
87 Requires: %{name}-kmod = %{version}
88 Provides: %{name}-kmod-common = %{version}
91 # zfs-fuse provides the same commands and man pages that ZoL does. Renaming
92 # those on either side would conflict with all available documentation.
95 %if 0%{?rhel}%{?fedora}%{?suse_version}
96 BuildRequires
: gcc
, make
97 BuildRequires
: zlib
-devel
98 BuildRequires
: libuuid
-devel
99 BuildRequires
: libblkid
-devel
100 BuildRequires
: libudev
-devel
101 BuildRequires
: libattr
-devel
102 BuildRequires
: openssl
-devel
103 %if 0%{?fedora} >= 28
104 BuildRequires
: libtirpc
-devel
108 BuildRequires
: systemd
113 Requires(post
): systemd
114 Requires(preun
): systemd
115 Requires(postun
): systemd
118 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
123 This package contains the ZFS
command line utilities.
125 %package -n libzpool2
126 Summary: Native ZFS pool library
for Linux
127 Group: System Environment
/Kernel
129 %description -n libzpool2
130 This package contains the zpool library
, which provides support
133 %post -n libzpool2
-p
/sbin
/ldconfig
134 %postun -n libzpool2
-p
/sbin
/ldconfig
136 %package -n libnvpair1
137 Summary: Solaris name
-value library
for Linux
138 Group: System Environment
/Kernel
140 %description -n libnvpair1
141 This package contains routines
for packing and unpacking name
-value
142 pairs. This functionality is used to portably transport data across
143 process boundaries
, between kernel and user space
, and can be used
144 to write self describing data structures on disk.
146 %post -n libnvpair1
-p
/sbin
/ldconfig
147 %postun -n libnvpair1
-p
/sbin
/ldconfig
149 %package -n libuutil1
150 Summary: Solaris userland utility library
for Linux
151 Group: System Environment
/Kernel
153 %description -n libuutil1
154 This library provides a variety of compatibility functions
for ZFS on Linux
:
155 * libspl
: The Solaris Porting Layer userland library
, which provides APIs
156 that
make it possible to run Solaris user code
in a Linux environment
157 with relatively minimal modification.
158 * libavl
: The Adelson
-Velskii Landis balanced binary tree manipulation
160 * libefi
: The Extensible Firmware Interface library
for GUID disk
162 * libshare
: NFS
, SMB
, and iSCSI service integration
for ZFS.
164 %post -n libuutil1
-p
/sbin
/ldconfig
165 %postun -n libuutil1
-p
/sbin
/ldconfig
168 Summary: Native ZFS filesystem library
for Linux
169 Group: System Environment
/Kernel
171 %description -n libzfs2
172 This package provides support
for managing ZFS filesystems
174 %post -n libzfs2
-p
/sbin
/ldconfig
175 %postun -n libzfs2
-p
/sbin
/ldconfig
177 %package -n libzfs2
-devel
178 Summary: Development headers
179 Group: System Environment
/Kernel
180 Requires: libzfs2
= %{version}
181 Requires: libzpool2
= %{version}
182 Requires: libnvpair1
= %{version}
183 Requires: libuutil1
= %{version}
184 Provides: libzpool2
-devel
185 Provides: libnvpair1
-devel
186 Provides: libuutil1
-devel
189 %description -n libzfs2
-devel
190 This package contains the header files needed
for building additional
191 applications against the ZFS libraries.
194 Summary: Test infrastructure
195 Group: System Environment
/Kernel
196 Requires: %{name}%{?_isa} = %{version}-%{release}
207 %if 0%{?rhel}%{?fedora}%{?suse_version}
208 BuildRequires
: libaio
-devel
213 This package contains
test infrastructure and support scripts
for
214 validating the file system.
217 Summary: Dracut module
218 Group: System Environment
/Kernel
219 Requires: %{name}%{?_isa} = %{version}-%{release}
221 Requires: /usr
/bin
/awk
225 This package contains a dracut module used to construct an initramfs
226 image which is ZFS aware.
230 Summary: Python wrapper
for libzfs_core
231 Group: Development
/Languages
/Python
234 Requires: libzfs2
= %{version}
235 Requires: libnvpair1
= %{version}
237 Requires: python
>= 2.7
238 Requires: python
-cffi
239 %if 0%{?rhel}%{?fedora}%{?suse_version}
240 BuildRequires
: python
-devel
241 BuildRequires
: libffi
-devel
244 %description -n pyzfs
245 This package provides a python wrapper
for the libzfs_core C library.
250 Summary: Initramfs module
251 Group: System Environment
/Kernel
252 Requires: %{name}%{?_isa} = %{version}-%{release}
253 Requires: %{name} = %{version}-%{release}
254 Requires: initramfs
-tools
256 %description initramfs
257 This package contains a initramfs module used to construct an initramfs
258 image which is ZFS aware.
263 %define debug
--enable-debug
265 %define debug
--disable
-debug
268 %if %{with debuginfo}
269 %define debuginfo
--enable-debuginfo
271 %define debuginfo
--disable
-debuginfo
275 %define asan
--enable-asan
277 %define asan
--disable
-asan
281 %define systemd
--enable-systemd
--with
-systemdunitdir
=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable
-sysvinit
282 %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
284 %define systemd
--enable-sysvinit
--disable
-systemd
292 --with
-udevdir
=%{_udevdir} \
293 --with
-udevruledir
=%{_udevruledir} \
294 --with
-dracutdir
=%{_dracutdir} \
303 %{__rm} -rf $RPM_BUILD_ROOT
304 make install DESTDIR
=%{?buildroot}
305 find
%{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \
;
309 %if 0%{?systemd_post:1}
310 %systemd_post %{systemd_svcs}
312 if [ "$
1"
= "
1"
-o "$
1"
= "
install"
] ; then
313 # Initial installation
314 systemctl preset
%{systemd_svcs} >/dev
/null || true
318 if [ -x
/sbin
/chkconfig
]; then
319 /sbin
/chkconfig
--add zfs
-import
320 /sbin
/chkconfig
--add zfs
-mount
321 /sbin
/chkconfig
--add zfs
-share
322 /sbin
/chkconfig
--add zfs
-zed
327 # On RHEL/CentOS 7 the static nodes aren't refreshed by default after
328 # installing a package. This is the default behavior for Fedora.
330 %if 0%{?rhel} == 7 || 0%{?centos} == 7
331 systemctl restart kmod
-static
-nodes
332 systemctl restart systemd
-tmpfiles
-setup
-dev
338 %if 0%{?systemd_preun:1}
339 %systemd_preun %{systemd_svcs}
341 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] ; then
342 # Package removal, not upgrade
343 systemctl
--no
-reload disable
%{systemd_svcs} >/dev
/null || true
344 systemctl stop
%{systemd_svcs} >/dev
/null || true
348 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] && [ -x
/sbin
/chkconfig
]; then
349 /sbin
/chkconfig
--del zfs
-import
350 /sbin
/chkconfig
--del zfs
-mount
351 /sbin
/chkconfig
--del zfs
-share
352 /sbin
/chkconfig
--del zfs
-zed
359 %if 0%{?systemd_postun:1}
360 %systemd_postun %{systemd_svcs}
362 systemctl
--system daemon
-reload
>/dev
/null || true
369 %{_libexecdir}/%{name}
375 %{_udevdir}/rules.d
/*
377 /usr
/lib
/modules
-load.d
/*
382 %config(noreplace
) %{_sysconfdir}/init.d
/*
383 %config(noreplace
) %{_initconfdir}/zfs
385 %config(noreplace
) %{_sysconfdir}/%{name}
386 %attr(440, root
, root
) %config(noreplace
) %{_sysconfdir}/sudoers.d
/*
389 %{_libdir}/libzpool.so.
*
392 %{_libdir}/libnvpair.so.
*
395 %{_libdir}/libuutil.so.
*
398 %{_libdir}/libzfs
*.so.
*
400 %files -n libzfs2
-devel
401 %{_datadir}/pkgconfig
/libzfs.pc
402 %{_datadir}/pkgconfig
/libzfs_core.pc
405 %doc AUTHORS COPYRIGHT LICENSE NOTICE README.md
411 %doc contrib
/dracut
/README.dracut.markdown
412 %{_dracutdir}/modules.d
/*
416 %doc contrib
/pyzfs
/README
417 %doc contrib
/pyzfs
/LICENSE
418 %defattr(-,root
,root
,-)
419 %{python_sitelib}/libzfs_core
/*
420 %{python_sitelib}/pyzfs
*
425 %doc contrib
/initramfs
/README.initramfs.markdown
426 /usr
/share
/initramfs
-tools
/*
428 # Since we're not building the initramfs package,
429 # ignore those files.
430 %exclude /usr
/share
/initramfs
-tools