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