ddbee84a44a32eb8fb9788de3fd782e04daef225
[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:       zfs-dracut = %{version}
33 Requires:       zfs-test = %{version}
34 Requires:       %{name}-kmod >= %{version}
35 Provides:       %{name}-kmod-common = %{version}
36
37 %if 0%{?rhel}%{?fedora}%{?suse_version}
38 BuildRequires:  zlib-devel
39 BuildRequires:  libuuid-devel
40 %if %{with blkid}
41 BuildRequires:  libblkid-devel
42 %endif
43 %if %{with selinux}
44 BuildRequires:  libselinux-devel
45 %endif
46 %endif
47
48 %description
49 This package contains the ZFS command line utilities and libraries.
50
51 %package devel
52 Summary:        Development headers
53 Group:          System Environment/Kernel
54 Requires:       %{name}%{?_isa} = %{version}-%{release}
55
56 %description devel
57 This package contains the header files needed for building additional
58 applications against the ZFS libraries.
59
60 %package test
61 Summary:        Test infrastructure
62 Group:          System Environment/Kernel
63 Requires:       %{name}%{?_isa} = %{version}-%{release}
64 Requires:       parted
65 Requires:       lsscsi
66 Requires:       mdadm
67 Requires:       bc
68
69 %description test
70 This package contains test infrastructure and support scripts for
71 validating the file system.
72
73 %package dracut
74 Summary:        Dracut module
75 Group:          System Environment/Kernel
76 Requires:       %{name}%{?_isa} = %{version}-%{release}
77 Requires:       dracut
78
79 %description dracut
80 This package contains a dracut module used to construct an initramfs
81 image which is ZFS aware.
82
83 %prep
84 %if %{with debug}
85     %define debug --enable-debug
86 %else
87     %define debug --disable-debug
88 %endif
89 %if %{with blkid}
90     %define blkid --with-blkid
91 %else
92     %define blkid --without-blkid
93 %endif
94 %if %{with selinux}
95     %define selinux --with-selinux
96 %else
97     %define selinux --without-selinux
98 %endif
99
100 %setup -q
101
102 %build
103 %configure \
104     --with-config=user \
105     --with-udevdir=%{_udevdir} \
106     --with-dracutdir=%{_dracutdir} \
107     --disable-static \
108     %{debug} \
109     %{blkid} \
110     %{selinux}
111 make %{?_smp_mflags}
112
113 %install
114 %{__rm} -rf $RPM_BUILD_ROOT
115 make install DESTDIR=%{?buildroot}
116 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
117
118 %post -p /sbin/ldconfig
119
120 %postun -p /sbin/ldconfig
121
122 %files
123 %doc AUTHORS COPYRIGHT DISCLAIMER
124 %doc OPENSOLARIS.LICENSE README.markdown
125 %{_sbindir}/*
126 %{_bindir}/*
127 %{_libdir}/*.so.1*
128 %{_mandir}/man1/*
129 %{_mandir}/man5/*
130 %{_mandir}/man8/*
131 %{_udevdir}/vdev_id
132 %{_udevdir}/zvol_id
133 %{_udevdir}/rules.d/*
134 %config(noreplace) %{_sysconfdir}/%{name}
135 %{_sysconfdir}/init.d/*
136
137 %files devel
138 %{_libdir}/*.so
139 %{_includedir}/*
140
141 %files test
142 %{_datadir}/%{name}
143
144 %files dracut
145 %doc dracut/README.dracut.markdown
146 %{_dracutdir}/modules.d/*
147
148 %changelog
149 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
150 - First official stable release.