]> git.proxmox.com Git - mirror_zfs-debian.git/blame - rpm/redhat/zfs.spec.in
New upstream version 0.7.11
[mirror_zfs-debian.git] / rpm / redhat / zfs.spec.in
CommitLineData
ea04106b
AX
1%global _sbindir /sbin
2%global _libdir /%{_lib}
3
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
8%else
9%global _udevdir /lib/udev
10%endif
11%endif
12
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
17%else
18%global _udevruledir /lib/udev/rules.d
19%endif
20%endif
21
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
26%else
27%global _dracutdir %{_prefix}/share/dracut
28%endif
29%endif
30
e10b0808
AX
31# Set the default _initconfdir when undefined.
32%if %{undefined _initconfdir}
33%global _initconfdir /etc/sysconfig
34%endif
35
ea04106b 36%bcond_with debug
ea04106b
AX
37%bcond_with systemd
38
42f7b73b
AX
39# Python permits the !/usr/bin/python shebang for scripts that are cross
40# compatible between python2 and python3, but Fedora 28 does not. Fedora
41# wants us to choose python3 for cross-compatible scripts. Since we want
42# to support python2 and python3 users, exclude our scripts from Fedora 28's
43# RPM build check, so that we don't get a bunch of build warnings.
44#
45# Details: https://github.com/zfsonlinux/zfs/issues/7360
46#
47%global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py
48
ea04106b
AX
49# Generic enable switch for systemd
50%if %{with systemd}
51%define _systemd 1
52%endif
53
54# RHEL >= 7 comes with systemd
55%if 0%{?rhel} >= 7
56%define _systemd 1
57%endif
58
59# Fedora >= 15 comes with systemd, but only >= 18 has
60# the proper macros
61%if 0%{?fedora} >= 18
62%define _systemd 1
63%endif
64
65# opensuse >= 12.1 comes with systemd, but only >= 13.1
66# has the proper macros
67%if 0%{?suse_version} >= 1310
68%define _systemd 1
69%endif
70
71Name: @PACKAGE@
72Version: @VERSION@
73Release: @RELEASE@%{?dist}
74Summary: Commands to control the kernel modules and libraries
75
76Group: System Environment/Kernel
77License: @ZFS_META_LICENSE@
78URL: http://zfsonlinux.org/
79Source0: %{name}-%{version}.tar.gz
80BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ea04106b
AX
81Requires: spl = %{version}
82Requires: libzpool2 = %{version}
83Requires: libnvpair1 = %{version}
84Requires: libuutil1 = %{version}
85Requires: libzfs2 = %{version}
86Requires: %{name}-kmod = %{version}
87Provides: %{name}-kmod-common = %{version}
88
89# zfs-fuse provides the same commands and man pages that ZoL does. Renaming
90# those on either side would conflict with all available documentation.
91Conflicts: zfs-fuse
92
93%if 0%{?rhel}%{?fedora}%{?suse_version}
94BuildRequires: zlib-devel
95BuildRequires: libuuid-devel
ea04106b 96BuildRequires: libblkid-devel
cae5b340
AX
97BuildRequires: libudev-devel
98BuildRequires: libattr-devel
42f7b73b
AX
99%if 0%{?fedora} >= 28
100BuildRequires: libtirpc-devel
101%endif
ea04106b 102%endif
42f7b73b 103
ea04106b
AX
104%if 0%{?_systemd}
105Requires(post): systemd
106Requires(preun): systemd
107Requires(postun): systemd
ea04106b
AX
108%endif
109
cae5b340
AX
110# The zpool iostat/status -c scripts call some utilities like lsblk and iostat
111Requires: util-linux
112Requires: sysstat
113
ea04106b
AX
114%description
115This package contains the ZFS command line utilities.
116
117%package -n libzpool2
118Summary: Native ZFS pool library for Linux
119Group: System Environment/Kernel
120
121%description -n libzpool2
122This package contains the zpool library, which provides support
123for managing zpools
124
125%post -n libzpool2 -p /sbin/ldconfig
126%postun -n libzpool2 -p /sbin/ldconfig
127
128%package -n libnvpair1
129Summary: Solaris name-value library for Linux
130Group: System Environment/Kernel
131
132%description -n libnvpair1
133This package contains routines for packing and unpacking name-value
134pairs. This functionality is used to portably transport data across
135process boundaries, between kernel and user space, and can be used
136to write self describing data structures on disk.
137
138%post -n libnvpair1 -p /sbin/ldconfig
139%postun -n libnvpair1 -p /sbin/ldconfig
140
141%package -n libuutil1
142Summary: Solaris userland utility library for Linux
143Group: System Environment/Kernel
144
145%description -n libuutil1
146This library provides a variety of compatibility functions for ZFS on Linux:
147 * libspl: The Solaris Porting Layer userland library, which provides APIs
148 that make it possible to run Solaris user code in a Linux environment
149 with relatively minimal modification.
150 * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
151 library.
152 * libefi: The Extensible Firmware Interface library for GUID disk
153 partitioning.
154 * libshare: NFS, SMB, and iSCSI service integration for ZFS.
155
156%post -n libuutil1 -p /sbin/ldconfig
157%postun -n libuutil1 -p /sbin/ldconfig
158
159%package -n libzfs2
160Summary: Native ZFS filesystem library for Linux
161Group: System Environment/Kernel
162
163%description -n libzfs2
164This package provides support for managing ZFS filesystems
165
166%post -n libzfs2 -p /sbin/ldconfig
167%postun -n libzfs2 -p /sbin/ldconfig
168
169%package -n libzfs2-devel
170Summary: Development headers
171Group: System Environment/Kernel
172Requires: libzfs2 = %{version}
173Requires: libzpool2 = %{version}
174Requires: libnvpair1 = %{version}
175Requires: libuutil1 = %{version}
176Provides: libzpool2-devel
177Provides: libnvpair1-devel
178Provides: libuutil1-devel
179Obsoletes: zfs-devel
180
181%description -n libzfs2-devel
182This package contains the header files needed for building additional
183applications against the ZFS libraries.
184
185%package test
186Summary: Test infrastructure
187Group: System Environment/Kernel
188Requires: %{name}%{?_isa} = %{version}-%{release}
189Requires: parted
190Requires: lsscsi
191Requires: mdadm
192Requires: bc
cae5b340 193Requires: ksh
41d74433
AX
194Requires: fio
195Requires: acl
196Requires: sudo
197Requires: sysstat
198Requires: rng-tools
a07c8b41
MZ
199Requires: libaio
200%if 0%{?rhel}%{?fedora}%{?suse_version}
201BuildRequires: libaio-devel
202%endif
41d74433 203AutoReqProv: no
ea04106b
AX
204
205%description test
206This package contains test infrastructure and support scripts for
207validating the file system.
208
209%package dracut
210Summary: Dracut module
211Group: System Environment/Kernel
212Requires: %{name}%{?_isa} = %{version}-%{release}
213Requires: dracut
a07c8b41
MZ
214Requires: /usr/bin/awk
215Requires: grep
ea04106b
AX
216
217%description dracut
218This package contains a dracut module used to construct an initramfs
219image which is ZFS aware.
220
e10b0808
AX
221%if 0%{?_initramfs}
222%package initramfs
223Summary: Initramfs module
224Group: System Environment/Kernel
225Requires: %{name}%{?_isa} = %{version}-%{release}
226Requires: %{name} = %{version}-%{release}
227Requires: initramfs-tools
228
229%description initramfs
230This package contains a initramfs module used to construct an initramfs
231image which is ZFS aware.
232%endif
233
ea04106b
AX
234%prep
235%if %{with debug}
236 %define debug --enable-debug
237%else
238 %define debug --disable-debug
239%endif
ea04106b
AX
240%if 0%{?_systemd}
241 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
6b763916 242 %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
ea04106b
AX
243%else
244 %define systemd --enable-sysvinit --disable-systemd
245%endif
246
247%setup -q
248
249%build
250%configure \
251 --with-config=user \
252 --with-udevdir=%{_udevdir} \
253 --with-udevruledir=%{_udevruledir} \
254 --with-dracutdir=%{_dracutdir} \
255 --disable-static \
256 %{debug} \
ea04106b
AX
257 %{systemd}
258make %{?_smp_mflags}
259
260%install
261%{__rm} -rf $RPM_BUILD_ROOT
262make install DESTDIR=%{?buildroot}
263find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
264
265%post
266%if 0%{?_systemd}
42f7b73b 267%if 0%{?systemd_post:1}
68d83c55 268%systemd_post %{systemd_svcs}
ea04106b 269%else
42f7b73b
AX
270if [ "$1" = "1" -o "$1" = "install" ] ; then
271 # Initial installation
272 systemctl preset %{systemd_svcs} >/dev/null || true
273fi
274%endif
275%else
e10b0808
AX
276if [ -x /sbin/chkconfig ]; then
277 /sbin/chkconfig --add zfs-import
278 /sbin/chkconfig --add zfs-mount
279 /sbin/chkconfig --add zfs-share
280 /sbin/chkconfig --add zfs-zed
281fi
ea04106b
AX
282%endif
283exit 0
284
285%preun
286%if 0%{?_systemd}
42f7b73b 287%if 0%{?systemd_preun:1}
68d83c55 288%systemd_preun %{systemd_svcs}
ea04106b 289%else
42f7b73b
AX
290if [ "$1" = "0" -o "$1" = "remove" ] ; then
291 # Package removal, not upgrade
292 systemctl --no-reload disable %{systemd_svcs} >/dev/null || true
293 systemctl stop %{systemd_svcs} >/dev/null || true
294fi
295%endif
296%else
297if [ "$1" = "0" -o "$1" = "remove" ] && [ -x /sbin/chkconfig ]; then
e10b0808
AX
298 /sbin/chkconfig --del zfs-import
299 /sbin/chkconfig --del zfs-mount
300 /sbin/chkconfig --del zfs-share
301 /sbin/chkconfig --del zfs-zed
ea04106b
AX
302fi
303%endif
304exit 0
305
306%postun
307%if 0%{?_systemd}
42f7b73b 308%if 0%{?systemd_postun:1}
68d83c55 309%systemd_postun %{systemd_svcs}
42f7b73b
AX
310%else
311systemctl --system daemon-reload >/dev/null || true
312%endif
ea04106b
AX
313%endif
314
315%files
316%{_sbindir}/*
317%{_bindir}/*
318%{_libexecdir}/%{name}
319%{_mandir}/man1/*
320%{_mandir}/man5/*
321%{_mandir}/man8/*
322%{_udevdir}/vdev_id
323%{_udevdir}/zvol_id
324%{_udevdir}/rules.d/*
ea04106b
AX
325%if 0%{?_systemd}
326/usr/lib/modules-load.d/*
327%{_unitdir}/*
328%{_presetdir}/*
329%else
e10b0808
AX
330%config(noreplace) %{_sysconfdir}/init.d/*
331%config(noreplace) %{_initconfdir}/zfs
ea04106b 332%endif
e10b0808 333%config(noreplace) %{_sysconfdir}/%{name}
cae5b340 334%attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*
ea04106b
AX
335
336%files -n libzpool2
337%{_libdir}/libzpool.so.*
338
339%files -n libnvpair1
340%{_libdir}/libnvpair.so.*
341
342%files -n libuutil1
343%{_libdir}/libuutil.so.*
344
345%files -n libzfs2
346%{_libdir}/libzfs*.so.*
347
348%files -n libzfs2-devel
349%{_datadir}/pkgconfig/libzfs.pc
350%{_datadir}/pkgconfig/libzfs_core.pc
351%{_libdir}/*.so
352%{_includedir}/*
353%doc AUTHORS COPYRIGHT DISCLAIMER
354%doc OPENSOLARIS.LICENSE README.markdown
355
356%files test
357%{_datadir}/%{name}
358
359%files dracut
e10b0808 360%doc contrib/dracut/README.dracut.markdown
ea04106b
AX
361%{_dracutdir}/modules.d/*
362
e10b0808
AX
363%if 0%{?_initramfs}
364%files initramfs
365%doc contrib/initramfs/README.initramfs.markdown
366/usr/share/initramfs-tools/*
367%else
368# Since we're not building the initramfs package,
369# ignore those files.
370%exclude /usr/share/initramfs-tools
371%endif
372
ea04106b 373%changelog
a07c8b41
MZ
374* Thu Sep 13 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.11-1
375- Released 0.7.11-1, detailed release notes are available at:
376- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.11
377* Wed Sep 05 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.10-1
378- Released 0.7.10-1, detailed release notes are available at:
379- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.10
42f7b73b
AX
380* Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
381- Released 0.7.9-1, detailed release notes are available at:
382- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
383* Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
384- Released 0.7.8-1, detailed release notes are available at:
385- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
386* Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
387- Released 0.7.7-1, detailed release notes are available at:
388- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
047218e2
AX
389* Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
390- Released 0.7.6-1, detailed release notes are available at:
391- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
6b763916
AX
392* Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
393- Released 0.7.5-1, detailed release notes are available at:
394- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
41d74433
AX
395* Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
396- Released 0.7.4-1, detailed release notes are available at:
397- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
8ec27e97
AX
398* Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
399- Released 0.7.3-1, detailed release notes are available at:
400- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
401* Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
cae5b340
AX
402- Released 0.7.2-1, detailed release notes are available at:
403- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
404* Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
405- Released 0.7.1-1, detailed release notes are available at:
406- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.1
407* Wed Jul 26 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.7.0-1
408- Released 0.7.0-1, detailed release notes are available at:
409- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0