diff options
author | Brian Behlendorf <[email protected]> | 2009-03-05 09:08:07 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-03-09 15:56:55 -0700 |
commit | c5f704607bbdc5e6a89b4ac088dff16a6c1eeb5e (patch) | |
tree | 182cb70d67bde33e9697623ca0b0533985407528 /spl.spec.in | |
parent | 32f74c5280ca9a753991b97370e7c4c1a4e34ede (diff) |
Build system and packaging (RPM support)
An update to the build system to properly support all commonly
used Makefile targets these include:
make all # Build everything
make install # Install everything
make clean # Clean up build products
make distclean # Clean up everything
make dist # Create package tarball
make srpm # Create package source RPM
make rpm # Create package binary RPMs
make tags # Create ctags and etags for everything
Extra care was taken to ensure that the source RPMs are fully
rebuildable against Fedora/RHEL/Chaos kernels. To build binary
RPMs from the source RPM for your system simply run:
rpmbuild --rebuild spl-x.y.z-1.src.rpm
This will produce two binary RPMs with correct 'requires'
dependencies for your kernel. One will contain all spl modules
and support utilities, the other is a devel package for compiling
additional kernel modules which are dependant on the spl.
spl-x.y.z-1_<kernel version>.x86_64.rpm
spl-devel-x.y.2-1_<kernel version>.x86_64.rpm
Diffstat (limited to 'spl.spec.in')
-rw-r--r-- | spl.spec.in | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/spl.spec.in b/spl.spec.in new file mode 100644 index 000000000..3090ba710 --- /dev/null +++ b/spl.spec.in @@ -0,0 +1,104 @@ +# The following block is used to allow the source RPM to be rebuilt +# against arbitrary kernels. It ensure the release name is correct +# and the proper build/install requires are set. +%if 0%{?require_kver:1} +%define kver %{require_kver} +%else +%define _kdir %((echo X; ls -1d /usr/src/kernels/* /usr/src/linux-* 2>/dev/null)|sed -e 's/linux-//' | tail -1) +%define kver %(basename %{_kdir}) +%endif + +# Each distro has its own kernel package naming convention. +%if 0%{?ch4} +%define kstr chaos-kernel +%define kdev chaos-kernel-devel +%define kdir /usr/src/kernels/%{kver} +%else +%define kstr kernel +%define kdev kernel-devel +%define kdir /usr/src/kernels/%{kver} +%endif + +%define debug_package %{nil} + +# The kernel version should only be appended to a binary RPM. +# When building a source RPM it must be kernel version agnostic. +%define name @PACKAGE@ +%define version @VERSION@ + +%if %{?build_src_rpm:1}0 +%define release @SPL_META_RELEASE@ +%else +%define release @SPL_META_RELEASE@_%(echo %{kver} | sed -e 's/-/_/g') +%endif + +%if 0%{?require_kver:1} +%define buildrequires %{kdev}=%{kver} +%else +%define buildrequires %{kdev} +%endif + +Summary: Solaris Porting Layer +Group: Utilities/System +Name: %{name} +Version: %{version} +Release: %{release} +License: GPL +URL: git://eris.llnl.gov/spl.git +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n) +Source: %{name}-%{version}.tar.gz +Requires: %{kstr} = %{kver} +BuildRequires: %{buildrequires} + +%description +The %{name} package contains kernel modules and support utilities for +emulating Solaris style primatives in the linux kernel. These include, +but are not limited too, atomic, condvar, debug, error, memory, kobject, +kstat, mutex, rwlock, taskq, thread, time, and vnode APIs. + +%package devel +Summary: Solaris Porting Layer Headers and Symbols +Group: Development/Libraries +Requires: %{kstr} = %{kver} +BuildRequires: %{buildrequires} + +%description devel +The %{name}-devel package contains the header files and Module.symvers +symbols needed for building additional modules which use %{name}. + +%prep +%setup +%build +%configure --includedir=%{kdir}/include/spl --with-linux=%{kdir} +make + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) +%doc AUTHORS ChangeLog COPYING DISCLAIMER INSTALL +%{_sbindir}/* +/lib/modules/* + +%files devel +%defattr(-,root,root) +%{kdir}/include/spl/* + +%post +if [ -f /boot/System.map-%{kver} ]; then + depmod -ae -F /boot/System.map-%{kver} %{kver} || exit 0 +else + depmod -ae %{kver} || exit 0 +fi + +%postun +if [ -f /boot/System.map-%{kver} ]; then + depmod -ae -F /boot/System.map-%{kver} %{kver} || exit 0 +else + depmod -ae %{kver} || exit 0 +fi |