]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
OpenZFS - Performance regression suite for zfstest
[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 %endif
43
44 # RHEL >= 7 comes with systemd
45 %if 0%{?rhel} >= 7
46 %define _systemd 1
47 %endif
48
49 # Fedora >= 15 comes with systemd, but only >= 18 has
50 # the proper macros
51 %if 0%{?fedora} >= 18
52 %define _systemd 1
53 %endif
54
55 # opensuse >= 12.1 comes with systemd, but only >= 13.1
56 # has the proper macros
57 %if 0%{?suse_version} >= 1310
58 %define _systemd 1
59 %endif
60
61 Name: @PACKAGE@
62 Version: @VERSION@
63 Release: @RELEASE@%{?dist}
64 Summary: Commands to control the kernel modules and libraries
65
66 Group: System Environment/Kernel
67 License: @ZFS_META_LICENSE@
68 URL: http://zfsonlinux.org/
69 Source0: %{name}-%{version}.tar.gz
70 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
71 Requires: spl = %{version}
72 Requires: libzpool2 = %{version}
73 Requires: libnvpair1 = %{version}
74 Requires: libuutil1 = %{version}
75 Requires: libzfs2 = %{version}
76 Requires: %{name}-kmod = %{version}
77 Provides: %{name}-kmod-common = %{version}
78
79 # zfs-fuse provides the same commands and man pages that ZoL does. Renaming
80 # those on either side would conflict with all available documentation.
81 Conflicts: zfs-fuse
82
83 %if 0%{?rhel}%{?fedora}%{?suse_version}
84 BuildRequires: zlib-devel
85 BuildRequires: libuuid-devel
86 BuildRequires: libblkid-devel
87 BuildRequires: libudev-devel
88 BuildRequires: libattr-devel
89 %endif
90 %if 0%{?_systemd}
91 Requires(post): systemd
92 Requires(preun): systemd
93 Requires(postun): systemd
94 BuildRequires: systemd
95 %endif
96
97 %description
98 This package contains the ZFS command line utilities.
99
100 %package -n libzpool2
101 Summary: Native ZFS pool library for Linux
102 Group: System Environment/Kernel
103
104 %description -n libzpool2
105 This package contains the zpool library, which provides support
106 for managing zpools
107
108 %post -n libzpool2 -p /sbin/ldconfig
109 %postun -n libzpool2 -p /sbin/ldconfig
110
111 %package -n libnvpair1
112 Summary: Solaris name-value library for Linux
113 Group: System Environment/Kernel
114
115 %description -n libnvpair1
116 This package contains routines for packing and unpacking name-value
117 pairs. This functionality is used to portably transport data across
118 process boundaries, between kernel and user space, and can be used
119 to write self describing data structures on disk.
120
121 %post -n libnvpair1 -p /sbin/ldconfig
122 %postun -n libnvpair1 -p /sbin/ldconfig
123
124 %package -n libuutil1
125 Summary: Solaris userland utility library for Linux
126 Group: System Environment/Kernel
127
128 %description -n libuutil1
129 This library provides a variety of compatibility functions for ZFS on Linux:
130 * libspl: The Solaris Porting Layer userland library, which provides APIs
131 that make it possible to run Solaris user code in a Linux environment
132 with relatively minimal modification.
133 * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
134 library.
135 * libefi: The Extensible Firmware Interface library for GUID disk
136 partitioning.
137 * libshare: NFS, SMB, and iSCSI service integration for ZFS.
138
139 %post -n libuutil1 -p /sbin/ldconfig
140 %postun -n libuutil1 -p /sbin/ldconfig
141
142 %package -n libzfs2
143 Summary: Native ZFS filesystem library for Linux
144 Group: System Environment/Kernel
145
146 %description -n libzfs2
147 This package provides support for managing ZFS filesystems
148
149 %post -n libzfs2 -p /sbin/ldconfig
150 %postun -n libzfs2 -p /sbin/ldconfig
151
152 %package -n libzfs2-devel
153 Summary: Development headers
154 Group: System Environment/Kernel
155 Requires: libzfs2 = %{version}
156 Requires: libzpool2 = %{version}
157 Requires: libnvpair1 = %{version}
158 Requires: libuutil1 = %{version}
159 Provides: libzpool2-devel
160 Provides: libnvpair1-devel
161 Provides: libuutil1-devel
162 Obsoletes: zfs-devel
163
164 %description -n libzfs2-devel
165 This package contains the header files needed for building additional
166 applications against the ZFS libraries.
167
168 %package test
169 Summary: Test infrastructure
170 Group: System Environment/Kernel
171 Requires: %{name}%{?_isa} = %{version}-%{release}
172 Requires: parted
173 Requires: lsscsi
174 Requires: mdadm
175 Requires: bc
176 Requires: ksh
177 Requires: fio
178 Requires: acl
179 Requires: sysstat
180
181 %description test
182 This package contains test infrastructure and support scripts for
183 validating the file system.
184
185 %package dracut
186 Summary: Dracut module
187 Group: System Environment/Kernel
188 Requires: %{name}%{?_isa} = %{version}-%{release}
189 Requires: dracut
190
191 %description dracut
192 This package contains a dracut module used to construct an initramfs
193 image which is ZFS aware.
194
195 %if 0%{?_initramfs}
196 %package initramfs
197 Summary: Initramfs module
198 Group: System Environment/Kernel
199 Requires: %{name}%{?_isa} = %{version}-%{release}
200 Requires: %{name} = %{version}-%{release}
201 Requires: initramfs-tools
202
203 %description initramfs
204 This package contains a initramfs module used to construct an initramfs
205 image which is ZFS aware.
206 %endif
207
208 %prep
209 %if %{with debug}
210 %define debug --enable-debug
211 %else
212 %define debug --disable-debug
213 %endif
214 %if 0%{?_systemd}
215 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
216 %else
217 %define systemd --enable-sysvinit --disable-systemd
218 %endif
219
220 %setup -q
221
222 %build
223 %configure \
224 --with-config=user \
225 --with-udevdir=%{_udevdir} \
226 --with-udevruledir=%{_udevruledir} \
227 --with-dracutdir=%{_dracutdir} \
228 --disable-static \
229 %{debug} \
230 %{systemd}
231 make %{?_smp_mflags}
232
233 %install
234 %{__rm} -rf $RPM_BUILD_ROOT
235 make install DESTDIR=%{?buildroot}
236 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
237
238 %post
239 %if 0%{?_systemd}
240 %systemd_post zfs.target
241 %else
242 if [ -x /sbin/chkconfig ]; then
243 /sbin/chkconfig --add zfs-import
244 /sbin/chkconfig --add zfs-mount
245 /sbin/chkconfig --add zfs-share
246 /sbin/chkconfig --add zfs-zed
247 fi
248 %endif
249 exit 0
250
251 %preun
252 %if 0%{?_systemd}
253 %systemd_preun zfs.target
254 %else
255 if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
256 /sbin/chkconfig --del zfs-import
257 /sbin/chkconfig --del zfs-mount
258 /sbin/chkconfig --del zfs-share
259 /sbin/chkconfig --del zfs-zed
260 fi
261 %endif
262 exit 0
263
264 %postun
265 %if 0%{?_systemd}
266 %systemd_postun zfs.target
267 %endif
268
269 %files
270 %{_sbindir}/*
271 %{_bindir}/*
272 %{_libexecdir}/%{name}
273 %{_mandir}/man1/*
274 %{_mandir}/man5/*
275 %{_mandir}/man8/*
276 %{_udevdir}/vdev_id
277 %{_udevdir}/zvol_id
278 %{_udevdir}/rules.d/*
279 %if 0%{?_systemd}
280 /usr/lib/modules-load.d/*
281 %{_unitdir}/*
282 %{_presetdir}/*
283 %else
284 %config(noreplace) %{_sysconfdir}/init.d/*
285 %config(noreplace) %{_initconfdir}/zfs
286 %endif
287 %config(noreplace) %{_sysconfdir}/%{name}
288
289 %files -n libzpool2
290 %{_libdir}/libzpool.so.*
291
292 %files -n libnvpair1
293 %{_libdir}/libnvpair.so.*
294
295 %files -n libuutil1
296 %{_libdir}/libuutil.so.*
297
298 %files -n libzfs2
299 %{_libdir}/libzfs*.so.*
300
301 %files -n libzfs2-devel
302 %{_datadir}/pkgconfig/libzfs.pc
303 %{_datadir}/pkgconfig/libzfs_core.pc
304 %{_libdir}/*.so
305 %{_includedir}/*
306 %doc AUTHORS COPYRIGHT DISCLAIMER
307 %doc OPENSOLARIS.LICENSE README.markdown
308
309 %files test
310 %{_datadir}/%{name}
311
312 %files dracut
313 %doc contrib/dracut/README.dracut.markdown
314 %{_dracutdir}/modules.d/*
315
316 %if 0%{?_initramfs}
317 %files initramfs
318 %doc contrib/initramfs/README.initramfs.markdown
319 /usr/share/initramfs-tools/*
320 %else
321 # Since we're not building the initramfs package,
322 # ignore those files.
323 %exclude /usr/share/initramfs-tools
324 %endif
325
326 %changelog
327 * Fri Sep 11 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
328 - Released 0.6.5-1, detailed release notes are available at:
329 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
330 * Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
331 - Released 0.6.4-1
332 * Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
333 - Released 0.6.3-1
334 * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
335 - Released 0.6.2-1
336 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
337 - First official stable release.