]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
7e851cf30a9a63d674b066fc427080afeaee5e8d
[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
178 %description test
179 This package contains test infrastructure and support scripts for
180 validating the file system.
181
182 %package dracut
183 Summary: Dracut module
184 Group: System Environment/Kernel
185 Requires: %{name}%{?_isa} = %{version}-%{release}
186 Requires: dracut
187
188 %description dracut
189 This package contains a dracut module used to construct an initramfs
190 image which is ZFS aware.
191
192 %if 0%{?_initramfs}
193 %package initramfs
194 Summary: Initramfs module
195 Group: System Environment/Kernel
196 Requires: %{name}%{?_isa} = %{version}-%{release}
197 Requires: %{name} = %{version}-%{release}
198 Requires: initramfs-tools
199
200 %description initramfs
201 This package contains a initramfs module used to construct an initramfs
202 image which is ZFS aware.
203 %endif
204
205 %prep
206 %if %{with debug}
207 %define debug --enable-debug
208 %else
209 %define debug --disable-debug
210 %endif
211 %if 0%{?_systemd}
212 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
213 %else
214 %define systemd --enable-sysvinit --disable-systemd
215 %endif
216
217 %setup -q
218
219 %build
220 %configure \
221 --with-config=user \
222 --with-udevdir=%{_udevdir} \
223 --with-udevruledir=%{_udevruledir} \
224 --with-dracutdir=%{_dracutdir} \
225 --disable-static \
226 %{debug} \
227 %{systemd}
228 make %{?_smp_mflags}
229
230 %install
231 %{__rm} -rf $RPM_BUILD_ROOT
232 make install DESTDIR=%{?buildroot}
233 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
234
235 %post
236 %if 0%{?_systemd}
237 %systemd_post zfs.target
238 %else
239 if [ -x /sbin/chkconfig ]; then
240 /sbin/chkconfig --add zfs-import
241 /sbin/chkconfig --add zfs-mount
242 /sbin/chkconfig --add zfs-share
243 /sbin/chkconfig --add zfs-zed
244 fi
245 %endif
246 exit 0
247
248 %preun
249 %if 0%{?_systemd}
250 %systemd_preun zfs.target
251 %else
252 if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
253 /sbin/chkconfig --del zfs-import
254 /sbin/chkconfig --del zfs-mount
255 /sbin/chkconfig --del zfs-share
256 /sbin/chkconfig --del zfs-zed
257 fi
258 %endif
259 exit 0
260
261 %postun
262 %if 0%{?_systemd}
263 %systemd_postun zfs.target
264 %endif
265
266 %files
267 %{_sbindir}/*
268 %{_bindir}/*
269 %{_libexecdir}/%{name}
270 %{_mandir}/man1/*
271 %{_mandir}/man5/*
272 %{_mandir}/man8/*
273 %{_udevdir}/vdev_id
274 %{_udevdir}/zvol_id
275 %{_udevdir}/rules.d/*
276 %if 0%{?_systemd}
277 /usr/lib/modules-load.d/*
278 %{_unitdir}/*
279 %{_presetdir}/*
280 %else
281 %config(noreplace) %{_sysconfdir}/init.d/*
282 %config(noreplace) %{_initconfdir}/zfs
283 %endif
284 %config(noreplace) %{_sysconfdir}/%{name}
285
286 %files -n libzpool2
287 %{_libdir}/libzpool.so.*
288
289 %files -n libnvpair1
290 %{_libdir}/libnvpair.so.*
291
292 %files -n libuutil1
293 %{_libdir}/libuutil.so.*
294
295 %files -n libzfs2
296 %{_libdir}/libzfs*.so.*
297
298 %files -n libzfs2-devel
299 %{_datadir}/pkgconfig/libzfs.pc
300 %{_datadir}/pkgconfig/libzfs_core.pc
301 %{_libdir}/*.so
302 %{_includedir}/*
303 %doc AUTHORS COPYRIGHT DISCLAIMER
304 %doc OPENSOLARIS.LICENSE README.markdown
305
306 %files test
307 %{_datadir}/%{name}
308
309 %files dracut
310 %doc contrib/dracut/README.dracut.markdown
311 %{_dracutdir}/modules.d/*
312
313 %if 0%{?_initramfs}
314 %files initramfs
315 %doc contrib/initramfs/README.initramfs.markdown
316 /usr/share/initramfs-tools/*
317 %else
318 # Since we're not building the initramfs package,
319 # ignore those files.
320 %exclude /usr/share/initramfs-tools
321 %endif
322
323 %changelog
324 * Fri Sep 11 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
325 - Released 0.6.5-1, detailed release notes are available at:
326 - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
327 * Wed Apr 8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
328 - Released 0.6.4-1
329 * Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
330 - Released 0.6.3-1
331 * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
332 - Released 0.6.2-1
333 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
334 - First official stable release.