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