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
: zlib
-devel
97 BuildRequires
: libuuid
-devel
98 BuildRequires
: libblkid
-devel
99 BuildRequires
: libudev
-devel
100 BuildRequires
: libattr
-devel
101 BuildRequires
: openssl
-devel
102 %if 0%{?fedora} >= 28
103 BuildRequires
: libtirpc
-devel
107 BuildRequires
: systemd
112 Requires(post
): systemd
113 Requires(preun
): systemd
114 Requires(postun
): systemd
117 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
122 This package contains the ZFS
command line utilities.
124 %package -n libzpool2
125 Summary: Native ZFS pool library
for Linux
126 Group: System Environment
/Kernel
128 %description -n libzpool2
129 This package contains the zpool library
, which provides support
132 %post -n libzpool2
-p
/sbin
/ldconfig
133 %postun -n libzpool2
-p
/sbin
/ldconfig
135 %package -n libnvpair1
136 Summary: Solaris name
-value library
for Linux
137 Group: System Environment
/Kernel
139 %description -n libnvpair1
140 This package contains routines
for packing and unpacking name
-value
141 pairs. This functionality is used to portably transport data across
142 process boundaries
, between kernel and user space
, and can be used
143 to write self describing data structures on disk.
145 %post -n libnvpair1
-p
/sbin
/ldconfig
146 %postun -n libnvpair1
-p
/sbin
/ldconfig
148 %package -n libuutil1
149 Summary: Solaris userland utility library
for Linux
150 Group: System Environment
/Kernel
152 %description -n libuutil1
153 This library provides a variety of compatibility functions
for ZFS on Linux
:
154 * libspl
: The Solaris Porting Layer userland library
, which provides APIs
155 that
make it possible to run Solaris user code
in a Linux environment
156 with relatively minimal modification.
157 * libavl
: The Adelson
-Velskii Landis balanced binary tree manipulation
159 * libefi
: The Extensible Firmware Interface library
for GUID disk
161 * libshare
: NFS
, SMB
, and iSCSI service integration
for ZFS.
163 %post -n libuutil1
-p
/sbin
/ldconfig
164 %postun -n libuutil1
-p
/sbin
/ldconfig
167 Summary: Native ZFS filesystem library
for Linux
168 Group: System Environment
/Kernel
170 %description -n libzfs2
171 This package provides support
for managing ZFS filesystems
173 %post -n libzfs2
-p
/sbin
/ldconfig
174 %postun -n libzfs2
-p
/sbin
/ldconfig
176 %package -n libzfs2
-devel
177 Summary: Development headers
178 Group: System Environment
/Kernel
179 Requires: libzfs2
= %{version}
180 Requires: libzpool2
= %{version}
181 Requires: libnvpair1
= %{version}
182 Requires: libuutil1
= %{version}
183 Provides: libzpool2
-devel
184 Provides: libnvpair1
-devel
185 Provides: libuutil1
-devel
188 %description -n libzfs2
-devel
189 This package contains the header files needed
for building additional
190 applications against the ZFS libraries.
193 Summary: Test infrastructure
194 Group: System Environment
/Kernel
195 Requires: %{name}%{?_isa} = %{version}-%{release}
206 %if 0%{?rhel}%{?fedora}%{?suse_version}
207 BuildRequires
: libaio
-devel
212 This package contains
test infrastructure and support scripts
for
213 validating the file system.
216 Summary: Dracut module
217 Group: System Environment
/Kernel
218 Requires: %{name}%{?_isa} = %{version}-%{release}
220 Requires: /usr
/bin
/awk
224 This package contains a dracut module used to construct an initramfs
225 image which is ZFS aware.
229 Summary: Python wrapper
for libzfs_core
230 Group: Development
/Languages
/Python
233 Requires: libzfs2
= %{version}
234 Requires: libnvpair1
= %{version}
236 Requires: python
>= 2.7
237 Requires: python
-cffi
238 %if 0%{?rhel}%{?fedora}%{?suse_version}
239 BuildRequires
: python
-devel
240 BuildRequires
: libffi
-devel
243 %description -n pyzfs
244 This package provides a python wrapper
for the libzfs_core C library.
249 Summary: Initramfs module
250 Group: System Environment
/Kernel
251 Requires: %{name}%{?_isa} = %{version}-%{release}
252 Requires: %{name} = %{version}-%{release}
253 Requires: initramfs
-tools
255 %description initramfs
256 This package contains a initramfs module used to construct an initramfs
257 image which is ZFS aware.
262 %define debug
--enable-debug
264 %define debug
--disable
-debug
267 %if %{with debuginfo}
268 %define debuginfo
--enable-debuginfo
270 %define debuginfo
--disable
-debuginfo
274 %define asan
--enable-asan
276 %define asan
--disable
-asan
280 %define systemd
--enable-systemd
--with
-systemdunitdir
=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable
-sysvinit
281 %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
283 %define systemd
--enable-sysvinit
--disable
-systemd
291 --with
-udevdir
=%{_udevdir} \
292 --with
-udevruledir
=%{_udevruledir} \
293 --with
-dracutdir
=%{_dracutdir} \
302 %{__rm} -rf $RPM_BUILD_ROOT
303 make install DESTDIR
=%{?buildroot}
304 find
%{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \
;
308 %if 0%{?systemd_post:1}
309 %systemd_post %{systemd_svcs}
311 if [ "$
1"
= "
1"
-o "$
1"
= "
install"
] ; then
312 # Initial installation
313 systemctl preset
%{systemd_svcs} >/dev
/null || true
317 if [ -x
/sbin
/chkconfig
]; then
318 /sbin
/chkconfig
--add zfs
-import
319 /sbin
/chkconfig
--add zfs
-mount
320 /sbin
/chkconfig
--add zfs
-share
321 /sbin
/chkconfig
--add zfs
-zed
326 # On RHEL/CentOS 7 the static nodes aren't refreshed by default after
327 # installing a package. This is the default behavior for Fedora.
329 %if 0%{?rhel} == 7 || 0%{?centos} == 7
330 systemctl restart kmod
-static
-nodes
331 systemctl restart systemd
-tmpfiles
-setup
-dev
337 %if 0%{?systemd_preun:1}
338 %systemd_preun %{systemd_svcs}
340 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] ; then
341 # Package removal, not upgrade
342 systemctl
--no
-reload disable
%{systemd_svcs} >/dev
/null || true
343 systemctl stop
%{systemd_svcs} >/dev
/null || true
347 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] && [ -x
/sbin
/chkconfig
]; then
348 /sbin
/chkconfig
--del zfs
-import
349 /sbin
/chkconfig
--del zfs
-mount
350 /sbin
/chkconfig
--del zfs
-share
351 /sbin
/chkconfig
--del zfs
-zed
358 %if 0%{?systemd_postun:1}
359 %systemd_postun %{systemd_svcs}
361 systemctl
--system daemon
-reload
>/dev
/null || true
368 %{_libexecdir}/%{name}
374 %{_udevdir}/rules.d
/*
376 /usr
/lib
/modules
-load.d
/*
381 %config(noreplace
) %{_sysconfdir}/init.d
/*
382 %config(noreplace
) %{_initconfdir}/zfs
384 %config(noreplace
) %{_sysconfdir}/%{name}
385 %attr(440, root
, root
) %config(noreplace
) %{_sysconfdir}/sudoers.d
/*
388 %{_libdir}/libzpool.so.
*
391 %{_libdir}/libnvpair.so.
*
394 %{_libdir}/libuutil.so.
*
397 %{_libdir}/libzfs
*.so.
*
399 %files -n libzfs2
-devel
400 %{_datadir}/pkgconfig
/libzfs.pc
401 %{_datadir}/pkgconfig
/libzfs_core.pc
404 %doc AUTHORS COPYRIGHT LICENSE NOTICE README.md
410 %doc contrib
/dracut
/README.dracut.markdown
411 %{_dracutdir}/modules.d
/*
415 %doc contrib
/pyzfs
/README
416 %doc contrib
/pyzfs
/LICENSE
417 %defattr(-,root
,root
,-)
418 %{python_sitelib}/libzfs_core
/*
419 %{python_sitelib}/pyzfs
*
424 %doc contrib
/initramfs
/README.initramfs.markdown
425 /usr
/share
/initramfs
-tools
/*
427 # Since we're not building the initramfs package,
428 # ignore those files.
429 %exclude /usr
/share
/initramfs
-tools