File squashfs.spec of Package squashfs

#
# spec file for package squashfs (Version 3.1)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define rver 3.1-r2

# Commandline: 
Name:           squashfs
BuildRequires:  kernel-source kernel-syms
License:        GNU General Public License (GPL) - all versions
Group:          System/Filesystems
Version:        3.1r2
Release:        1
Source0:        %{name}%{rver}.tar.gz
Patch:          squashfs-retval.patch
URL:            http://squashfs.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        A Read-Only File System with Efficient Compression
%suse_kernel_module_package kdump um

%description
This package contains the userland utilities to create and read
squashfs images.



Authors:
--------
    Phillip Lougher

%debug_package
%package KMP
Group:          System/Filesystems
Summary:        Kernel modules for the read-only file system with efficient compression

%description KMP
This package contains the necessary kernel modules to use the "squash"
file system transparently.



Authors:
--------
    Phillip Lougher

%prep
%setup -n %{name}%{rver}
%patch
# turn patch into plain sources :-/
patch -f -p2 < linux-2.6.16/squashfs3.1-patch || true
mv linux squashfs/.
echo '#define CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE 3' >> squashfs/squashfs.h

%build
make -C squashfs-tools \
	CFLAGS="-I. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $RPM_OPT_FLAGS"
mkdir source obj
# cp -r squashfs/*  source/
export CONFIG_SQUASHFS=m
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r squashfs obj/$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	 M=$PWD/obj/$flavor
done

%install
[ "$RPM_BUILD_ROOT" != "" -a -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p $RPM_BUILD_ROOT/usr/bin
cp -p squashfs-tools/*squashfs $RPM_BUILD_ROOT/usr/bin
export CONFIG_SQUASHFS=m
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=kernel/fs
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
	 M=$PWD/obj/$flavor
done

%clean
[ "$RPM_BUILD_ROOT" != "" -a -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;

%files
%defattr(-,root,root)
%doc README CHANGES README-3.1 PERFORMANCE.README
/usr/bin/*squashfs

%changelog -n squashfs
* Wed Oct 25 2006 - pzb@novell.com
- update to 3.1-r2
- backport to SLE10
* Mon Aug 21 2006 - ro@suse.de
- update to version 3.1 to fix build on 2.6.18
* Thu May 11 2006 - duwe@suse.de
- packaged current version for SuSE Linux.
openSUSE Build Service is sponsored by