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 # Generic enable switch for systemd
46 # RHEL >= 7 comes with systemd
51 # Fedora >= 15 comes with systemd, but only >= 18 has
57 # opensuse >= 12.1 comes with systemd, but only >= 13.1
58 # has the proper macros
59 %if 0%{?suse_version} >= 1310
65 Release: @RELEASE@
%{?dist}
66 Summary: Commands to control the kernel modules and libraries
68 Group: System Environment
/Kernel
69 License: @ZFS_META_LICENSE@
70 URL: http
://zfsonlinux.org
/
71 Source0: %{name}-%{version}.tar.gz
72 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n
)
73 Requires: spl
= %{version}
74 Requires: libzpool2
= %{version}
75 Requires: libnvpair1
= %{version}
76 Requires: libuutil1
= %{version}
77 Requires: libzfs2
= %{version}
78 Requires: %{name}-kmod = %{version}
79 Provides: %{name}-kmod-common = %{version}
81 # zfs-fuse provides the same commands and man pages that ZoL does. Renaming
82 # those on either side would conflict with all available documentation.
85 %if 0%{?rhel}%{?fedora}%{?suse_version}
86 BuildRequires
: zlib
-devel
87 BuildRequires
: libuuid
-devel
88 BuildRequires
: libblkid
-devel
89 BuildRequires
: libudev
-devel
90 BuildRequires
: libattr
-devel
91 BuildRequires
: openssl
-devel
94 BuildRequires
: systemd
99 Requires(post
): systemd
100 Requires(preun
): systemd
101 Requires(postun
): systemd
104 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
109 This package contains the ZFS
command line utilities.
111 %package -n libzpool2
112 Summary: Native ZFS pool library
for Linux
113 Group: System Environment
/Kernel
115 %description -n libzpool2
116 This package contains the zpool library
, which provides support
119 %post -n libzpool2
-p
/sbin
/ldconfig
120 %postun -n libzpool2
-p
/sbin
/ldconfig
122 %package -n libnvpair1
123 Summary: Solaris name
-value library
for Linux
124 Group: System Environment
/Kernel
126 %description -n libnvpair1
127 This package contains routines
for packing and unpacking name
-value
128 pairs. This functionality is used to portably transport data across
129 process boundaries
, between kernel and user space
, and can be used
130 to write self describing data structures on disk.
132 %post -n libnvpair1
-p
/sbin
/ldconfig
133 %postun -n libnvpair1
-p
/sbin
/ldconfig
135 %package -n libuutil1
136 Summary: Solaris userland utility library
for Linux
137 Group: System Environment
/Kernel
139 %description -n libuutil1
140 This library provides a variety of compatibility functions
for ZFS on Linux
:
141 * libspl
: The Solaris Porting Layer userland library
, which provides APIs
142 that
make it possible to run Solaris user code
in a Linux environment
143 with relatively minimal modification.
144 * libavl
: The Adelson
-Velskii Landis balanced binary tree manipulation
146 * libefi
: The Extensible Firmware Interface library
for GUID disk
148 * libshare
: NFS
, SMB
, and iSCSI service integration
for ZFS.
150 %post -n libuutil1
-p
/sbin
/ldconfig
151 %postun -n libuutil1
-p
/sbin
/ldconfig
154 Summary: Native ZFS filesystem library
for Linux
155 Group: System Environment
/Kernel
157 %description -n libzfs2
158 This package provides support
for managing ZFS filesystems
160 %post -n libzfs2
-p
/sbin
/ldconfig
161 %postun -n libzfs2
-p
/sbin
/ldconfig
163 %package -n libzfs2
-devel
164 Summary: Development headers
165 Group: System Environment
/Kernel
166 Requires: libzfs2
= %{version}
167 Requires: libzpool2
= %{version}
168 Requires: libnvpair1
= %{version}
169 Requires: libuutil1
= %{version}
170 Provides: libzpool2
-devel
171 Provides: libnvpair1
-devel
172 Provides: libuutil1
-devel
175 %description -n libzfs2
-devel
176 This package contains the header files needed
for building additional
177 applications against the ZFS libraries.
180 Summary: Test infrastructure
181 Group: System Environment
/Kernel
182 Requires: %{name}%{?_isa} = %{version}-%{release}
196 This package contains
test infrastructure and support scripts
for
197 validating the file system.
200 Summary: Dracut module
201 Group: System Environment
/Kernel
202 Requires: %{name}%{?_isa} = %{version}-%{release}
206 This package contains a dracut module used to construct an initramfs
207 image which is ZFS aware.
211 Summary: Initramfs module
212 Group: System Environment
/Kernel
213 Requires: %{name}%{?_isa} = %{version}-%{release}
214 Requires: %{name} = %{version}-%{release}
215 Requires: initramfs
-tools
217 %description initramfs
218 This package contains a initramfs module used to construct an initramfs
219 image which is ZFS aware.
224 %define debug
--enable-debug
226 %define debug
--disable
-debug
229 %if %{with debuginfo}
230 %define debuginfo
--enable-debuginfo
232 %define debuginfo
--disable
-debuginfo
236 %define asan
--enable-asan
238 %define asan
--disable
-asan
242 %define systemd
--enable-systemd
--with
-systemdunitdir
=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable
-sysvinit
243 %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
245 %define systemd
--enable-sysvinit
--disable
-systemd
253 --with
-udevdir
=%{_udevdir} \
254 --with
-udevruledir
=%{_udevruledir} \
255 --with
-dracutdir
=%{_dracutdir} \
264 %{__rm} -rf $RPM_BUILD_ROOT
265 make install DESTDIR
=%{?buildroot}
266 find
%{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \
;
270 %if 0%{?systemd_post:1}
271 %systemd_post %{systemd_svcs}
273 if [ "$
1"
= "
1"
-o "$
1"
= "
install"
] ; then
274 # Initial installation
275 systemctl preset
%{systemd_svcs} >/dev
/null || true
279 if [ -x
/sbin
/chkconfig
]; then
280 /sbin
/chkconfig
--add zfs
-import
281 /sbin
/chkconfig
--add zfs
-mount
282 /sbin
/chkconfig
--add zfs
-share
283 /sbin
/chkconfig
--add zfs
-zed
288 # On RHEL/CentOS 7 the static nodes aren't refreshed by default after
289 # installing a package. This is the default behavior for Fedora.
291 %if 0%{?rhel} == 7 || 0%{?centos} == 7
292 systemctl restart kmod
-static
-nodes
293 systemctl restart systemd
-tmpfiles
-setup
-dev
299 %if 0%{?systemd_preun:1}
300 %systemd_preun %{systemd_svcs}
302 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] ; then
303 # Package removal, not upgrade
304 systemctl
--no
-reload disable
%{systemd_svcs} >/dev
/null || true
305 systemctl stop
%{systemd_svcs} >/dev
/null || true
309 if [ "$
1"
= "
0"
-o "$
1"
= "remove"
] && [ -x
/sbin
/chkconfig
]; then
310 /sbin
/chkconfig
--del zfs
-import
311 /sbin
/chkconfig
--del zfs
-mount
312 /sbin
/chkconfig
--del zfs
-share
313 /sbin
/chkconfig
--del zfs
-zed
320 %if 0%{?systemd_postun:1}
321 %systemd_postun %{systemd_svcs}
323 systemctl
--system daemon
-reload
>/dev
/null || true
330 %{_libexecdir}/%{name}
336 %{_udevdir}/rules.d
/*
338 /usr
/lib
/modules
-load.d
/*
342 %config(noreplace
) %{_sysconfdir}/init.d
/*
343 %config(noreplace
) %{_initconfdir}/zfs
345 %config(noreplace
) %{_sysconfdir}/%{name}
346 %attr(440, root
, root
) %config(noreplace
) %{_sysconfdir}/sudoers.d
/*
349 %{_libdir}/libzpool.so.
*
352 %{_libdir}/libnvpair.so.
*
355 %{_libdir}/libuutil.so.
*
358 %{_libdir}/libzfs
*.so.
*
360 %files -n libzfs2
-devel
361 %{_datadir}/pkgconfig
/libzfs.pc
362 %{_datadir}/pkgconfig
/libzfs_core.pc
365 %doc AUTHORS COPYRIGHT DISCLAIMER
366 %doc OPENSOLARIS.LICENSE README.markdown
372 %doc contrib
/dracut
/README.dracut.markdown
373 %{_dracutdir}/modules.d
/*
377 %doc contrib
/initramfs
/README.initramfs.markdown
378 /usr
/share
/initramfs
-tools
/*
380 # Since we're not building the initramfs package,
381 # ignore those files.
382 %exclude /usr
/share
/initramfs
-tools
386 * Wed Jul
26 2017 Brian Behlendorf
<behlendorf1@llnl.gov
> - 0.7.0-1
387 - Released
0.7.0-1, detailed release notes are available at
:
388 - https
://github.com
/zfsonlinux
/zfs
/releases
/tag
/zfs
-0.7.0