]>
Commit | Line | Data |
---|---|---|
f3757573 BB |
1 | %global _sbindir /sbin |
2 | %global _libdir /%{_lib} | |
3 | %if 0%{?fedora} >= 17 | |
4 | %global _udevdir %{_prefix}/lib/udev | |
5 | %global _dracutdir %{_prefix}/lib/dracut | |
6 | %else | |
7 | %global _udevdir /lib/udev | |
4788a01d | 8 | %global _dracutdir %{_prefix}/share/dracut |
f3757573 BB |
9 | %endif |
10 | ||
11 | %bcond_with debug | |
12 | %bcond_with blkid | |
881f45c6 | 13 | %bcond_with systemd |
f3757573 | 14 | |
881f45c6 RE |
15 | # Generic enable switch for systemd |
16 | %if %{with systemd} | |
17 | %define _systemd 1 | |
18 | %endif | |
19 | ||
20 | # Fedora >= 15 comes with systemd, but only >= 18 has | |
21 | # the proper macros | |
22 | %if 0%{?fedora} >= 18 | |
23 | %define _systemd 1 | |
24 | %endif | |
25 | ||
26 | # opensuse >= 12.1 comes with systemd, but only >= 13.1 | |
27 | # has the proper macros | |
28 | %if 0%{?suse_version} >= 1310 | |
29 | %define _systemd 1 | |
30 | %endif | |
f3757573 BB |
31 | |
32 | Name: @PACKAGE@ | |
33 | Version: @VERSION@ | |
34 | Release: @RELEASE@%{?dist} | |
35 | Summary: Commands to control the kernel modules and libraries | |
36 | ||
37 | Group: System Environment/Kernel | |
38 | License: @ZFS_META_LICENSE@ | |
39 | URL: http://zfsonlinux.org/ | |
40 | Source0: %{name}-%{version}.tar.gz | |
41 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |
42 | ExclusiveArch: i386 i686 x86_64 | |
43 | ||
44 | # May build but untested on ppc/ppc64 | |
45 | ExcludeArch: ppc ppc64 | |
46 | ||
68a2e016 | 47 | Requires: spl = %{version} |
c9b5cc8c TF |
48 | Requires: libzpool2 = %{version} |
49 | Requires: libnvpair1 = %{version} | |
50 | Requires: libuutil1 = %{version} | |
51 | Requires: libzfs2 = %{version} | |
28967367 | 52 | Requires: %{name}-kmod = %{version} |
f3757573 BB |
53 | Provides: %{name}-kmod-common = %{version} |
54 | ||
f12971e6 RE |
55 | # zfs-fuse provides the same commands and man pages that ZoL does. Renaming |
56 | # those on either side would conflict with all available documentation. | |
57 | Conflicts: zfs-fuse | |
58 | ||
f3757573 BB |
59 | %if 0%{?rhel}%{?fedora}%{?suse_version} |
60 | BuildRequires: zlib-devel | |
61 | BuildRequires: libuuid-devel | |
62 | %if %{with blkid} | |
63 | BuildRequires: libblkid-devel | |
64 | %endif | |
f3757573 | 65 | %endif |
881f45c6 RE |
66 | %if 0%{?_systemd} |
67 | Requires(post): systemd | |
68 | Requires(preun): systemd | |
69 | Requires(postun): systemd | |
70 | BuildRequires: systemd | |
71 | %endif | |
f3757573 BB |
72 | |
73 | %description | |
c9b5cc8c | 74 | This package contains the ZFS command line utilities. |
f3757573 | 75 | |
c9b5cc8c TF |
76 | %package -n libzpool2 |
77 | Summary: Native ZFS pool library for Linux | |
78 | Group: System Environment/Kernel | |
79 | ||
80 | %description -n libzpool2 | |
81 | This package contains the zpool library, which provides support | |
82 | for managing zpools | |
83 | ||
84 | %post-n libzpool2 -p /sbin/ldconfig | |
85 | %postun -n libzpool2 -p /sbin/ldconfig | |
86 | ||
87 | %package -n libnvpair1 | |
88 | Summary: Solaris name-value library for Linux | |
89 | Group: System Environment/Kernel | |
90 | ||
91 | %description -n libnvpair1 | |
92 | This package contains routines for packing and unpacking name-value | |
93 | pairs. This functionality is used to portably transport data across | |
94 | process boundaries, between kernel and user space, and can be used | |
95 | to write self describing data structures on disk. | |
96 | ||
97 | %post-n libnvpair1 -p /sbin/ldconfig | |
98 | %postun -n libnvpair1 -p /sbin/ldconfig | |
99 | ||
100 | %package -n libuutil1 | |
101 | Summary: Solaris userland utility library for Linux | |
102 | Group: System Environment/Kernel | |
103 | ||
104 | %description -n libuutil1 | |
105 | This library provides a variety of compatibility functions for ZFS on Linux: | |
106 | * libspl: The Solaris Porting Layer userland library, which provides APIs | |
107 | that make it possible to run Solaris user code in a Linux environment | |
108 | with relatively minimal modification. | |
109 | * libavl: The Adelson-Velskii Landis balanced binary tree manipulation | |
110 | library. | |
111 | * libefi: The Extensible Firmware Interface library for GUID disk | |
112 | partitioning. | |
113 | * libshare: NFS, SMB, and iSCSI service integration for ZFS. | |
114 | ||
115 | %post-n libuutil1 -p /sbin/ldconfig | |
116 | %postun -n libuutil1 -p /sbin/ldconfig | |
117 | ||
118 | %package -n libzfs2 | |
119 | Summary: Native ZFS filesystem library for Linux | |
120 | Group: System Environment/Kernel | |
121 | ||
122 | %description -n libzfs2 | |
123 | This package provides support for managing ZFS filesystems | |
124 | ||
125 | %post-n libzfs2 -p /sbin/ldconfig | |
126 | %postun -n libzfs2 -p /sbin/ldconfig | |
127 | ||
128 | %package -n libzfs2-devel | |
f3757573 BB |
129 | Summary: Development headers |
130 | Group: System Environment/Kernel | |
c9b5cc8c TF |
131 | Requires: libzfs2 = %{version} |
132 | Requires: libzpool2 = %{version} | |
133 | Requires: libnvpair1 = %{version} | |
134 | Requires: libuutil1 = %{version} | |
135 | Provides: libzpool2-devel | |
136 | Provides: libnvpair1-devel | |
137 | Provides: libuutil1-devel | |
138 | Obsoletes: zfs-devel | |
f3757573 | 139 | |
c9b5cc8c | 140 | %description -n libzfs2-devel |
f3757573 BB |
141 | This package contains the header files needed for building additional |
142 | applications against the ZFS libraries. | |
143 | ||
144 | %package test | |
145 | Summary: Test infrastructure | |
146 | Group: System Environment/Kernel | |
147 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
148 | Requires: parted | |
149 | Requires: lsscsi | |
150 | Requires: mdadm | |
151 | Requires: bc | |
152 | ||
153 | %description test | |
154 | This package contains test infrastructure and support scripts for | |
155 | validating the file system. | |
156 | ||
157 | %package dracut | |
158 | Summary: Dracut module | |
159 | Group: System Environment/Kernel | |
160 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
161 | Requires: dracut | |
162 | ||
163 | %description dracut | |
164 | This package contains a dracut module used to construct an initramfs | |
165 | image which is ZFS aware. | |
166 | ||
167 | %prep | |
168 | %if %{with debug} | |
169 | %define debug --enable-debug | |
170 | %else | |
171 | %define debug --disable-debug | |
172 | %endif | |
173 | %if %{with blkid} | |
174 | %define blkid --with-blkid | |
175 | %else | |
176 | %define blkid --without-blkid | |
177 | %endif | |
881f45c6 RE |
178 | %if 0%{?_systemd} |
179 | %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit | |
180 | %else | |
181 | %define systemd --enable-sysvinit --disable-systemd | |
182 | %endif | |
f3757573 BB |
183 | |
184 | %setup -q | |
185 | ||
186 | %build | |
187 | %configure \ | |
188 | --with-config=user \ | |
189 | --with-udevdir=%{_udevdir} \ | |
190 | --with-dracutdir=%{_dracutdir} \ | |
191 | --disable-static \ | |
192 | %{debug} \ | |
881f45c6 RE |
193 | %{blkid} \ |
194 | %{systemd} | |
f3757573 BB |
195 | make %{?_smp_mflags} |
196 | ||
197 | %install | |
198 | %{__rm} -rf $RPM_BUILD_ROOT | |
199 | make install DESTDIR=%{?buildroot} | |
200 | find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \; | |
201 | ||
ba661a6e | 202 | %post |
881f45c6 RE |
203 | %if 0%{?_systemd} |
204 | %systemd_post zfs.target | |
205 | %else | |
ba661a6e | 206 | [ -x /sbin/chkconfig ] && /sbin/chkconfig --add zfs |
881f45c6 | 207 | %endif |
168d056c | 208 | exit 0 |
ba661a6e BB |
209 | |
210 | %preun | |
881f45c6 RE |
211 | %if 0%{?_systemd} |
212 | %systemd_preun zfs.target | |
213 | %else | |
ba661a6e BB |
214 | if [ $1 -eq 0 ] ; then |
215 | [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs | |
216 | fi | |
881f45c6 | 217 | %endif |
168d056c | 218 | exit 0 |
f3757573 | 219 | |
881f45c6 | 220 | %postun |
881f45c6 RE |
221 | %if 0%{?_systemd} |
222 | %systemd_postun zfs.target | |
223 | %endif | |
f3757573 BB |
224 | |
225 | %files | |
f3757573 | 226 | %{_sbindir}/* |
fb02fabf | 227 | %{_bindir}/* |
9e246ac3 | 228 | %{_libexecdir}/%{name} |
f3757573 BB |
229 | %{_mandir}/man1/* |
230 | %{_mandir}/man5/* | |
231 | %{_mandir}/man8/* | |
232 | %{_udevdir}/vdev_id | |
233 | %{_udevdir}/zvol_id | |
234 | %{_udevdir}/rules.d/* | |
235 | %config(noreplace) %{_sysconfdir}/%{name} | |
881f45c6 RE |
236 | %if 0%{?_systemd} |
237 | /usr/lib/modules-load.d/* | |
238 | %{_unitdir}/* | |
239 | %{_presetdir}/* | |
240 | %else | |
b7f59425 | 241 | %{_sysconfdir}/init.d/* |
881f45c6 | 242 | %endif |
f3757573 | 243 | |
c9b5cc8c TF |
244 | %files -n libzpool2 |
245 | %{_libdir}/libzpool.so.* | |
246 | ||
247 | %files -n libnvpair1 | |
248 | %{_libdir}/libnvpair.so.* | |
249 | ||
250 | %files -n libuutil1 | |
251 | %{_libdir}/libuutil.so.* | |
252 | ||
253 | %files -n libzfs2 | |
254 | %{_libdir}/libzfs*.so.* | |
255 | ||
256 | %files -n libzfs2-devel | |
f3757573 BB |
257 | %{_libdir}/*.so |
258 | %{_includedir}/* | |
c9b5cc8c TF |
259 | %doc AUTHORS COPYRIGHT DISCLAIMER |
260 | %doc OPENSOLARIS.LICENSE README.markdown | |
f3757573 BB |
261 | |
262 | %files test | |
263 | %{_datadir}/%{name} | |
264 | ||
265 | %files dracut | |
266 | %doc dracut/README.dracut.markdown | |
267 | %{_dracutdir}/modules.d/* | |
268 | ||
269 | %changelog | |
0c28fb48 BB |
270 | * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1 |
271 | - Released 0.6.2-1 | |
36c0b627 BB |
272 | * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1 |
273 | - First official stable release. |