]>
Commit | Line | Data |
---|---|---|
f3757573 BB |
1 | %global _sbindir /sbin |
2 | %global _libdir /%{_lib} | |
ea04106b AX |
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 | |
f3757573 | 7 | %global _udevdir %{_prefix}/lib/udev |
f3757573 BB |
8 | %else |
9 | %global _udevdir /lib/udev | |
ea04106b AX |
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 | |
a08ee875 | 27 | %global _dracutdir %{_prefix}/share/dracut |
f3757573 | 28 | %endif |
ea04106b | 29 | %endif |
f3757573 BB |
30 | |
31 | %bcond_with debug | |
32 | %bcond_with blkid | |
ea04106b AX |
33 | %bcond_with systemd |
34 | ||
35 | # Generic enable switch for systemd | |
36 | %if %{with systemd} | |
37 | %define _systemd 1 | |
38 | %endif | |
f3757573 | 39 | |
ea04106b AX |
40 | # RHEL >= 7 comes with systemd |
41 | %if 0%{?rhel} >= 7 | |
42 | %define _systemd 1 | |
43 | %endif | |
44 | ||
45 | # Fedora >= 15 comes with systemd, but only >= 18 has | |
46 | # the proper macros | |
47 | %if 0%{?fedora} >= 18 | |
48 | %define _systemd 1 | |
49 | %endif | |
50 | ||
51 | # opensuse >= 12.1 comes with systemd, but only >= 13.1 | |
52 | # has the proper macros | |
53 | %if 0%{?suse_version} >= 1310 | |
54 | %define _systemd 1 | |
55 | %endif | |
f3757573 BB |
56 | |
57 | Name: @PACKAGE@ | |
58 | Version: @VERSION@ | |
59 | Release: @RELEASE@%{?dist} | |
60 | Summary: Commands to control the kernel modules and libraries | |
61 | ||
62 | Group: System Environment/Kernel | |
63 | License: @ZFS_META_LICENSE@ | |
64 | URL: http://zfsonlinux.org/ | |
65 | Source0: %{name}-%{version}.tar.gz | |
66 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |
67 | ExclusiveArch: i386 i686 x86_64 | |
68 | ||
69 | # May build but untested on ppc/ppc64 | |
70 | ExcludeArch: ppc ppc64 | |
71 | ||
68a2e016 | 72 | Requires: spl = %{version} |
ea04106b AX |
73 | Requires: libzpool2 = %{version} |
74 | Requires: libnvpair1 = %{version} | |
75 | Requires: libuutil1 = %{version} | |
76 | Requires: libzfs2 = %{version} | |
a08ee875 | 77 | Requires: %{name}-kmod = %{version} |
f3757573 BB |
78 | Provides: %{name}-kmod-common = %{version} |
79 | ||
ea04106b AX |
80 | # zfs-fuse provides the same commands and man pages that ZoL does. Renaming |
81 | # those on either side would conflict with all available documentation. | |
82 | Conflicts: zfs-fuse | |
83 | ||
f3757573 BB |
84 | %if 0%{?rhel}%{?fedora}%{?suse_version} |
85 | BuildRequires: zlib-devel | |
86 | BuildRequires: libuuid-devel | |
87 | %if %{with blkid} | |
88 | BuildRequires: libblkid-devel | |
89 | %endif | |
f3757573 | 90 | %endif |
ea04106b AX |
91 | %if 0%{?_systemd} |
92 | Requires(post): systemd | |
93 | Requires(preun): systemd | |
94 | Requires(postun): systemd | |
95 | BuildRequires: systemd | |
96 | %endif | |
f3757573 BB |
97 | |
98 | %description | |
ea04106b AX |
99 | This package contains the ZFS command line utilities. |
100 | ||
101 | %package -n libzpool2 | |
102 | Summary: Native ZFS pool library for Linux | |
103 | Group: System Environment/Kernel | |
104 | ||
105 | %description -n libzpool2 | |
106 | This package contains the zpool library, which provides support | |
107 | for managing zpools | |
108 | ||
109 | %post -n libzpool2 -p /sbin/ldconfig | |
110 | %postun -n libzpool2 -p /sbin/ldconfig | |
111 | ||
112 | %package -n libnvpair1 | |
113 | Summary: Solaris name-value library for Linux | |
114 | Group: System Environment/Kernel | |
115 | ||
116 | %description -n libnvpair1 | |
117 | This package contains routines for packing and unpacking name-value | |
118 | pairs. This functionality is used to portably transport data across | |
119 | process boundaries, between kernel and user space, and can be used | |
120 | to write self describing data structures on disk. | |
f3757573 | 121 | |
ea04106b AX |
122 | %post -n libnvpair1 -p /sbin/ldconfig |
123 | %postun -n libnvpair1 -p /sbin/ldconfig | |
124 | ||
125 | %package -n libuutil1 | |
126 | Summary: Solaris userland utility library for Linux | |
127 | Group: System Environment/Kernel | |
128 | ||
129 | %description -n libuutil1 | |
130 | This library provides a variety of compatibility functions for ZFS on Linux: | |
131 | * libspl: The Solaris Porting Layer userland library, which provides APIs | |
132 | that make it possible to run Solaris user code in a Linux environment | |
133 | with relatively minimal modification. | |
134 | * libavl: The Adelson-Velskii Landis balanced binary tree manipulation | |
135 | library. | |
136 | * libefi: The Extensible Firmware Interface library for GUID disk | |
137 | partitioning. | |
138 | * libshare: NFS, SMB, and iSCSI service integration for ZFS. | |
139 | ||
140 | %post -n libuutil1 -p /sbin/ldconfig | |
141 | %postun -n libuutil1 -p /sbin/ldconfig | |
142 | ||
143 | %package -n libzfs2 | |
144 | Summary: Native ZFS filesystem library for Linux | |
145 | Group: System Environment/Kernel | |
146 | ||
147 | %description -n libzfs2 | |
148 | This package provides support for managing ZFS filesystems | |
149 | ||
150 | %post -n libzfs2 -p /sbin/ldconfig | |
151 | %postun -n libzfs2 -p /sbin/ldconfig | |
152 | ||
153 | %package -n libzfs2-devel | |
f3757573 BB |
154 | Summary: Development headers |
155 | Group: System Environment/Kernel | |
ea04106b AX |
156 | Requires: libzfs2 = %{version} |
157 | Requires: libzpool2 = %{version} | |
158 | Requires: libnvpair1 = %{version} | |
159 | Requires: libuutil1 = %{version} | |
160 | Provides: libzpool2-devel | |
161 | Provides: libnvpair1-devel | |
162 | Provides: libuutil1-devel | |
163 | Obsoletes: zfs-devel | |
f3757573 | 164 | |
ea04106b | 165 | %description -n libzfs2-devel |
f3757573 BB |
166 | This package contains the header files needed for building additional |
167 | applications against the ZFS libraries. | |
168 | ||
169 | %package test | |
170 | Summary: Test infrastructure | |
171 | Group: System Environment/Kernel | |
172 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
173 | Requires: parted | |
174 | Requires: lsscsi | |
175 | Requires: mdadm | |
176 | Requires: bc | |
177 | ||
178 | %description test | |
179 | This package contains test infrastructure and support scripts for | |
180 | validating the file system. | |
181 | ||
182 | %package dracut | |
183 | Summary: Dracut module | |
184 | Group: System Environment/Kernel | |
185 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
186 | Requires: dracut | |
187 | ||
188 | %description dracut | |
189 | This package contains a dracut module used to construct an initramfs | |
190 | image which is ZFS aware. | |
191 | ||
192 | %prep | |
193 | %if %{with debug} | |
194 | %define debug --enable-debug | |
195 | %else | |
196 | %define debug --disable-debug | |
197 | %endif | |
198 | %if %{with blkid} | |
199 | %define blkid --with-blkid | |
200 | %else | |
201 | %define blkid --without-blkid | |
202 | %endif | |
ea04106b AX |
203 | %if 0%{?_systemd} |
204 | %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit | |
205 | %else | |
206 | %define systemd --enable-sysvinit --disable-systemd | |
207 | %endif | |
f3757573 BB |
208 | |
209 | %setup -q | |
210 | ||
211 | %build | |
212 | %configure \ | |
213 | --with-config=user \ | |
214 | --with-udevdir=%{_udevdir} \ | |
ea04106b | 215 | --with-udevruledir=%{_udevruledir} \ |
f3757573 BB |
216 | --with-dracutdir=%{_dracutdir} \ |
217 | --disable-static \ | |
218 | %{debug} \ | |
ea04106b AX |
219 | %{blkid} \ |
220 | %{systemd} | |
f3757573 BB |
221 | make %{?_smp_mflags} |
222 | ||
223 | %install | |
224 | %{__rm} -rf $RPM_BUILD_ROOT | |
225 | make install DESTDIR=%{?buildroot} | |
226 | find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \; | |
227 | ||
c06d4368 | 228 | %post |
ea04106b AX |
229 | %if 0%{?_systemd} |
230 | %systemd_post zfs.target | |
231 | %else | |
c06d4368 | 232 | [ -x /sbin/chkconfig ] && /sbin/chkconfig --add zfs |
ea04106b | 233 | %endif |
c06d4368 AX |
234 | exit 0 |
235 | ||
236 | %preun | |
ea04106b AX |
237 | %if 0%{?_systemd} |
238 | %systemd_preun zfs.target | |
239 | %else | |
c06d4368 AX |
240 | if [ $1 -eq 0 ] ; then |
241 | [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs | |
242 | fi | |
ea04106b | 243 | %endif |
c06d4368 | 244 | exit 0 |
f3757573 | 245 | |
ea04106b AX |
246 | %postun |
247 | %if 0%{?_systemd} | |
248 | %systemd_postun zfs.target | |
249 | %endif | |
f3757573 BB |
250 | |
251 | %files | |
f3757573 | 252 | %{_sbindir}/* |
c06d4368 | 253 | %{_bindir}/* |
ea04106b | 254 | %{_libexecdir}/%{name} |
f3757573 BB |
255 | %{_mandir}/man1/* |
256 | %{_mandir}/man5/* | |
257 | %{_mandir}/man8/* | |
258 | %{_udevdir}/vdev_id | |
259 | %{_udevdir}/zvol_id | |
260 | %{_udevdir}/rules.d/* | |
261 | %config(noreplace) %{_sysconfdir}/%{name} | |
ea04106b AX |
262 | %if 0%{?_systemd} |
263 | /usr/lib/modules-load.d/* | |
264 | %{_unitdir}/* | |
265 | %{_presetdir}/* | |
266 | %else | |
b7f59425 | 267 | %{_sysconfdir}/init.d/* |
ea04106b | 268 | %endif |
f3757573 | 269 | |
ea04106b AX |
270 | %files -n libzpool2 |
271 | %{_libdir}/libzpool.so.* | |
272 | ||
273 | %files -n libnvpair1 | |
274 | %{_libdir}/libnvpair.so.* | |
275 | ||
276 | %files -n libuutil1 | |
277 | %{_libdir}/libuutil.so.* | |
278 | ||
279 | %files -n libzfs2 | |
280 | %{_libdir}/libzfs*.so.* | |
281 | ||
282 | %files -n libzfs2-devel | |
283 | %{_datadir}/pkgconfig/libzfs.pc | |
284 | %{_datadir}/pkgconfig/libzfs_core.pc | |
f3757573 BB |
285 | %{_libdir}/*.so |
286 | %{_includedir}/* | |
ea04106b AX |
287 | %doc AUTHORS COPYRIGHT DISCLAIMER |
288 | %doc OPENSOLARIS.LICENSE README.markdown | |
f3757573 BB |
289 | |
290 | %files test | |
291 | %{_datadir}/%{name} | |
292 | ||
293 | %files dracut | |
294 | %doc dracut/README.dracut.markdown | |
295 | %{_dracutdir}/modules.d/* | |
296 | ||
297 | %changelog | |
ea04106b AX |
298 | * Wed Jun 24 2015 Ned Bass <bass6@llnl.gov> - 0.6.4.2-1 |
299 | - Fix panic due to corrupt nvlist when running utilities zfsonlinux/zfs#3335 | |
300 | - Fix hard lockup due to infinite loop in zfs_zget() zfsonlinux/zfs#3349 | |
301 | - Fix panic on unmount due to iput taskq zfsonlinux/zfs#3281 | |
302 | - Improve metadata shrinker performance on pre-3.1 kernels zfsonlinux/zfs#3501 | |
303 | - Linux 4.1 compat: use read_iter() / write_iter() | |
304 | - Linux 3.12 compat: NUMA-aware per-superblock shrinker | |
305 | - Fix spurious hung task watchdog stack traces zfsonlinux/zfs#3402 | |
306 | - Fix module loading in zfs import systemd service zfsonlinux/zfs#3440 | |
307 | - Fix intermittent libzfs_init() failure to open /dev/zfs zfsonlinux/zfs#2556 | |
308 | * Thu Apr 23 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4.1-1 | |
309 | - Fix direct memory reclaim deadlocks zfsonlinux/zfs#3331 zfsonlinux/zfs#3225 | |
310 | - Fix hot-disk sparing for disk vdevs zfsonlinux/zfs#3310 | |
311 | - Fix system spinning during ARC reclaim zfsonlinux/zfs#3283 | |
312 | * Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1 | |
313 | - Released 0.6.4-1 | |
314 | * Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1 | |
315 | - Released 0.6.3-1 | |
c06d4368 AX |
316 | * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1 |
317 | - Released 0.6.2-1 | |
36c0b627 BB |
318 | * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1 |
319 | - First official stable release. |