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