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