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