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