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