]>
Commit | Line | Data |
---|---|---|
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 | |
d296b094 TH |
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 | ||
881f45c6 RE |
49 | # Generic enable switch for systemd |
50 | %if %{with systemd} | |
51 | %define _systemd 1 | |
52 | %endif | |
53 | ||
8b974ba0 BA |
54 | # RHEL >= 7 comes with systemd |
55 | %if 0%{?rhel} >= 7 | |
56 | %define _systemd 1 | |
57 | %endif | |
58 | ||
881f45c6 RE |
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 | |
f3757573 BB |
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) | |
68a2e016 | 81 | Requires: spl = %{version} |
c9b5cc8c TF |
82 | Requires: libzpool2 = %{version} |
83 | Requires: libnvpair1 = %{version} | |
84 | Requires: libuutil1 = %{version} | |
85 | Requires: libzfs2 = %{version} | |
28967367 | 86 | Requires: %{name}-kmod = %{version} |
f3757573 BB |
87 | Provides: %{name}-kmod-common = %{version} |
88 | ||
f12971e6 RE |
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 | ||
f3757573 | 93 | %if 0%{?rhel}%{?fedora}%{?suse_version} |
f42f8702 | 94 | BuildRequires: gcc, make |
f3757573 BB |
95 | BuildRequires: zlib-devel |
96 | BuildRequires: libuuid-devel | |
f3757573 | 97 | BuildRequires: libblkid-devel |
de0ef912 BB |
98 | BuildRequires: libudev-devel |
99 | BuildRequires: libattr-devel | |
9267ef84 TH |
100 | %if 0%{?fedora} >= 28 |
101 | BuildRequires: libtirpc-devel | |
102 | %endif | |
f3757573 | 103 | %endif |
03658d50 | 104 | |
881f45c6 RE |
105 | %if 0%{?_systemd} |
106 | Requires(post): systemd | |
107 | Requires(preun): systemd | |
108 | Requires(postun): systemd | |
881f45c6 | 109 | %endif |
f3757573 | 110 | |
d6418de0 TH |
111 | # The zpool iostat/status -c scripts call some utilities like lsblk and iostat |
112 | Requires: util-linux | |
113 | Requires: sysstat | |
114 | ||
f3757573 | 115 | %description |
c9b5cc8c | 116 | This package contains the ZFS command line utilities. |
f3757573 | 117 | |
c9b5cc8c TF |
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 | ||
c0ba93de | 126 | %post -n libzpool2 -p /sbin/ldconfig |
c9b5cc8c TF |
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 | ||
c0ba93de | 139 | %post -n libnvpair1 -p /sbin/ldconfig |
c9b5cc8c TF |
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 | ||
c0ba93de | 157 | %post -n libuutil1 -p /sbin/ldconfig |
c9b5cc8c TF |
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 | ||
c0ba93de | 167 | %post -n libzfs2 -p /sbin/ldconfig |
c9b5cc8c TF |
168 | %postun -n libzfs2 -p /sbin/ldconfig |
169 | ||
170 | %package -n libzfs2-devel | |
f3757573 BB |
171 | Summary: Development headers |
172 | Group: System Environment/Kernel | |
c9b5cc8c TF |
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 | |
f3757573 | 181 | |
c9b5cc8c | 182 | %description -n libzfs2-devel |
f3757573 BB |
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 | |
6bb24f4d | 194 | Requires: ksh |
d4cf3127 BB |
195 | Requires: fio |
196 | Requires: acl | |
197 | Requires: sudo | |
198 | Requires: sysstat | |
199 | Requires: rng-tools | |
c1629734 | 200 | Requires: libaio |
4356dd23 | 201 | %if 0%{?rhel}%{?fedora}%{?suse_version} |
75318ec4 | 202 | BuildRequires: libaio-devel |
4356dd23 | 203 | %endif |
d4cf3127 | 204 | AutoReqProv: no |
f3757573 BB |
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 | |
c1629734 BB |
215 | Requires: /usr/bin/awk |
216 | Requires: grep | |
f3757573 BB |
217 | |
218 | %description dracut | |
219 | This package contains a dracut module used to construct an initramfs | |
220 | image which is ZFS aware. | |
221 | ||
2cac7f5f TF |
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 | ||
f3757573 BB |
235 | %prep |
236 | %if %{with debug} | |
237 | %define debug --enable-debug | |
238 | %else | |
239 | %define debug --disable-debug | |
240 | %endif | |
881f45c6 RE |
241 | %if 0%{?_systemd} |
242 | %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit | |
30a64eba | 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 |
881f45c6 RE |
244 | %else |
245 | %define systemd --enable-sysvinit --disable-systemd | |
246 | %endif | |
f3757573 BB |
247 | |
248 | %setup -q | |
249 | ||
250 | %build | |
251 | %configure \ | |
252 | --with-config=user \ | |
253 | --with-udevdir=%{_udevdir} \ | |
2ee4e7da | 254 | --with-udevruledir=%{_udevruledir} \ |
f3757573 BB |
255 | --with-dracutdir=%{_dracutdir} \ |
256 | --disable-static \ | |
257 | %{debug} \ | |
881f45c6 | 258 | %{systemd} |
f3757573 BB |
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 | ||
ba661a6e | 266 | %post |
881f45c6 | 267 | %if 0%{?_systemd} |
29b79dcf | 268 | %if 0%{?systemd_post:1} |
b3c159fe | 269 | %systemd_post %{systemd_svcs} |
881f45c6 | 270 | %else |
29b79dcf | 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 | |
2a34db1b TF |
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 | |
881f45c6 | 283 | %endif |
168d056c | 284 | exit 0 |
ba661a6e | 285 | |
e3fb781c BB |
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 | ||
ba661a6e | 295 | %preun |
881f45c6 | 296 | %if 0%{?_systemd} |
29b79dcf | 297 | %if 0%{?systemd_preun:1} |
b3c159fe | 298 | %systemd_preun %{systemd_svcs} |
881f45c6 | 299 | %else |
29b79dcf | 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 | |
2a34db1b TF |
308 | /sbin/chkconfig --del zfs-import |
309 | /sbin/chkconfig --del zfs-mount | |
310 | /sbin/chkconfig --del zfs-share | |
311 | /sbin/chkconfig --del zfs-zed | |
ba661a6e | 312 | fi |
881f45c6 | 313 | %endif |
168d056c | 314 | exit 0 |
f3757573 | 315 | |
881f45c6 | 316 | %postun |
881f45c6 | 317 | %if 0%{?_systemd} |
29b79dcf | 318 | %if 0%{?systemd_postun:1} |
b3c159fe | 319 | %systemd_postun %{systemd_svcs} |
29b79dcf | 320 | %else |
321 | systemctl --system daemon-reload >/dev/null || true | |
322 | %endif | |
881f45c6 | 323 | %endif |
f3757573 BB |
324 | |
325 | %files | |
f3757573 | 326 | %{_sbindir}/* |
fb02fabf | 327 | %{_bindir}/* |
9e246ac3 | 328 | %{_libexecdir}/%{name} |
f3757573 BB |
329 | %{_mandir}/man1/* |
330 | %{_mandir}/man5/* | |
331 | %{_mandir}/man8/* | |
332 | %{_udevdir}/vdev_id | |
333 | %{_udevdir}/zvol_id | |
334 | %{_udevdir}/rules.d/* | |
881f45c6 RE |
335 | %if 0%{?_systemd} |
336 | /usr/lib/modules-load.d/* | |
337 | %{_unitdir}/* | |
338 | %{_presetdir}/* | |
339 | %else | |
2a34db1b TF |
340 | %config(noreplace) %{_sysconfdir}/init.d/* |
341 | %config(noreplace) %{_initconfdir}/zfs | |
881f45c6 | 342 | %endif |
2a34db1b | 343 | %config(noreplace) %{_sysconfdir}/%{name} |
099700d9 | 344 | %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/* |
f3757573 | 345 | |
c9b5cc8c TF |
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 | |
c3f8dc2a TF |
359 | %{_datadir}/pkgconfig/libzfs.pc |
360 | %{_datadir}/pkgconfig/libzfs_core.pc | |
f3757573 BB |
361 | %{_libdir}/*.so |
362 | %{_includedir}/* | |
c9b5cc8c TF |
363 | %doc AUTHORS COPYRIGHT DISCLAIMER |
364 | %doc OPENSOLARIS.LICENSE README.markdown | |
f3757573 BB |
365 | |
366 | %files test | |
367 | %{_datadir}/%{name} | |
368 | ||
369 | %files dracut | |
cc492505 | 370 | %doc contrib/dracut/README.dracut.markdown |
f3757573 BB |
371 | %{_dracutdir}/modules.d/* |
372 | ||
2cac7f5f TF |
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 | ||
f3757573 | 383 | %changelog |
a8c2b7eb TH |
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 | |
16d29818 TH |
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 | |
1b0cd071 TH |
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 | |
d126980e TH |
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 | |
d1ed1be3 TH |
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 | |
bd69ae3b TH |
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 | |
240ccfc1 TH |
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 | |
e3b28e16 TH |
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 | |
a803eacf TH |
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 | |
3c7fa6ca TH |
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 | |
99598264 TH |
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 | |
edd7c246 TH |
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 | |
751575fe TH |
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 | |
ccad6431 BB |
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 |