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