]>
Commit | Line | Data |
---|---|---|
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 | 30 | |
3b79cef2 BB |
31 | # Set the default _initconfdir when undefined. |
32 | %if %{undefined _initconfdir} | |
33 | %global _initconfdir /etc/sysconfig | |
34 | %endif | |
35 | ||
f3757573 | 36 | %bcond_with debug |
881f45c6 | 37 | %bcond_with systemd |
f3757573 | 38 | |
881f45c6 RE |
39 | # Generic enable switch for systemd |
40 | %if %{with systemd} | |
41 | %define _systemd 1 | |
b3c159fe | 42 | %define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target |
881f45c6 RE |
43 | %endif |
44 | ||
8b974ba0 BA |
45 | # RHEL >= 7 comes with systemd |
46 | %if 0%{?rhel} >= 7 | |
47 | %define _systemd 1 | |
48 | %endif | |
49 | ||
881f45c6 RE |
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 | |
f3757573 BB |
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) | |
68a2e016 | 72 | Requires: spl = %{version} |
c9b5cc8c TF |
73 | Requires: libzpool2 = %{version} |
74 | Requires: libnvpair1 = %{version} | |
75 | Requires: libuutil1 = %{version} | |
76 | Requires: libzfs2 = %{version} | |
28967367 | 77 | Requires: %{name}-kmod = %{version} |
f3757573 BB |
78 | Provides: %{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. | |
82 | Conflicts: zfs-fuse | |
83 | ||
f3757573 BB |
84 | %if 0%{?rhel}%{?fedora}%{?suse_version} |
85 | BuildRequires: zlib-devel | |
86 | BuildRequires: libuuid-devel | |
f3757573 | 87 | BuildRequires: libblkid-devel |
de0ef912 BB |
88 | BuildRequires: libudev-devel |
89 | BuildRequires: libattr-devel | |
4807c0ba TC |
90 | BuildRequires: openssl-devel |
91 | Requires: openssl | |
f3757573 | 92 | %endif |
881f45c6 RE |
93 | %if 0%{?_systemd} |
94 | Requires(post): systemd | |
95 | Requires(preun): systemd | |
96 | Requires(postun): systemd | |
97 | BuildRequires: systemd | |
98 | %endif | |
f3757573 | 99 | |
d6418de0 TH |
100 | # The zpool iostat/status -c scripts call some utilities like lsblk and iostat |
101 | Requires: util-linux | |
102 | Requires: sysstat | |
103 | ||
f3757573 | 104 | %description |
c9b5cc8c | 105 | This package contains the ZFS command line utilities. |
f3757573 | 106 | |
c9b5cc8c TF |
107 | %package -n libzpool2 |
108 | Summary: Native ZFS pool library for Linux | |
109 | Group: System Environment/Kernel | |
110 | ||
111 | %description -n libzpool2 | |
112 | This package contains the zpool library, which provides support | |
113 | for managing zpools | |
114 | ||
c0ba93de | 115 | %post -n libzpool2 -p /sbin/ldconfig |
c9b5cc8c TF |
116 | %postun -n libzpool2 -p /sbin/ldconfig |
117 | ||
118 | %package -n libnvpair1 | |
119 | Summary: Solaris name-value library for Linux | |
120 | Group: System Environment/Kernel | |
121 | ||
122 | %description -n libnvpair1 | |
123 | This package contains routines for packing and unpacking name-value | |
124 | pairs. This functionality is used to portably transport data across | |
125 | process boundaries, between kernel and user space, and can be used | |
126 | to write self describing data structures on disk. | |
127 | ||
c0ba93de | 128 | %post -n libnvpair1 -p /sbin/ldconfig |
c9b5cc8c TF |
129 | %postun -n libnvpair1 -p /sbin/ldconfig |
130 | ||
131 | %package -n libuutil1 | |
132 | Summary: Solaris userland utility library for Linux | |
133 | Group: System Environment/Kernel | |
134 | ||
135 | %description -n libuutil1 | |
136 | This library provides a variety of compatibility functions for ZFS on Linux: | |
137 | * libspl: The Solaris Porting Layer userland library, which provides APIs | |
138 | that make it possible to run Solaris user code in a Linux environment | |
139 | with relatively minimal modification. | |
140 | * libavl: The Adelson-Velskii Landis balanced binary tree manipulation | |
141 | library. | |
142 | * libefi: The Extensible Firmware Interface library for GUID disk | |
143 | partitioning. | |
144 | * libshare: NFS, SMB, and iSCSI service integration for ZFS. | |
145 | ||
c0ba93de | 146 | %post -n libuutil1 -p /sbin/ldconfig |
c9b5cc8c TF |
147 | %postun -n libuutil1 -p /sbin/ldconfig |
148 | ||
149 | %package -n libzfs2 | |
150 | Summary: Native ZFS filesystem library for Linux | |
151 | Group: System Environment/Kernel | |
152 | ||
153 | %description -n libzfs2 | |
154 | This package provides support for managing ZFS filesystems | |
155 | ||
c0ba93de | 156 | %post -n libzfs2 -p /sbin/ldconfig |
c9b5cc8c TF |
157 | %postun -n libzfs2 -p /sbin/ldconfig |
158 | ||
159 | %package -n libzfs2-devel | |
f3757573 BB |
160 | Summary: Development headers |
161 | Group: System Environment/Kernel | |
c9b5cc8c TF |
162 | Requires: libzfs2 = %{version} |
163 | Requires: libzpool2 = %{version} | |
164 | Requires: libnvpair1 = %{version} | |
165 | Requires: libuutil1 = %{version} | |
166 | Provides: libzpool2-devel | |
167 | Provides: libnvpair1-devel | |
168 | Provides: libuutil1-devel | |
169 | Obsoletes: zfs-devel | |
f3757573 | 170 | |
c9b5cc8c | 171 | %description -n libzfs2-devel |
f3757573 BB |
172 | This package contains the header files needed for building additional |
173 | applications against the ZFS libraries. | |
174 | ||
175 | %package test | |
176 | Summary: Test infrastructure | |
177 | Group: System Environment/Kernel | |
178 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
179 | Requires: parted | |
180 | Requires: lsscsi | |
181 | Requires: mdadm | |
182 | Requires: bc | |
6bb24f4d | 183 | Requires: ksh |
679d73e9 JWK |
184 | Requires: fio |
185 | Requires: acl | |
099700d9 | 186 | Requires: sudo |
679d73e9 | 187 | Requires: sysstat |
4807c0ba | 188 | Requires: rng-tools |
f3757573 BB |
189 | |
190 | %description test | |
191 | This package contains test infrastructure and support scripts for | |
192 | validating the file system. | |
193 | ||
194 | %package dracut | |
195 | Summary: Dracut module | |
196 | Group: System Environment/Kernel | |
197 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
198 | Requires: dracut | |
199 | ||
200 | %description dracut | |
201 | This package contains a dracut module used to construct an initramfs | |
202 | image which is ZFS aware. | |
203 | ||
2cac7f5f TF |
204 | %if 0%{?_initramfs} |
205 | %package initramfs | |
206 | Summary: Initramfs module | |
207 | Group: System Environment/Kernel | |
208 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
209 | Requires: %{name} = %{version}-%{release} | |
210 | Requires: initramfs-tools | |
211 | ||
212 | %description initramfs | |
213 | This package contains a initramfs module used to construct an initramfs | |
214 | image which is ZFS aware. | |
215 | %endif | |
216 | ||
f3757573 BB |
217 | %prep |
218 | %if %{with debug} | |
219 | %define debug --enable-debug | |
220 | %else | |
221 | %define debug --disable-debug | |
222 | %endif | |
881f45c6 RE |
223 | %if 0%{?_systemd} |
224 | %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit | |
225 | %else | |
226 | %define systemd --enable-sysvinit --disable-systemd | |
227 | %endif | |
f3757573 BB |
228 | |
229 | %setup -q | |
230 | ||
231 | %build | |
232 | %configure \ | |
233 | --with-config=user \ | |
234 | --with-udevdir=%{_udevdir} \ | |
2ee4e7da | 235 | --with-udevruledir=%{_udevruledir} \ |
f3757573 BB |
236 | --with-dracutdir=%{_dracutdir} \ |
237 | --disable-static \ | |
238 | %{debug} \ | |
881f45c6 | 239 | %{systemd} |
f3757573 BB |
240 | make %{?_smp_mflags} |
241 | ||
242 | %install | |
243 | %{__rm} -rf $RPM_BUILD_ROOT | |
244 | make install DESTDIR=%{?buildroot} | |
245 | find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \; | |
246 | ||
ba661a6e | 247 | %post |
881f45c6 | 248 | %if 0%{?_systemd} |
b3c159fe | 249 | %systemd_post %{systemd_svcs} |
881f45c6 | 250 | %else |
2a34db1b TF |
251 | if [ -x /sbin/chkconfig ]; then |
252 | /sbin/chkconfig --add zfs-import | |
253 | /sbin/chkconfig --add zfs-mount | |
254 | /sbin/chkconfig --add zfs-share | |
255 | /sbin/chkconfig --add zfs-zed | |
256 | fi | |
881f45c6 | 257 | %endif |
168d056c | 258 | exit 0 |
ba661a6e BB |
259 | |
260 | %preun | |
881f45c6 | 261 | %if 0%{?_systemd} |
b3c159fe | 262 | %systemd_preun %{systemd_svcs} |
881f45c6 | 263 | %else |
4e3de24b | 264 | if [ "$1" = "0" ] && [ -x /sbin/chkconfig ]; then |
2a34db1b TF |
265 | /sbin/chkconfig --del zfs-import |
266 | /sbin/chkconfig --del zfs-mount | |
267 | /sbin/chkconfig --del zfs-share | |
268 | /sbin/chkconfig --del zfs-zed | |
ba661a6e | 269 | fi |
881f45c6 | 270 | %endif |
168d056c | 271 | exit 0 |
f3757573 | 272 | |
881f45c6 | 273 | %postun |
881f45c6 | 274 | %if 0%{?_systemd} |
b3c159fe | 275 | %systemd_postun %{systemd_svcs} |
881f45c6 | 276 | %endif |
f3757573 BB |
277 | |
278 | %files | |
f3757573 | 279 | %{_sbindir}/* |
fb02fabf | 280 | %{_bindir}/* |
9e246ac3 | 281 | %{_libexecdir}/%{name} |
f3757573 BB |
282 | %{_mandir}/man1/* |
283 | %{_mandir}/man5/* | |
284 | %{_mandir}/man8/* | |
285 | %{_udevdir}/vdev_id | |
286 | %{_udevdir}/zvol_id | |
287 | %{_udevdir}/rules.d/* | |
881f45c6 RE |
288 | %if 0%{?_systemd} |
289 | /usr/lib/modules-load.d/* | |
290 | %{_unitdir}/* | |
291 | %{_presetdir}/* | |
292 | %else | |
2a34db1b TF |
293 | %config(noreplace) %{_sysconfdir}/init.d/* |
294 | %config(noreplace) %{_initconfdir}/zfs | |
881f45c6 | 295 | %endif |
2a34db1b | 296 | %config(noreplace) %{_sysconfdir}/%{name} |
099700d9 | 297 | %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/* |
f3757573 | 298 | |
c9b5cc8c TF |
299 | %files -n libzpool2 |
300 | %{_libdir}/libzpool.so.* | |
301 | ||
302 | %files -n libnvpair1 | |
303 | %{_libdir}/libnvpair.so.* | |
304 | ||
305 | %files -n libuutil1 | |
306 | %{_libdir}/libuutil.so.* | |
307 | ||
308 | %files -n libzfs2 | |
309 | %{_libdir}/libzfs*.so.* | |
310 | ||
311 | %files -n libzfs2-devel | |
c3f8dc2a TF |
312 | %{_datadir}/pkgconfig/libzfs.pc |
313 | %{_datadir}/pkgconfig/libzfs_core.pc | |
f3757573 BB |
314 | %{_libdir}/*.so |
315 | %{_includedir}/* | |
c9b5cc8c TF |
316 | %doc AUTHORS COPYRIGHT DISCLAIMER |
317 | %doc OPENSOLARIS.LICENSE README.markdown | |
f3757573 BB |
318 | |
319 | %files test | |
320 | %{_datadir}/%{name} | |
321 | ||
322 | %files dracut | |
cc492505 | 323 | %doc contrib/dracut/README.dracut.markdown |
f3757573 BB |
324 | %{_dracutdir}/modules.d/* |
325 | ||
2cac7f5f TF |
326 | %if 0%{?_initramfs} |
327 | %files initramfs | |
328 | %doc contrib/initramfs/README.initramfs.markdown | |
329 | /usr/share/initramfs-tools/* | |
330 | %else | |
331 | # Since we're not building the initramfs package, | |
332 | # ignore those files. | |
333 | %exclude /usr/share/initramfs-tools | |
334 | %endif | |
335 | ||
f3757573 | 336 | %changelog |
ccad6431 BB |
337 | * Wed Jul 26 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.7.0-1 |
338 | - Released 0.7.0-1, detailed release notes are available at: | |
339 | - https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0 |