8b57e6e72d77e2b42e083c2be37dee29c40a0bec
[zfs.git] / rpm / generic / zfs.spec.in
1 %global _sbindir    /sbin
2 %global _libdir     /%{_lib}
3 %if 0%{?fedora} >= 17
4 %global _udevdir    %{_prefix}/lib/udev
5 %global _dracutdir  %{_prefix}/lib/dracut
6 %else
7 %global _udevdir    /lib/udev
8 %global _dracutdir  /lib/dracut
9 %endif
10
11 %bcond_with    debug
12 %bcond_with    blkid
13 %bcond_with    selinux
14
15
16 Name:           @PACKAGE@
17 Version:        @VERSION@
18 Release:        @RELEASE@%{?dist}
19 Summary:        Commands to control the kernel modules and libraries
20
21 Group:          System Environment/Kernel
22 License:        @ZFS_META_LICENSE@
23 URL:            http://zfsonlinux.org/
24 Source0:        %{name}-%{version}.tar.gz
25 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
26 ExclusiveArch:  i386 i686 x86_64
27
28 # May build but untested on ppc/ppc64
29 ExcludeArch:    ppc ppc64
30
31 Requires:       spl = %{version}
32 Requires:       %{name}-kmod >= %{version}
33 Provides:       %{name}-kmod-common = %{version}
34
35 %if 0%{?rhel}%{?fedora}%{?suse_version}
36 BuildRequires:  zlib-devel
37 BuildRequires:  libuuid-devel
38 %if %{with blkid}
39 BuildRequires:  libblkid-devel
40 %endif
41 %if %{with selinux}
42 BuildRequires:  libselinux-devel
43 %endif
44 %endif
45
46 %description
47 This package contains the ZFS command line utilities and libraries.
48
49 %package devel
50 Summary:        Development headers
51 Group:          System Environment/Kernel
52 Requires:       %{name}%{?_isa} = %{version}-%{release}
53
54 %description devel
55 This package contains the header files needed for building additional
56 applications against the ZFS libraries.
57
58 %package test
59 Summary:        Test infrastructure
60 Group:          System Environment/Kernel
61 Requires:       %{name}%{?_isa} = %{version}-%{release}
62 Requires:       parted
63 Requires:       lsscsi
64 Requires:       mdadm
65 Requires:       bc
66
67 %description test
68 This package contains test infrastructure and support scripts for
69 validating the file system.
70
71 %package dracut
72 Summary:        Dracut module
73 Group:          System Environment/Kernel
74 Requires:       %{name}%{?_isa} = %{version}-%{release}
75 Requires:       dracut
76
77 %description dracut
78 This package contains a dracut module used to construct an initramfs
79 image which is ZFS aware.
80
81 %prep
82 %if %{with debug}
83     %define debug --enable-debug
84 %else
85     %define debug --disable-debug
86 %endif
87 %if %{with blkid}
88     %define blkid --with-blkid
89 %else
90     %define blkid --without-blkid
91 %endif
92 %if %{with selinux}
93     %define selinux --with-selinux
94 %else
95     %define selinux --without-selinux
96 %endif
97
98 %setup -q
99
100 %build
101 %configure \
102     --with-config=user \
103     --with-udevdir=%{_udevdir} \
104     --with-dracutdir=%{_dracutdir} \
105     --disable-static \
106     %{debug} \
107     %{blkid} \
108     %{selinux}
109 make %{?_smp_mflags}
110
111 %install
112 %{__rm} -rf $RPM_BUILD_ROOT
113 make install DESTDIR=%{?buildroot}
114 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
115
116 %post -p /sbin/ldconfig
117
118 %postun -p /sbin/ldconfig
119
120 %files
121 %doc AUTHORS COPYRIGHT DISCLAIMER
122 %doc OPENSOLARIS.LICENSE README.markdown
123 %{_sbindir}/*
124 %{_bindir}/*
125 %{_libdir}/*.so.1*
126 %{_mandir}/man1/*
127 %{_mandir}/man5/*
128 %{_mandir}/man8/*
129 %{_udevdir}/vdev_id
130 %{_udevdir}/zvol_id
131 %{_udevdir}/rules.d/*
132 %config(noreplace) %{_sysconfdir}/%{name}
133 %{_sysconfdir}/init.d/*
134
135 %files devel
136 %{_libdir}/*.so
137 %{_includedir}/*
138
139 %files test
140 %{_datadir}/%{name}
141
142 %files dracut
143 %doc dracut/README.dracut.markdown
144 %{_dracutdir}/modules.d/*
145
146 %changelog
147 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
148 - First official stable release.