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