]> git.pld-linux.org Git - packages/zfs.git/blob - zfs.spec
- rel 5
[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     5
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 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 \
204 %{__make} clean\
205 %{__make} %{?with_verbose:V=1}\
206 p=`pwd`\
207 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
208 %{nil}
209
210 %{?with_kernel:%{expand:%create_kernel_packages}}
211
212 %prep
213 %setup -q -n %{pname}-%{version}
214 %patch0 -p1
215 %patch1 -p1
216
217 %build
218 %{__libtoolize}
219 %{__aclocal} -I config
220 %{__autoconf}
221 %{__autoheader}
222 %{__automake}
223 %{?with_kernel:%{expand:%build_kernel_packages}}
224
225 %if %{with userspace}
226 %configure \
227         --disable-silent-rules \
228         --with-config="user" \
229         --with-linux=%{_kernelsrcdir} \
230         --with-systemdunitdir=%{systemdunitdir} \
231         --with-systemdpresetdir=/etc/systemd/system-preset \
232         --with-udevdir=/lib/udev
233
234 %{__make} \
235         %{?with_verbose:V=1}
236 %endif
237
238 %install
239 rm -rf $RPM_BUILD_ROOT
240
241 %if %{with kernel}
242 install -d $RPM_BUILD_ROOT
243 cp -a installed/* $RPM_BUILD_ROOT
244 %endif
245
246 %if %{with userspace}
247 %{__make} install \
248         DESTDIR=$RPM_BUILD_ROOT \
249         DEFAULT_INIT_DIR=/etc/rc.d/init.d
250 %endif
251
252 %clean
253 rm -rf $RPM_BUILD_ROOT
254
255 %post   libs -p /sbin/ldconfig
256 %postun libs -p /sbin/ldconfig
257
258 %if %{with userspace}
259 %files
260 %defattr(644,root,root,755)
261 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
262 %attr(755,root,root) /sbin/mount.zfs
263 %attr(755,root,root) %{_bindir}/arcstat.py
264 %attr(755,root,root) %{_bindir}/dbufstat.py
265 %attr(755,root,root) %{_sbindir}/fsck.zfs
266 %attr(755,root,root) %{_sbindir}/zdb
267 %attr(755,root,root) %{_sbindir}/zed
268 %attr(755,root,root) %{_sbindir}/zfs
269 %attr(755,root,root) %{_sbindir}/zhack
270 %attr(755,root,root) %{_sbindir}/zinject
271 %attr(755,root,root) %{_sbindir}/zpios
272 %attr(755,root,root) %{_sbindir}/zpool
273 %attr(755,root,root) %{_sbindir}/zstreamdump
274 %attr(755,root,root) %{_sbindir}/ztest
275 %dir %{_sysconfdir}/zfs
276 # package *.example as %doc? (they cannot act as default configuration)
277 %{_sysconfdir}/zfs/vdev_id.conf.*.example
278 %dir %{_sysconfdir}/zfs/zed.d
279 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
280 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
281 %attr(754,root,root) /etc/rc.d/init.d/zfs
282 /usr/lib/modules-load.d/zfs.conf
283 /etc/systemd/system-preset/50-zfs.preset
284 %{systemdunitdir}/zed.service
285 %{systemdunitdir}/zfs.target
286 %{systemdunitdir}/zfs-import-cache.service
287 %{systemdunitdir}/zfs-import-scan.service
288 %{systemdunitdir}/zfs-mount.service
289 %{systemdunitdir}/zfs-share.service
290 %attr(755,root,root) /lib/udev/vdev_id
291 %attr(755,root,root) /lib/udev/zvol_id
292 /lib/udev/rules.d/60-zvol.rules
293 /lib/udev/rules.d/69-vdev.rules
294 /lib/udev/rules.d/90-zfs.rules
295 %dir %{_libdir}/zfs
296 %dir %{_libdir}/zfs/zed.d
297 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
298 %dir %{_datadir}/zfs
299 %attr(755,root,root) %{_datadir}/zfs/*.sh
300 %dir %{_datadir}/zfs/zpios-profile
301 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
302 %dir %{_datadir}/zfs/zpios-test
303 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
304 %dir %{_datadir}/zfs/zpool-config
305 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
306 %{_mandir}/man1/zhack.1*
307 %{_mandir}/man1/zpios.1*
308 %{_mandir}/man1/ztest.1*
309 %{_mandir}/man5/vdev_id.conf.5*
310 %{_mandir}/man5/zfs-module-parameters.5*
311 %{_mandir}/man5/zpool-features.5*
312 %{_mandir}/man8/fsck.zfs.8*
313 %{_mandir}/man8/mount.zfs.8*
314 %{_mandir}/man8/vdev_id.8*
315 %{_mandir}/man8/zdb.8*
316 %{_mandir}/man8/zed.8*
317 %{_mandir}/man8/zfs.8*
318 %{_mandir}/man8/zinject.8*
319 %{_mandir}/man8/zpool.8*
320 %{_mandir}/man8/zstreamdump.8*
321
322 %files libs
323 %defattr(644,root,root,755)
324 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
325 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
326 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
327 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
328 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
329 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
330 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
331 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
332 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
333 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
334
335 %files devel
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_libdir}/libnvpair.so
338 %attr(755,root,root) %{_libdir}/libuutil.so
339 %attr(755,root,root) %{_libdir}/libzfs.so
340 %attr(755,root,root) %{_libdir}/libzfs_core.so
341 %attr(755,root,root) %{_libdir}/libzpool.so
342 %{_libdir}/libnvpair.la
343 %{_libdir}/libuutil.la
344 %{_libdir}/libzfs.la
345 %{_libdir}/libzfs_core.la
346 %{_libdir}/libzpool.la
347 %{_includedir}/libspl
348 %{_includedir}/libzfs
349
350 %files static
351 %defattr(644,root,root,755)
352 %{_libdir}/libnvpair.a
353 %{_libdir}/libuutil.a
354 %{_libdir}/libzfs.a
355 %{_libdir}/libzfs_core.a
356 %{_libdir}/libzpool.a
357
358 %files -n dracut-zfs
359 %defattr(644,root,root,755)
360 %doc dracut/README.dracut.markdown
361 %dir %{dracutlibdir}/modules.d/90zfs
362 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
363 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
364 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
365 %endif
366
367 %if %{with kernel}
368 %files -n kernel-zfs-common-devel
369 %defattr(644,root,root,755)
370 %dir /usr/src/zfs-%{version}
371 /usr/src/zfs-%{version}/include
372 /usr/src/zfs-%{version}/zfs.release.in
373 /usr/src/zfs-%{version}/zfs_config.h.in
374 %endif
This page took 0.053532 seconds and 4 git commands to generate.