]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
Add libaio-devel BuildRequires
[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: zlib-devel
95 BuildRequires: libuuid-devel
96 BuildRequires: libblkid-devel
97 BuildRequires: libudev-devel
98 BuildRequires: libattr-devel
99 %if 0%{?fedora} >= 28
100 BuildRequires: libtirpc-devel
101 %endif
102 %endif
103
104 %if 0%{?_systemd}
105 Requires(post): systemd
106 Requires(preun): systemd
107 Requires(postun): systemd
108 %endif
109
110 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
111 Requires: util-linux
112 Requires: sysstat
113
114 %description
115 This package contains the ZFS command line utilities.
116
117 %package -n libzpool2
118 Summary: Native ZFS pool library for Linux
119 Group: System Environment/Kernel
120
121 %description -n libzpool2
122 This package contains the zpool library, which provides support
123 for managing zpools
124
125 %post -n libzpool2 -p /sbin/ldconfig
126 %postun -n libzpool2 -p /sbin/ldconfig
127
128 %package -n libnvpair1
129 Summary: Solaris name-value library for Linux
130 Group: System Environment/Kernel
131
132 %description -n libnvpair1
133 This package contains routines for packing and unpacking name-value
134 pairs. This functionality is used to portably transport data across
135 process boundaries, between kernel and user space, and can be used
136 to 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
142 Summary: Solaris userland utility library for Linux
143 Group: System Environment/Kernel
144
145 %description -n libuutil1
146 This 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
160 Summary: Native ZFS filesystem library for Linux
161 Group: System Environment/Kernel
162
163 %description -n libzfs2
164 This 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
170 Summary: Development headers
171 Group: System Environment/Kernel
172 Requires: libzfs2 = %{version}
173 Requires: libzpool2 = %{version}
174 Requires: libnvpair1 = %{version}
175 Requires: libuutil1 = %{version}
176 Provides: libzpool2-devel
177 Provides: libnvpair1-devel
178 Provides: libuutil1-devel
179 Obsoletes: zfs-devel
180
181 %description -n libzfs2-devel
182 This package contains the header files needed for building additional
183 applications against the ZFS libraries.
184
185 %package test
186 Summary: Test infrastructure
187 Group: System Environment/Kernel
188 Requires: %{name}%{?_isa} = %{version}-%{release}
189 Requires: parted
190 Requires: lsscsi
191 Requires: mdadm
192 Requires: bc
193 Requires: ksh
194 Requires: fio
195 Requires: acl
196 Requires: sudo
197 Requires: sysstat
198 Requires: rng-tools
199 Requires: libaio
200 BuildRequires: libaio-devel
201 AutoReqProv: no
202
203 %description test
204 This package contains test infrastructure and support scripts for
205 validating the file system.
206
207 %package dracut
208 Summary: Dracut module
209 Group: System Environment/Kernel
210 Requires: %{name}%{?_isa} = %{version}-%{release}
211 Requires: dracut
212 Requires: /usr/bin/awk
213 Requires: grep
214
215 %description dracut
216 This package contains a dracut module used to construct an initramfs
217 image which is ZFS aware.
218
219 %if 0%{?_initramfs}
220 %package initramfs
221 Summary: Initramfs module
222 Group: System Environment/Kernel
223 Requires: %{name}%{?_isa} = %{version}-%{release}
224 Requires: %{name} = %{version}-%{release}
225 Requires: initramfs-tools
226
227 %description initramfs
228 This package contains a initramfs module used to construct an initramfs
229 image which is ZFS aware.
230 %endif
231
232 %prep
233 %if %{with debug}
234 %define debug --enable-debug
235 %else
236 %define debug --disable-debug
237 %endif
238 %if 0%{?_systemd}
239 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
240 %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
241 %else
242 %define systemd --enable-sysvinit --disable-systemd
243 %endif
244
245 %setup -q
246
247 %build
248 %configure \
249 --with-config=user \
250 --with-udevdir=%{_udevdir} \
251 --with-udevruledir=%{_udevruledir} \
252 --with-dracutdir=%{_dracutdir} \
253 --disable-static \
254 %{debug} \
255 %{systemd}
256 make %{?_smp_mflags}
257
258 %install
259 %{__rm} -rf $RPM_BUILD_ROOT
260 make install DESTDIR=%{?buildroot}
261 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
262
263 %post
264 %if 0%{?_systemd}
265 %if 0%{?systemd_post:1}
266 %systemd_post %{systemd_svcs}
267 %else
268 if [ "$1" = "1" -o "$1" = "install" ] ; then
269 # Initial installation
270 systemctl preset %{systemd_svcs} >/dev/null || true
271 fi
272 %endif
273 %else
274 if [ -x /sbin/chkconfig ]; then
275 /sbin/chkconfig --add zfs-import
276 /sbin/chkconfig --add zfs-mount
277 /sbin/chkconfig --add zfs-share
278 /sbin/chkconfig --add zfs-zed
279 fi
280 %endif
281 exit 0
282
283 %preun
284 %if 0%{?_systemd}
285 %if 0%{?systemd_preun:1}
286 %systemd_preun %{systemd_svcs}
287 %else
288 if [ "$1" = "0" -o "$1" = "remove" ] ; then
289 # Package removal, not upgrade
290 systemctl --no-reload disable %{systemd_svcs} >/dev/null || true
291 systemctl stop %{systemd_svcs} >/dev/null || true
292 fi
293 %endif
294 %else
295 if [ "$1" = "0" -o "$1" = "remove" ] && [ -x /sbin/chkconfig ]; then
296 /sbin/chkconfig --del zfs-import
297 /sbin/chkconfig --del zfs-mount
298 /sbin/chkconfig --del zfs-share
299 /sbin/chkconfig --del zfs-zed
300 fi
301 %endif
302 exit 0
303
304 %postun
305 %if 0%{?_systemd}
306 %if 0%{?systemd_postun:1}
307 %systemd_postun %{systemd_svcs}
308 %else
309 systemctl --system daemon-reload >/dev/null || true
310 %endif
311 %endif
312
313 %files
314 %{_sbindir}/*
315 %{_bindir}/*
316 %{_libexecdir}/%{name}
317 %{_mandir}/man1/*
318 %{_mandir}/man5/*
319 %{_mandir}/man8/*
320 %{_udevdir}/vdev_id
321 %{_udevdir}/zvol_id
322 %{_udevdir}/rules.d/*
323 %if 0%{?_systemd}
324 /usr/lib/modules-load.d/*
325 %{_unitdir}/*
326 %{_presetdir}/*
327 %else
328 %config(noreplace) %{_sysconfdir}/init.d/*
329 %config(noreplace) %{_initconfdir}/zfs
330 %endif
331 %config(noreplace) %{_sysconfdir}/%{name}
332 %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*
333
334 %files -n libzpool2
335 %{_libdir}/libzpool.so.*
336
337 %files -n libnvpair1
338 %{_libdir}/libnvpair.so.*
339
340 %files -n libuutil1
341 %{_libdir}/libuutil.so.*
342
343 %files -n libzfs2
344 %{_libdir}/libzfs*.so.*
345
346 %files -n libzfs2-devel
347 %{_datadir}/pkgconfig/libzfs.pc
348 %{_datadir}/pkgconfig/libzfs_core.pc
349 %{_libdir}/*.so
350 %{_includedir}/*
351 %doc AUTHORS COPYRIGHT DISCLAIMER
352 %doc OPENSOLARIS.LICENSE README.markdown
353
354 %files test
355 %{_datadir}/%{name}
356
357 %files dracut
358 %doc contrib/dracut/README.dracut.markdown
359 %{_dracutdir}/modules.d/*
360
361 %if 0%{?_initramfs}
362 %files initramfs
363 %doc contrib/initramfs/README.initramfs.markdown
364 /usr/share/initramfs-tools/*
365 %else
366 # Since we're not building the initramfs package,
367 # ignore those files.
368 %exclude /usr/share/initramfs-tools
369 %endif
370
371 %changelog
372 * Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
373 - Released 0.7.9-1, detailed release notes are available at:
374 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
375 * Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
376 - Released 0.7.8-1, detailed release notes are available at:
377 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
378 * Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
379 - Released 0.7.7-1, detailed release notes are available at:
380 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
381 * Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
382 - Released 0.7.6-1, detailed release notes are available at:
383 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
384 * Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
385 - Released 0.7.5-1, detailed release notes are available at:
386 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
387 * Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
388 - Released 0.7.4-1, detailed release notes are available at:
389 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
390 * Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
391 - Released 0.7.3-1, detailed release notes are available at:
392 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
393 * Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
394 - Released 0.7.2-1, detailed release notes are available at:
395 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
396 * Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
397 - Released 0.7.1-1, detailed release notes are available at:
398 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.1
399 * Wed Jul 26 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.7.0-1
400 - Released 0.7.0-1, detailed release notes are available at:
401 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0