]>
Commit | Line | Data |
---|---|---|
06fbfb84 JB |
1 | # TODO: |
2 | # - PLDify init script | |
3 | # - unpackaged initramfs-tools support: | |
4 | # /usr/share/initramfs-tools/conf-hooks.d/zfs | |
5 | # /usr/share/initramfs-tools/hooks/zfs | |
6 | # /usr/share/initramfs-tools/scripts/zfs | |
bff0a8a1 JB |
7 | # |
8 | # Conditional build: | |
bff0a8a1 JB |
9 | %bcond_without kernel # don't build kernel modules |
10 | %bcond_without userspace # don't build userspace programs | |
11 | %bcond_with verbose # verbose build (V=1) | |
12 | # | |
3921af7f JR |
13 | # The goal here is to have main, userspace, package built once with |
14 | # simple release number, and only rebuild kernel packages with kernel | |
15 | # version as part of release number, without the need to bump release | |
16 | # with every kernel change. | |
17 | %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} | |
18 | %{error:kernel and userspace cannot be built at the same time on PLD builders} | |
19 | exit 1 | |
20 | %endif | |
21 | ||
bff0a8a1 JB |
22 | %if %{without userspace} |
23 | # nothing to be placed to debuginfo package | |
24 | %define _enable_debug_packages 0 | |
25 | %endif | |
3921af7f JR |
26 | |
27 | %define _duplicate_files_terminate_build 0 | |
28 | ||
078d015a | 29 | %define rel 5 |
3921af7f | 30 | %define pname zfs |
bff0a8a1 JB |
31 | Summary: Native Linux port of the ZFS filesystem |
32 | Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS | |
3921af7f | 33 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
30bf4ba6 | 34 | Version: 0.6.5.8 |
3921af7f | 35 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
bff0a8a1 JB |
36 | License: CDDL (ZFS), GPL v2+ (ZPIOS) |
37 | Group: Applications/System | |
2a81ce8f | 38 | Source0: https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz |
30bf4ba6 | 39 | # Source0-md5: ffc51dcf5260d3c7e747fe78f8ae307c |
3921af7f | 40 | Patch0: %{pname}-link.patch |
58d00fd6 | 41 | Patch1: x32.patch |
bb670c20 | 42 | Patch2: setattr_prepare.patch |
078d015a | 43 | Patch3: linux-4.9.patch |
bff0a8a1 JB |
44 | URL: http://zfsonlinux.org/ |
45 | BuildRequires: autoconf >= 2.50 | |
46 | BuildRequires: automake | |
47 | BuildRequires: libtool | |
1b58aab1 | 48 | BuildRequires: rpmbuild(macros) >= 1.701 |
2d67b9de JR |
49 | %if %{with kernel} |
50 | %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2} | |
51 | %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3} | |
52 | %endif | |
bff0a8a1 JB |
53 | %if %{with userspace} |
54 | BuildRequires: libblkid-devel | |
55 | BuildRequires: libselinux-devel | |
56 | BuildRequires: libuuid-devel | |
57 | BuildRequires: zlib-devel | |
58 | %endif | |
59 | Requires: %{pname}-libs = %{version}-%{release} | |
60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
61 | ||
8fa57ce6 JP |
62 | %define dracutlibdir %{_prefix}/lib/dracut |
63 | ||
bff0a8a1 JB |
64 | %description |
65 | ZFS is an advanced file system and volume manager which was originally | |
66 | developed for Solaris and is now maintained by the Illumos community. | |
67 | ||
68 | ZFS on Linux, which is also known as ZoL, is currently feature | |
69 | complete. It includes fully functional and stable SPA, DMU, ZVOL, and | |
70 | ZPL layers. | |
71 | ||
72 | %description -l pl.UTF-8 | |
73 | ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie | |
74 | stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos. | |
75 | ||
76 | ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w | |
77 | pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy | |
78 | SPA, DMU, ZVOL i ZPL. | |
79 | ||
80 | %package libs | |
81 | Summary: ZFS on Linux libraries | |
82 | Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa | |
83 | License: CDDL | |
84 | Group: Libraries | |
8fa57ce6 | 85 | Requires(post,postun): /sbin/ldconfig |
bff0a8a1 JB |
86 | |
87 | %description libs | |
88 | ZFS on Linux libraries. | |
89 | ||
90 | %description libs -l pl.UTF-8 | |
91 | Biblioteki ZFS-a dla Linuksa. | |
92 | ||
93 | %package devel | |
94 | Summary: Header files for ZFS libraries | |
95 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a | |
96 | License: CDDL | |
97 | Group: Development/Libraries | |
98 | Requires: %{pname}-libs = %{version}-%{release} | |
99 | Requires: libselinux-devel | |
100 | Requires: libuuid-devel | |
101 | Requires: zlib-devel | |
102 | ||
103 | %description devel | |
104 | Header files for ZFS libraries. | |
105 | ||
106 | %description devel -l pl.UTF-8 | |
107 | Pliki nagłówkowe bibliotek ZFS-a. | |
108 | ||
109 | %package static | |
110 | Summary: Static ZFS libraries | |
111 | Summary(pl.UTF-8): Statyczne biblioteki ZFS-a | |
112 | License: CDDL | |
113 | Group: Development/Libraries | |
114 | Requires: %{pname}-devel = %{version}-%{release} | |
115 | ||
116 | %description static | |
117 | Static ZFS libraries. | |
118 | ||
119 | %description static -l pl.UTF-8 | |
120 | Statyczne biblioteki ZFS-a. | |
121 | ||
122 | %package -n dracut-zfs | |
123 | Summary: ZFS support for Dracut | |
124 | Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta | |
125 | Group: Applications/System | |
126 | Requires: %{pname} = %{version}-%{release} | |
127 | Requires: dracut | |
128 | ||
129 | %description -n dracut-zfs | |
130 | ZFS support for Dracut. | |
131 | ||
132 | %description -n dracut-zfs -l pl.UTF-8 | |
133 | Obsługa ZFS-a dla Dracuta. | |
134 | ||
3921af7f | 135 | %package -n kernel-zfs-common-devel |
bff0a8a1 JB |
136 | Summary: ZFS Linux kernel headers |
137 | Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa | |
bff0a8a1 | 138 | Group: Development/Building |
bff0a8a1 | 139 | |
3921af7f JR |
140 | %description -n kernel-zfs-common-devel |
141 | ZFS Linux kernel headers common for all PLD kernel versions. | |
142 | ||
143 | %description -n kernel-zfs-common-devel -l pl.UTF-8 | |
144 | ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich | |
145 | wersji jąder PLD. | |
146 | ||
147 | %define kernel_pkg()\ | |
148 | %package -n kernel%{_alt_kernel}-zfs\ | |
149 | Summary: ZFS Linux kernel modules\ | |
150 | Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\ | |
151 | Release: %{rel}@%{_kernel_ver_str}\ | |
152 | Group: Base/Kernel\ | |
153 | Requires(post,postun): /sbin/depmod\ | |
3921af7f JR |
154 | %requires_releq_kernel\ |
155 | Requires(postun): %releq_kernel\ | |
3921af7f JR |
156 | \ |
157 | %description -n kernel%{_alt_kernel}-zfs\ | |
158 | ZFS Linux kernel modules.\ | |
159 | \ | |
160 | %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\ | |
161 | ZFS - moduły jądra Linuksa.\ | |
162 | \ | |
163 | %package -n kernel%{_alt_kernel}-zfs-devel\ | |
164 | Summary: ZFS Linux kernel headers\ | |
165 | Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\ | |
166 | Release: %{rel}@%{_kernel_ver_str}\ | |
167 | Group: Development/Building\ | |
3921af7f JR |
168 | Requires: kernel%{_alt_kernel}-headers\ |
169 | Requires: kernel-zfs-common-devel\ | |
3921af7f JR |
170 | \ |
171 | %description -n kernel%{_alt_kernel}-zfs-devel\ | |
172 | ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\ | |
173 | version %{_kernel_ver}.\ | |
174 | \ | |
175 | %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\ | |
176 | ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\ | |
177 | pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\ | |
178 | \ | |
179 | %files -n kernel%{_alt_kernel}-zfs\ | |
180 | %defattr(644,root,root,755)\ | |
181 | %dir /lib/modules/%{_kernel_ver}/misc/avl\ | |
182 | /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\ | |
183 | %dir /lib/modules/%{_kernel_ver}/misc/nvpair\ | |
184 | /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\ | |
185 | %dir /lib/modules/%{_kernel_ver}/misc/unicode\ | |
186 | /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\ | |
187 | %dir /lib/modules/%{_kernel_ver}/misc/zcommon\ | |
188 | /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\ | |
189 | %dir /lib/modules/%{_kernel_ver}/misc/zfs\ | |
190 | /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\ | |
191 | %dir /lib/modules/%{_kernel_ver}/misc/zpios\ | |
192 | /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\ | |
193 | \ | |
194 | %files -n kernel%{_alt_kernel}-zfs-devel\ | |
195 | %defattr(644,root,root,755)\ | |
196 | /usr/src/zfs-%{version}/%{_kernel_ver}\ | |
197 | \ | |
198 | %post -n kernel%{_alt_kernel}-zfs\ | |
199 | %depmod %{_kernel_ver}\ | |
200 | \ | |
201 | %postun -n kernel%{_alt_kernel}-zfs\ | |
202 | %depmod %{_kernel_ver}\ | |
203 | %{nil} | |
204 | ||
205 | %define build_kernel_pkg()\ | |
206 | %configure \\\ | |
207 | --disable-silent-rules \\\ | |
208 | --with-config="kernel" \\\ | |
f2042a9c JR |
209 | --with-linux=%{_kernelsrcdir}\\\ |
210 | --with-linux-obj=%{_kernelsrcdir}\ | |
3921af7f JR |
211 | \ |
212 | %{__make} clean\ | |
213 | %{__make} %{?with_verbose:V=1}\ | |
214 | p=`pwd`\ | |
215 | %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\ | |
216 | %{nil} | |
217 | ||
2d67b9de | 218 | %{?with_kernel:%{expand:%create_kernel_packages}} |
bff0a8a1 JB |
219 | |
220 | %prep | |
3921af7f | 221 | %setup -q -n %{pname}-%{version} |
bff0a8a1 | 222 | %patch0 -p1 |
97d46215 | 223 | %patch1 -p1 |
4ef2c188 | 224 | %patch2 -p1 |
078d015a | 225 | %patch3 -p1 |
bff0a8a1 JB |
226 | |
227 | %build | |
228 | %{__libtoolize} | |
229 | %{__aclocal} -I config | |
230 | %{__autoconf} | |
231 | %{__autoheader} | |
232 | %{__automake} | |
2d67b9de | 233 | %{?with_kernel:%{expand:%build_kernel_packages}} |
3921af7f JR |
234 | |
235 | %if %{with userspace} | |
bff0a8a1 JB |
236 | %configure \ |
237 | --disable-silent-rules \ | |
3921af7f | 238 | --with-config="user" \ |
bff0a8a1 | 239 | --with-linux=%{_kernelsrcdir} \ |
ec61a23e JB |
240 | --with-systemdunitdir=%{systemdunitdir} \ |
241 | --with-systemdpresetdir=/etc/systemd/system-preset \ | |
bff0a8a1 JB |
242 | --with-udevdir=/lib/udev |
243 | ||
244 | %{__make} \ | |
245 | %{?with_verbose:V=1} | |
3921af7f | 246 | %endif |
bff0a8a1 JB |
247 | |
248 | %install | |
249 | rm -rf $RPM_BUILD_ROOT | |
250 | ||
3921af7f JR |
251 | %if %{with kernel} |
252 | install -d $RPM_BUILD_ROOT | |
253 | cp -a installed/* $RPM_BUILD_ROOT | |
254 | %endif | |
255 | ||
256 | %if %{with userspace} | |
bff0a8a1 JB |
257 | %{__make} install \ |
258 | DESTDIR=$RPM_BUILD_ROOT \ | |
3921af7f | 259 | DEFAULT_INIT_DIR=/etc/rc.d/init.d |
58d00fd6 JR |
260 | |
261 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
262 | %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir} | |
3921af7f | 263 | %endif |
bff0a8a1 JB |
264 | |
265 | %clean | |
266 | rm -rf $RPM_BUILD_ROOT | |
267 | ||
8fa57ce6 JP |
268 | %post libs -p /sbin/ldconfig |
269 | %postun libs -p /sbin/ldconfig | |
270 | ||
bff0a8a1 JB |
271 | %if %{with userspace} |
272 | %files | |
273 | %defattr(644,root,root,755) | |
274 | %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown | |
275 | %attr(755,root,root) /sbin/mount.zfs | |
58d00fd6 | 276 | %attr(755,root,root) %{_bindir}/arc_summary.py |
bff0a8a1 | 277 | %attr(755,root,root) %{_bindir}/arcstat.py |
ec61a23e | 278 | %attr(755,root,root) %{_bindir}/dbufstat.py |
bff0a8a1 JB |
279 | %attr(755,root,root) %{_sbindir}/fsck.zfs |
280 | %attr(755,root,root) %{_sbindir}/zdb | |
ec61a23e | 281 | %attr(755,root,root) %{_sbindir}/zed |
bff0a8a1 JB |
282 | %attr(755,root,root) %{_sbindir}/zfs |
283 | %attr(755,root,root) %{_sbindir}/zhack | |
284 | %attr(755,root,root) %{_sbindir}/zinject | |
285 | %attr(755,root,root) %{_sbindir}/zpios | |
286 | %attr(755,root,root) %{_sbindir}/zpool | |
287 | %attr(755,root,root) %{_sbindir}/zstreamdump | |
288 | %attr(755,root,root) %{_sbindir}/ztest | |
289 | %dir %{_sysconfdir}/zfs | |
290 | # package *.example as %doc? (they cannot act as default configuration) | |
291 | %{_sysconfdir}/zfs/vdev_id.conf.*.example | |
ec61a23e JB |
292 | %dir %{_sysconfdir}/zfs/zed.d |
293 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh | |
294 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc | |
58d00fd6 JR |
295 | %attr(754,root,root) /etc/rc.d/init.d/zfs-import |
296 | %attr(754,root,root) /etc/rc.d/init.d/zfs-mount | |
297 | %attr(754,root,root) /etc/rc.d/init.d/zfs-share | |
298 | %attr(754,root,root) /etc/rc.d/init.d/zfs-zed | |
299 | %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs | |
300 | /etc/zfs/zfs-functions | |
ec61a23e JB |
301 | /usr/lib/modules-load.d/zfs.conf |
302 | /etc/systemd/system-preset/50-zfs.preset | |
ec61a23e JB |
303 | %{systemdunitdir}/zfs.target |
304 | %{systemdunitdir}/zfs-import-cache.service | |
305 | %{systemdunitdir}/zfs-import-scan.service | |
306 | %{systemdunitdir}/zfs-mount.service | |
307 | %{systemdunitdir}/zfs-share.service | |
97dbbf93 | 308 | %{systemdunitdir}/zfs-zed.service |
bff0a8a1 JB |
309 | %attr(755,root,root) /lib/udev/vdev_id |
310 | %attr(755,root,root) /lib/udev/zvol_id | |
311 | /lib/udev/rules.d/60-zvol.rules | |
312 | /lib/udev/rules.d/69-vdev.rules | |
313 | /lib/udev/rules.d/90-zfs.rules | |
ec61a23e JB |
314 | %dir %{_libdir}/zfs |
315 | %dir %{_libdir}/zfs/zed.d | |
316 | %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh | |
bff0a8a1 JB |
317 | %dir %{_datadir}/zfs |
318 | %attr(755,root,root) %{_datadir}/zfs/*.sh | |
319 | %dir %{_datadir}/zfs/zpios-profile | |
320 | %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh | |
321 | %dir %{_datadir}/zfs/zpios-test | |
322 | %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh | |
323 | %dir %{_datadir}/zfs/zpool-config | |
324 | %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh | |
325 | %{_mandir}/man1/zhack.1* | |
326 | %{_mandir}/man1/zpios.1* | |
327 | %{_mandir}/man1/ztest.1* | |
328 | %{_mandir}/man5/vdev_id.conf.5* | |
58d00fd6 | 329 | %{_mandir}/man5/zfs-events.5* |
ec61a23e | 330 | %{_mandir}/man5/zfs-module-parameters.5* |
bff0a8a1 JB |
331 | %{_mandir}/man5/zpool-features.5* |
332 | %{_mandir}/man8/fsck.zfs.8* | |
333 | %{_mandir}/man8/mount.zfs.8* | |
334 | %{_mandir}/man8/vdev_id.8* | |
335 | %{_mandir}/man8/zdb.8* | |
ec61a23e | 336 | %{_mandir}/man8/zed.8* |
bff0a8a1 JB |
337 | %{_mandir}/man8/zfs.8* |
338 | %{_mandir}/man8/zinject.8* | |
339 | %{_mandir}/man8/zpool.8* | |
340 | %{_mandir}/man8/zstreamdump.8* | |
341 | ||
342 | %files libs | |
343 | %defattr(644,root,root,755) | |
344 | %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.* | |
345 | %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1 | |
346 | %attr(755,root,root) %{_libdir}/libuutil.so.*.*.* | |
347 | %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1 | |
348 | %attr(755,root,root) %{_libdir}/libzfs.so.*.*.* | |
ec61a23e JB |
349 | %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2 |
350 | %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.* | |
351 | %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1 | |
bff0a8a1 | 352 | %attr(755,root,root) %{_libdir}/libzpool.so.*.*.* |
ec61a23e | 353 | %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2 |
bff0a8a1 JB |
354 | |
355 | %files devel | |
356 | %defattr(644,root,root,755) | |
357 | %attr(755,root,root) %{_libdir}/libnvpair.so | |
358 | %attr(755,root,root) %{_libdir}/libuutil.so | |
359 | %attr(755,root,root) %{_libdir}/libzfs.so | |
ec61a23e | 360 | %attr(755,root,root) %{_libdir}/libzfs_core.so |
bff0a8a1 JB |
361 | %attr(755,root,root) %{_libdir}/libzpool.so |
362 | %{_libdir}/libnvpair.la | |
363 | %{_libdir}/libuutil.la | |
364 | %{_libdir}/libzfs.la | |
ec61a23e | 365 | %{_libdir}/libzfs_core.la |
bff0a8a1 JB |
366 | %{_libdir}/libzpool.la |
367 | %{_includedir}/libspl | |
368 | %{_includedir}/libzfs | |
58d00fd6 JR |
369 | %{_pkgconfigdir}/libzfs.pc |
370 | %{_pkgconfigdir}/libzfs_core.pc | |
bff0a8a1 JB |
371 | |
372 | %files static | |
373 | %defattr(644,root,root,755) | |
374 | %{_libdir}/libnvpair.a | |
375 | %{_libdir}/libuutil.a | |
376 | %{_libdir}/libzfs.a | |
ec61a23e | 377 | %{_libdir}/libzfs_core.a |
bff0a8a1 JB |
378 | %{_libdir}/libzpool.a |
379 | ||
380 | %files -n dracut-zfs | |
381 | %defattr(644,root,root,755) | |
58d00fd6 | 382 | %doc contrib/dracut/README.dracut.markdown |
8fa57ce6 | 383 | %dir %{dracutlibdir}/modules.d/90zfs |
58d00fd6 | 384 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh |
8fa57ce6 JP |
385 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh |
386 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh | |
387 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh | |
58d00fd6 | 388 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh |
bff0a8a1 JB |
389 | %endif |
390 | ||
391 | %if %{with kernel} | |
3921af7f | 392 | %files -n kernel-zfs-common-devel |
bff0a8a1 | 393 | %defattr(644,root,root,755) |
e11b2ec8 | 394 | %dir /usr/src/zfs-%{version} |
3921af7f JR |
395 | /usr/src/zfs-%{version}/include |
396 | /usr/src/zfs-%{version}/zfs.release.in | |
397 | /usr/src/zfs-%{version}/zfs_config.h.in | |
bff0a8a1 | 398 | %endif |