]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
Add BuildRequires gcc, make, elfutils-libelf-devel
[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 %preun
287 %if 0%{?_systemd}
288 %if 0%{?systemd_preun:1}
289 %systemd_preun %{systemd_svcs}
290 %else
291 if [ "$1" = "0" -o "$1" = "remove" ] ; then
292 # Package removal, not upgrade
293 systemctl --no-reload disable %{systemd_svcs} >/dev/null || true
294 systemctl stop %{systemd_svcs} >/dev/null || true
295 fi
296 %endif
297 %else
298 if [ "$1" = "0" -o "$1" = "remove" ] && [ -x /sbin/chkconfig ]; then
299 /sbin/chkconfig --del zfs-import
300 /sbin/chkconfig --del zfs-mount
301 /sbin/chkconfig --del zfs-share
302 /sbin/chkconfig --del zfs-zed
303 fi
304 %endif
305 exit 0
306
307 %postun
308 %if 0%{?_systemd}
309 %if 0%{?systemd_postun:1}
310 %systemd_postun %{systemd_svcs}
311 %else
312 systemctl --system daemon-reload >/dev/null || true
313 %endif
314 %endif
315
316 %files
317 %{_sbindir}/*
318 %{_bindir}/*
319 %{_libexecdir}/%{name}
320 %{_mandir}/man1/*
321 %{_mandir}/man5/*
322 %{_mandir}/man8/*
323 %{_udevdir}/vdev_id
324 %{_udevdir}/zvol_id
325 %{_udevdir}/rules.d/*
326 %if 0%{?_systemd}
327 /usr/lib/modules-load.d/*
328 %{_unitdir}/*
329 %{_presetdir}/*
330 %else
331 %config(noreplace) %{_sysconfdir}/init.d/*
332 %config(noreplace) %{_initconfdir}/zfs
333 %endif
334 %config(noreplace) %{_sysconfdir}/%{name}
335 %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*
336
337 %files -n libzpool2
338 %{_libdir}/libzpool.so.*
339
340 %files -n libnvpair1
341 %{_libdir}/libnvpair.so.*
342
343 %files -n libuutil1
344 %{_libdir}/libuutil.so.*
345
346 %files -n libzfs2
347 %{_libdir}/libzfs*.so.*
348
349 %files -n libzfs2-devel
350 %{_datadir}/pkgconfig/libzfs.pc
351 %{_datadir}/pkgconfig/libzfs_core.pc
352 %{_libdir}/*.so
353 %{_includedir}/*
354 %doc AUTHORS COPYRIGHT DISCLAIMER
355 %doc OPENSOLARIS.LICENSE README.markdown
356
357 %files test
358 %{_datadir}/%{name}
359
360 %files dracut
361 %doc contrib/dracut/README.dracut.markdown
362 %{_dracutdir}/modules.d/*
363
364 %if 0%{?_initramfs}
365 %files initramfs
366 %doc contrib/initramfs/README.initramfs.markdown
367 /usr/share/initramfs-tools/*
368 %else
369 # Since we're not building the initramfs package,
370 # ignore those files.
371 %exclude /usr/share/initramfs-tools
372 %endif
373
374 %changelog
375 * Thu Sep 13 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.11-1
376 - Released 0.7.11-1, detailed release notes are available at:
377 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.11
378 * Wed Sep 05 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.10-1
379 - Released 0.7.10-1, detailed release notes are available at:
380 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.10
381 * Tue May 08 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.9-1
382 - Released 0.7.9-1, detailed release notes are available at:
383 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.9
384 * Mon Apr 09 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.8-1
385 - Released 0.7.8-1, detailed release notes are available at:
386 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.8
387 * Wed Mar 14 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.7-1
388 - Released 0.7.7-1, detailed release notes are available at:
389 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.7
390 * Thu Feb 01 2018 Tony Hutter <hutter2@llnl.gov> - 0.7.6-1
391 - Released 0.7.6-1, detailed release notes are available at:
392 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.6
393 * Mon Dec 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.5-1
394 - Released 0.7.5-1, detailed release notes are available at:
395 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.5
396 * Thu Dec 07 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.4-1
397 - Released 0.7.4-1, detailed release notes are available at:
398 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.4
399 * Wed Oct 18 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.3-1
400 - Released 0.7.3-1, detailed release notes are available at:
401 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.3
402 * Fri Sep 22 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.2-1
403 - Released 0.7.2-1, detailed release notes are available at:
404 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.2
405 * Tue Aug 8 2017 Tony Hutter <hutter2@llnl.gov> - 0.7.1-1
406 - Released 0.7.1-1, detailed release notes are available at:
407 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.1
408 * Wed Jul 26 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.7.0-1
409 - Released 0.7.0-1, detailed release notes are available at:
410 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0