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