]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
Force ztest to always use /dev/urandom
[mirror_zfs.git] / rpm / generic / zfs.spec.in
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
31 # Set the default _initconfdir when undefined.
32 %if %{undefined _initconfdir}
33 %global _initconfdir /etc/sysconfig
34 %endif
35
36 %bcond_with debug
37 %bcond_with debuginfo
38 %bcond_with asan
39 %bcond_with systemd
40
41 # Generic enable switch for systemd
42 %if %{with systemd}
43 %define _systemd 1
44 %endif
45
46 # RHEL >= 7 comes with systemd
47 %if 0%{?rhel} >= 7
48 %define _systemd 1
49 %endif
50
51 # Fedora >= 15 comes with systemd, but only >= 18 has
52 # the proper macros
53 %if 0%{?fedora} >= 18
54 %define _systemd 1
55 %endif
56
57 # opensuse >= 12.1 comes with systemd, but only >= 13.1
58 # has the proper macros
59 %if 0%{?suse_version} >= 1310
60 %define _systemd 1
61 %endif
62
63 Name: @PACKAGE@
64 Version: @VERSION@
65 Release: @RELEASE@%{?dist}
66 Summary: Commands to control the kernel modules and libraries
67
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}
80
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.
83 Conflicts: zfs-fuse
84
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
92 Requires: openssl
93 %if 0%{?_systemd}
94 BuildRequires: systemd
95 %endif
96 %endif
97
98 %if 0%{?_systemd}
99 Requires(post): systemd
100 Requires(preun): systemd
101 Requires(postun): systemd
102 %endif
103
104 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
105 Requires: util-linux
106 Requires: sysstat
107
108 %description
109 This package contains the ZFS command line utilities.
110
111 %package -n libzpool2
112 Summary: Native ZFS pool library for Linux
113 Group: System Environment/Kernel
114
115 %description -n libzpool2
116 This package contains the zpool library, which provides support
117 for managing zpools
118
119 %post -n libzpool2 -p /sbin/ldconfig
120 %postun -n libzpool2 -p /sbin/ldconfig
121
122 %package -n libnvpair1
123 Summary: Solaris name-value library for Linux
124 Group: System Environment/Kernel
125
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.
131
132 %post -n libnvpair1 -p /sbin/ldconfig
133 %postun -n libnvpair1 -p /sbin/ldconfig
134
135 %package -n libuutil1
136 Summary: Solaris userland utility library for Linux
137 Group: System Environment/Kernel
138
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
145 library.
146 * libefi: The Extensible Firmware Interface library for GUID disk
147 partitioning.
148 * libshare: NFS, SMB, and iSCSI service integration for ZFS.
149
150 %post -n libuutil1 -p /sbin/ldconfig
151 %postun -n libuutil1 -p /sbin/ldconfig
152
153 %package -n libzfs2
154 Summary: Native ZFS filesystem library for Linux
155 Group: System Environment/Kernel
156
157 %description -n libzfs2
158 This package provides support for managing ZFS filesystems
159
160 %post -n libzfs2 -p /sbin/ldconfig
161 %postun -n libzfs2 -p /sbin/ldconfig
162
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
173 Obsoletes: zfs-devel
174
175 %description -n libzfs2-devel
176 This package contains the header files needed for building additional
177 applications against the ZFS libraries.
178
179 %package test
180 Summary: Test infrastructure
181 Group: System Environment/Kernel
182 Requires: %{name}%{?_isa} = %{version}-%{release}
183 Requires: parted
184 Requires: lsscsi
185 Requires: mdadm
186 Requires: bc
187 Requires: ksh
188 Requires: fio
189 Requires: acl
190 Requires: sudo
191 Requires: sysstat
192 AutoReqProv: no
193
194 %description test
195 This package contains test infrastructure and support scripts for
196 validating the file system.
197
198 %package dracut
199 Summary: Dracut module
200 Group: System Environment/Kernel
201 Requires: %{name}%{?_isa} = %{version}-%{release}
202 Requires: dracut
203
204 %description dracut
205 This package contains a dracut module used to construct an initramfs
206 image which is ZFS aware.
207
208 %if 0%{?_initramfs}
209 %package initramfs
210 Summary: Initramfs module
211 Group: System Environment/Kernel
212 Requires: %{name}%{?_isa} = %{version}-%{release}
213 Requires: %{name} = %{version}-%{release}
214 Requires: initramfs-tools
215
216 %description initramfs
217 This package contains a initramfs module used to construct an initramfs
218 image which is ZFS aware.
219 %endif
220
221 %prep
222 %if %{with debug}
223 %define debug --enable-debug
224 %else
225 %define debug --disable-debug
226 %endif
227
228 %if %{with debuginfo}
229 %define debuginfo --enable-debuginfo
230 %else
231 %define debuginfo --disable-debuginfo
232 %endif
233
234 %if %{with asan}
235 %define asan --enable-asan
236 %else
237 %define asan --disable-asan
238 %endif
239
240 %if 0%{?_systemd}
241 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
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
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} \
257 %{debuginfo} \
258 %{asan} \
259 %{systemd}
260 make %{?_smp_mflags}
261
262 %install
263 %{__rm} -rf $RPM_BUILD_ROOT
264 make install DESTDIR=%{?buildroot}
265 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
266
267 %post
268 %if 0%{?_systemd}
269 %systemd_post %{systemd_svcs}
270 %else
271 if [ -x /sbin/chkconfig ]; then
272 /sbin/chkconfig --add zfs-import
273 /sbin/chkconfig --add zfs-mount
274 /sbin/chkconfig --add zfs-share
275 /sbin/chkconfig --add zfs-zed
276 fi
277 %endif
278 exit 0
279
280 %preun
281 %if 0%{?_systemd}
282 %systemd_preun %{systemd_svcs}
283 %else
284 if [ "$1" = "0" ] && [ -x /sbin/chkconfig ]; then
285 /sbin/chkconfig --del zfs-import
286 /sbin/chkconfig --del zfs-mount
287 /sbin/chkconfig --del zfs-share
288 /sbin/chkconfig --del zfs-zed
289 fi
290 %endif
291 exit 0
292
293 %postun
294 %if 0%{?_systemd}
295 %systemd_postun %{systemd_svcs}
296 %endif
297
298 %files
299 %{_sbindir}/*
300 %{_bindir}/*
301 %{_libexecdir}/%{name}
302 %{_mandir}/man1/*
303 %{_mandir}/man5/*
304 %{_mandir}/man8/*
305 %{_udevdir}/vdev_id
306 %{_udevdir}/zvol_id
307 %{_udevdir}/rules.d/*
308 %if 0%{?_systemd}
309 /usr/lib/modules-load.d/*
310 %{_unitdir}/*
311 %{_presetdir}/*
312 %else
313 %config(noreplace) %{_sysconfdir}/init.d/*
314 %config(noreplace) %{_initconfdir}/zfs
315 %endif
316 %config(noreplace) %{_sysconfdir}/%{name}
317 %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*
318
319 %files -n libzpool2
320 %{_libdir}/libzpool.so.*
321
322 %files -n libnvpair1
323 %{_libdir}/libnvpair.so.*
324
325 %files -n libuutil1
326 %{_libdir}/libuutil.so.*
327
328 %files -n libzfs2
329 %{_libdir}/libzfs*.so.*
330
331 %files -n libzfs2-devel
332 %{_datadir}/pkgconfig/libzfs.pc
333 %{_datadir}/pkgconfig/libzfs_core.pc
334 %{_libdir}/*.so
335 %{_includedir}/*
336 %doc AUTHORS COPYRIGHT DISCLAIMER
337 %doc OPENSOLARIS.LICENSE README.markdown
338
339 %files test
340 %{_datadir}/%{name}
341
342 %files dracut
343 %doc contrib/dracut/README.dracut.markdown
344 %{_dracutdir}/modules.d/*
345
346 %if 0%{?_initramfs}
347 %files initramfs
348 %doc contrib/initramfs/README.initramfs.markdown
349 /usr/share/initramfs-tools/*
350 %else
351 # Since we're not building the initramfs package,
352 # ignore those files.
353 %exclude /usr/share/initramfs-tools
354 %endif
355
356 %changelog
357 * Wed Jul 26 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.7.0-1
358 - Released 0.7.0-1, detailed release notes are available at:
359 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0