]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
Add -c to zpool iostat & status to run command
[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 # Generic enable switch for systemd
40 %if %{with systemd}
41 %define _systemd 1
42 %define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target
43 %endif
44
45 # RHEL >= 7 comes with systemd
46 %if 0%{?rhel} >= 7
47 %define _systemd 1
48 %endif
49
50 # Fedora >= 15 comes with systemd, but only >= 18 has
51 # the proper macros
52 %if 0%{?fedora} >= 18
53 %define _systemd 1
54 %endif
55
56 # opensuse >= 12.1 comes with systemd, but only >= 13.1
57 # has the proper macros
58 %if 0%{?suse_version} >= 1310
59 %define _systemd 1
60 %endif
61
62 Name: @PACKAGE@
63 Version: @VERSION@
64 Release: @RELEASE@%{?dist}
65 Summary: Commands to control the kernel modules and libraries
66
67 Group: System Environment/Kernel
68 License: @ZFS_META_LICENSE@
69 URL: http://zfsonlinux.org/
70 Source0: %{name}-%{version}.tar.gz
71 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
72 Requires: spl = %{version}
73 Requires: libzpool2 = %{version}
74 Requires: libnvpair1 = %{version}
75 Requires: libuutil1 = %{version}
76 Requires: libzfs2 = %{version}
77 Requires: %{name}-kmod = %{version}
78 Provides: %{name}-kmod-common = %{version}
79
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
84 %if 0%{?rhel}%{?fedora}%{?suse_version}
85 BuildRequires: zlib-devel
86 BuildRequires: libuuid-devel
87 BuildRequires: libblkid-devel
88 BuildRequires: libudev-devel
89 BuildRequires: libattr-devel
90 %endif
91 %if 0%{?_systemd}
92 Requires(post): systemd
93 Requires(preun): systemd
94 Requires(postun): systemd
95 BuildRequires: systemd
96 %endif
97
98 %description
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.
121
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
154 Summary: Development headers
155 Group: System Environment/Kernel
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
164
165 %description -n libzfs2-devel
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 Requires: ksh
178 Requires: fio
179 Requires: acl
180 Requires: sysstat
181
182 %description test
183 This package contains test infrastructure and support scripts for
184 validating the file system.
185
186 %package dracut
187 Summary: Dracut module
188 Group: System Environment/Kernel
189 Requires: %{name}%{?_isa} = %{version}-%{release}
190 Requires: dracut
191
192 %description dracut
193 This package contains a dracut module used to construct an initramfs
194 image which is ZFS aware.
195
196 %if 0%{?_initramfs}
197 %package initramfs
198 Summary: Initramfs module
199 Group: System Environment/Kernel
200 Requires: %{name}%{?_isa} = %{version}-%{release}
201 Requires: %{name} = %{version}-%{release}
202 Requires: initramfs-tools
203
204 %description initramfs
205 This package contains a initramfs module used to construct an initramfs
206 image which is ZFS aware.
207 %endif
208
209 %prep
210 %if %{with debug}
211 %define debug --enable-debug
212 %else
213 %define debug --disable-debug
214 %endif
215 %if 0%{?_systemd}
216 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
217 %else
218 %define systemd --enable-sysvinit --disable-systemd
219 %endif
220
221 %setup -q
222
223 %build
224 %configure \
225 --with-config=user \
226 --with-udevdir=%{_udevdir} \
227 --with-udevruledir=%{_udevruledir} \
228 --with-dracutdir=%{_dracutdir} \
229 --disable-static \
230 %{debug} \
231 %{systemd}
232 make %{?_smp_mflags}
233
234 %install
235 %{__rm} -rf $RPM_BUILD_ROOT
236 make install DESTDIR=%{?buildroot}
237 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
238
239 %post
240 %if 0%{?_systemd}
241 %systemd_post %{systemd_svcs}
242 %else
243 if [ -x /sbin/chkconfig ]; then
244 /sbin/chkconfig --add zfs-import
245 /sbin/chkconfig --add zfs-mount
246 /sbin/chkconfig --add zfs-share
247 /sbin/chkconfig --add zfs-zed
248 fi
249 %endif
250 exit 0
251
252 %preun
253 %if 0%{?_systemd}
254 %systemd_preun %{systemd_svcs}
255 %else
256 if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
257 /sbin/chkconfig --del zfs-import
258 /sbin/chkconfig --del zfs-mount
259 /sbin/chkconfig --del zfs-share
260 /sbin/chkconfig --del zfs-zed
261 fi
262 %endif
263 exit 0
264
265 %postun
266 %if 0%{?_systemd}
267 %systemd_postun %{systemd_svcs}
268 %endif
269
270 %files
271 %{_sbindir}/*
272 %{_bindir}/*
273 %{_libexecdir}/%{name}
274 %{_mandir}/man1/*
275 %{_mandir}/man5/*
276 %{_mandir}/man8/*
277 %{_udevdir}/vdev_id
278 %{_udevdir}/zvol_id
279 %{_udevdir}/rules.d/*
280 %if 0%{?_systemd}
281 /usr/lib/modules-load.d/*
282 %{_unitdir}/*
283 %{_presetdir}/*
284 %else
285 %config(noreplace) %{_sysconfdir}/init.d/*
286 %config(noreplace) %{_initconfdir}/zfs
287 %endif
288 %config(noreplace) %{_sysconfdir}/%{name}
289
290 %files -n libzpool2
291 %{_libdir}/libzpool.so.*
292
293 %files -n libnvpair1
294 %{_libdir}/libnvpair.so.*
295
296 %files -n libuutil1
297 %{_libdir}/libuutil.so.*
298
299 %files -n libzfs2
300 %{_libdir}/libzfs*.so.*
301
302 %files -n libzfs2-devel
303 %{_datadir}/pkgconfig/libzfs.pc
304 %{_datadir}/pkgconfig/libzfs_core.pc
305 %{_libdir}/*.so
306 %{_includedir}/*
307 %doc AUTHORS COPYRIGHT DISCLAIMER
308 %doc OPENSOLARIS.LICENSE README.markdown
309
310 %files test
311 %{_datadir}/%{name}
312
313 %files dracut
314 %doc contrib/dracut/README.dracut.markdown
315 %{_dracutdir}/modules.d/*
316
317 %if 0%{?_initramfs}
318 %files initramfs
319 %doc contrib/initramfs/README.initramfs.markdown
320 /usr/share/initramfs-tools/*
321 %else
322 # Since we're not building the initramfs package,
323 # ignore those files.
324 %exclude /usr/share/initramfs-tools
325 %endif
326
327 %changelog
328 * Fri Sep 11 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
329 - Released 0.6.5-1, detailed release notes are available at:
330 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
331 * Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
332 - Released 0.6.4-1
333 * Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
334 - Released 0.6.3-1
335 * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
336 - Released 0.6.2-1
337 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
338 - First official stable release.