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