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