]> git.proxmox.com Git - mirror_zfs.git/blame - rpm/generic/zfs.spec.in
Initramfs scripts for ZoL.
[mirror_zfs.git] / rpm / generic / zfs.spec.in
CommitLineData
f3757573
BB
1%global _sbindir /sbin
2%global _libdir /%{_lib}
2ee4e7da
TF
3
4# Set the default udev directory based on distribution.
5d2107d8 5%if %{undefined _udevdir}
2ee4e7da 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
2ee4e7da
TF
10%endif
11%endif
12
13# Set the default udevrule directory based on distribution.
5d2107d8 14%if %{undefined _udevruledir}
2ee4e7da 15%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
5d2107d8 16%global _udevruledir %{_prefix}/lib/udev/rules.d
2ee4e7da 17%else
5d2107d8 18%global _udevruledir /lib/udev/rules.d
2ee4e7da
TF
19%endif
20%endif
21
22# Set the default dracut directory based on distribution.
5d2107d8 23%if %{undefined _dracutdir}
2ee4e7da
TF
24%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
25%global _dracutdir %{_prefix}/lib/dracut
26%else
4788a01d 27%global _dracutdir %{_prefix}/share/dracut
f3757573 28%endif
2ee4e7da 29%endif
f3757573
BB
30
31%bcond_with debug
32%bcond_with blkid
881f45c6 33%bcond_with systemd
f3757573 34
881f45c6
RE
35# Generic enable switch for systemd
36%if %{with systemd}
37%define _systemd 1
38%endif
39
8b974ba0
BA
40# RHEL >= 7 comes with systemd
41%if 0%{?rhel} >= 7
42%define _systemd 1
43%endif
44
881f45c6
RE
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
57Name: @PACKAGE@
58Version: @VERSION@
59Release: @RELEASE@%{?dist}
60Summary: Commands to control the kernel modules and libraries
61
62Group: System Environment/Kernel
63License: @ZFS_META_LICENSE@
64URL: http://zfsonlinux.org/
65Source0: %{name}-%{version}.tar.gz
66BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
67ExclusiveArch: i386 i686 x86_64
68
69# May build but untested on ppc/ppc64
70ExcludeArch: ppc ppc64
71
68a2e016 72Requires: spl = %{version}
c9b5cc8c
TF
73Requires: libzpool2 = %{version}
74Requires: libnvpair1 = %{version}
75Requires: libuutil1 = %{version}
76Requires: libzfs2 = %{version}
28967367 77Requires: %{name}-kmod = %{version}
f3757573
BB
78Provides: %{name}-kmod-common = %{version}
79
f12971e6
RE
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
f3757573
BB
84%if 0%{?rhel}%{?fedora}%{?suse_version}
85BuildRequires: zlib-devel
86BuildRequires: libuuid-devel
87%if %{with blkid}
88BuildRequires: libblkid-devel
89%endif
f3757573 90%endif
881f45c6
RE
91%if 0%{?_systemd}
92Requires(post): systemd
93Requires(preun): systemd
94Requires(postun): systemd
95BuildRequires: systemd
96%endif
f3757573
BB
97
98%description
c9b5cc8c 99This package contains the ZFS command line utilities.
f3757573 100
c9b5cc8c
TF
101%package -n libzpool2
102Summary: Native ZFS pool library for Linux
103Group: System Environment/Kernel
104
105%description -n libzpool2
106This package contains the zpool library, which provides support
107for managing zpools
108
c0ba93de 109%post -n libzpool2 -p /sbin/ldconfig
c9b5cc8c
TF
110%postun -n libzpool2 -p /sbin/ldconfig
111
112%package -n libnvpair1
113Summary: Solaris name-value library for Linux
114Group: System Environment/Kernel
115
116%description -n libnvpair1
117This package contains routines for packing and unpacking name-value
118pairs. This functionality is used to portably transport data across
119process boundaries, between kernel and user space, and can be used
120to write self describing data structures on disk.
121
c0ba93de 122%post -n libnvpair1 -p /sbin/ldconfig
c9b5cc8c
TF
123%postun -n libnvpair1 -p /sbin/ldconfig
124
125%package -n libuutil1
126Summary: Solaris userland utility library for Linux
127Group: System Environment/Kernel
128
129%description -n libuutil1
130This 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
c0ba93de 140%post -n libuutil1 -p /sbin/ldconfig
c9b5cc8c
TF
141%postun -n libuutil1 -p /sbin/ldconfig
142
143%package -n libzfs2
144Summary: Native ZFS filesystem library for Linux
145Group: System Environment/Kernel
146
147%description -n libzfs2
148This package provides support for managing ZFS filesystems
149
c0ba93de 150%post -n libzfs2 -p /sbin/ldconfig
c9b5cc8c
TF
151%postun -n libzfs2 -p /sbin/ldconfig
152
153%package -n libzfs2-devel
f3757573
BB
154Summary: Development headers
155Group: System Environment/Kernel
c9b5cc8c
TF
156Requires: libzfs2 = %{version}
157Requires: libzpool2 = %{version}
158Requires: libnvpair1 = %{version}
159Requires: libuutil1 = %{version}
160Provides: libzpool2-devel
161Provides: libnvpair1-devel
162Provides: libuutil1-devel
163Obsoletes: zfs-devel
f3757573 164
c9b5cc8c 165%description -n libzfs2-devel
f3757573
BB
166This package contains the header files needed for building additional
167applications against the ZFS libraries.
168
169%package test
170Summary: Test infrastructure
171Group: System Environment/Kernel
172Requires: %{name}%{?_isa} = %{version}-%{release}
173Requires: parted
174Requires: lsscsi
175Requires: mdadm
176Requires: bc
177
178%description test
179This package contains test infrastructure and support scripts for
180validating the file system.
181
182%package dracut
183Summary: Dracut module
184Group: System Environment/Kernel
185Requires: %{name}%{?_isa} = %{version}-%{release}
186Requires: dracut
187
188%description dracut
189This package contains a dracut module used to construct an initramfs
190image which is ZFS aware.
191
2cac7f5f
TF
192%if 0%{?_initramfs}
193%package initramfs
194Summary: Initramfs module
195Group: System Environment/Kernel
196Requires: %{name}%{?_isa} = %{version}-%{release}
197Requires: %{name} = %{version}-%{release}
198Requires: initramfs-tools
199
200%description initramfs
201This package contains a initramfs module used to construct an initramfs
202image which is ZFS aware.
203%endif
204
f3757573
BB
205%prep
206%if %{with debug}
207 %define debug --enable-debug
208%else
209 %define debug --disable-debug
210%endif
211%if %{with blkid}
212 %define blkid --with-blkid
213%else
214 %define blkid --without-blkid
215%endif
881f45c6
RE
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
f3757573
BB
221
222%setup -q
223
224%build
225%configure \
226 --with-config=user \
227 --with-udevdir=%{_udevdir} \
2ee4e7da 228 --with-udevruledir=%{_udevruledir} \
f3757573
BB
229 --with-dracutdir=%{_dracutdir} \
230 --disable-static \
231 %{debug} \
881f45c6
RE
232 %{blkid} \
233 %{systemd}
f3757573
BB
234make %{?_smp_mflags}
235
236%install
237%{__rm} -rf $RPM_BUILD_ROOT
238make install DESTDIR=%{?buildroot}
239find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
240
ba661a6e 241%post
881f45c6
RE
242%if 0%{?_systemd}
243%systemd_post zfs.target
244%else
2a34db1b
TF
245if [ -x /sbin/chkconfig ]; then
246 /sbin/chkconfig --add zfs-import
247 /sbin/chkconfig --add zfs-mount
248 /sbin/chkconfig --add zfs-share
249 /sbin/chkconfig --add zfs-zed
250fi
881f45c6 251%endif
168d056c 252exit 0
ba661a6e
BB
253
254%preun
881f45c6
RE
255%if 0%{?_systemd}
256%systemd_preun zfs.target
257%else
2a34db1b
TF
258if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
259 /sbin/chkconfig --del zfs-import
260 /sbin/chkconfig --del zfs-mount
261 /sbin/chkconfig --del zfs-share
262 /sbin/chkconfig --del zfs-zed
ba661a6e 263fi
881f45c6 264%endif
168d056c 265exit 0
f3757573 266
881f45c6 267%postun
881f45c6
RE
268%if 0%{?_systemd}
269%systemd_postun zfs.target
270%endif
f3757573
BB
271
272%files
f3757573 273%{_sbindir}/*
fb02fabf 274%{_bindir}/*
9e246ac3 275%{_libexecdir}/%{name}
f3757573
BB
276%{_mandir}/man1/*
277%{_mandir}/man5/*
278%{_mandir}/man8/*
279%{_udevdir}/vdev_id
280%{_udevdir}/zvol_id
281%{_udevdir}/rules.d/*
881f45c6
RE
282%if 0%{?_systemd}
283/usr/lib/modules-load.d/*
284%{_unitdir}/*
285%{_presetdir}/*
286%else
2a34db1b
TF
287%config(noreplace) %{_sysconfdir}/init.d/*
288%config(noreplace) %{_initconfdir}/zfs
881f45c6 289%endif
2a34db1b 290%config(noreplace) %{_sysconfdir}/%{name}
f3757573 291
c9b5cc8c
TF
292%files -n libzpool2
293%{_libdir}/libzpool.so.*
294
295%files -n libnvpair1
296%{_libdir}/libnvpair.so.*
297
298%files -n libuutil1
299%{_libdir}/libuutil.so.*
300
301%files -n libzfs2
302%{_libdir}/libzfs*.so.*
303
304%files -n libzfs2-devel
c3f8dc2a
TF
305%{_datadir}/pkgconfig/libzfs.pc
306%{_datadir}/pkgconfig/libzfs_core.pc
f3757573
BB
307%{_libdir}/*.so
308%{_includedir}/*
c9b5cc8c
TF
309%doc AUTHORS COPYRIGHT DISCLAIMER
310%doc OPENSOLARIS.LICENSE README.markdown
f3757573
BB
311
312%files test
313%{_datadir}/%{name}
314
315%files dracut
316%doc dracut/README.dracut.markdown
317%{_dracutdir}/modules.d/*
318
2cac7f5f
TF
319%if 0%{?_initramfs}
320%files initramfs
321%doc contrib/initramfs/README.initramfs.markdown
322/usr/share/initramfs-tools/*
323%else
324# Since we're not building the initramfs package,
325# ignore those files.
326%exclude /usr/share/initramfs-tools
327%endif
328
f3757573 329%changelog
d07a1636
BB
330* Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
331- Released 0.6.4-1
07dabd23
BB
332* Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
333- Released 0.6.3-1
0c28fb48
BB
334* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
335- Released 0.6.2-1
36c0b627
BB
336* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
337- First official stable release.