3 # - please don't cleanup this chaos since official 3.4 version will be released
6 %bcond_without dist_kernel # allow non-distribution kernel
7 %bcond_with kernel # don't build kernel modules
8 %bcond_without userspace # don't build userspace programs
9 %bcond_with verbose # verbose build (V=1)
12 %undefine with_dist_kernel
15 %define origname squashfs
17 Summary: Set of tools which creates squashfs filesystem with lzma compression
18 Summary(pl.UTF-8): Zestaw narzędzi do tworzenia systemu plików squashfs z kompresją lzma
24 Source0: http://www.squashfs-lzma.org/dl/squashfs%{version}.tar.gz
25 # Source0-md5: 2a4d2995ad5aa6840c95a95ffa6b1da6
26 Source1: http://www.squashfs-lzma.org/dl/lzma457.tar.bz2
27 # Source1-md5: fc7a12a396ade1772e959604d6eb31e1
28 Source2: ftp://ftp.slax.org/source/slax/sqlzma/sqlzma3.4-457.tar.bz2
29 # Source2-md5: 0e7201a040fa9372e9b33f3abdbe19c9
30 Patch0: http://www.squashfs-lzma.org/dl/squashfs-cvsfix.patch
31 #Patch1: %{name}-not_zlib.patch
32 #Patch2: %{name}-magic.patch
33 Patch3: squashfs_lzma-2.6.25.patch
34 # extracted from sqlzma3.3-457.tar.bz2 and ported for 3.4 @ 2.6.27
35 Patch4: squashfs_lzma-sqlzma2u-3.3.patch
36 Patch5: squashfs_lzma-sqlzma2k-3.3.patch
37 Patch6: squashfs_lzma-2.6.28.patch
39 URL: http://www.squashfs-lzma.org/
40 BuildRequires: patchutils
42 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.24}
43 BuildRequires: rpmbuild(macros) >= 1.379
46 BuildRequires: libstdc++-devel
47 #BuildRequires: lzma-devel >= 4.43-5
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 This package contains utilities for squashfs filesystem with lzma
55 Squashfs is a highly compressed read-only filesystem for Linux (kernel
56 2.4.x and 2.6.x). It uses lzma compression to compress files, inodes
57 and directories. Inodes in the system are very small and all blocks
58 are packed to minimise data overhead. Block sizes greater than 4K are
59 supported up to a maximum of 64K.
61 Squashfs is intended for general read-only filesystem use, for
62 archival use (i.e. in cases where a .tar.gz file may be used), and in
63 constrained block device/memory systems (e.g. embedded systems) where
64 low overhead is needed.
66 %description -l pl.UTF-8
67 Zestaw narzędzi do tworzenia systemu plików squashfs z kompresją lzma.
69 Squashfs jest systemem plików tylko do odczytu z dużym współczynnikiem
70 kompresji dla Linuksa (jądra 2.4.x i 2.6.x). Używa kompresji lzma do
71 plików, i-węzłów oraz katalogów. I-węzły są bardzo małe, a wszystkie
72 bloki są pakowane, aby zmniejszyć objętość. Rozmiary bloków powyżej
73 4kB są obsługiwane - maksymalnie do 64kB.
75 Squashfs ma służyć jako system plików tylko do odczytu ogólnego
76 przeznaczenia, do składowania archiwów (w tych przypadkach, kiedy
77 można używać plików .tar.gz) oraz w systemach z dużymi ograniczeniami
78 pamięci i urządzeń blokowych (np. systemach wbudowanych).
80 %package -n kernel%{_alt_kernel}-fs-squashfs_lzma
81 Summary: Linux driver for lzma-compressed squashfs
82 Summary(pl.UTF-8): Sterownik dla Linuksa do squashfs skompresowanego lzma
83 Release: %{rel}@%{_kernel_ver_str}
85 Requires(post,postun): /sbin/depmod
86 %if %{with dist_kernel}
87 %requires_releq_kernel
88 Requires(postun): %releq_kernel
91 %description -n kernel%{_alt_kernel}-fs-squashfs_lzma
92 This is driver for lzma-compressed squashfs for Linux.
94 This package contains Linux module.
96 %description -n kernel%{_alt_kernel}-fs-squashfs_lzma -l pl.UTF-8
97 Sterownik dla Linuksa do squashfs skompresowanego lzma.
99 Ten pakiet zawiera moduł jądra Linuksa.
102 %setup -q -n %{origname}%{version} -a1 -a2
103 #patch0 -p1 # cvs fixes included in 3.4 source
104 #cp ~/sqlzma2u-3.3.patch .
105 #cp ~/sqlzma2k-3.3.patch .
106 %{__patch} -p1 < sqlzma1-457.patch
107 #{__patch} -p1 < sqlzma2u-3.3.patch
110 # in this patch all are new files except init/do_mounts_rd.c:
111 filterdiff -i '*/fs/squashfs/*' -i '*/include/linux/*' < kernel-patches/linux-2.6.27-rc4/squashfs3.4-patch | %{__patch} -p1
112 #{__patch} -p1 < sqlzma2k-3.3.patch
114 ln -s ../../sqlzma.h fs/squashfs
115 ln -s ../../sqmagic.h fs/squashfs
119 mv C/Compress/Lzma/kmod/* C/Compress/Lzma
120 sed -i 's@../LzmaDecode.c@LzmaDecode.c@' C/Compress/Lzma/module.c
121 ln -s ../../../sqlzma.h C/Compress/Lzma
122 #patch3 -p1 # obsoleted for 3.4@2.6.27
127 %if %{with userspace}
129 %{__make} -C C/Compress/Lzma -f sqlzma.mk Sqlzma=$topdir \
133 OPTFLAGS="%{rpmcflags}" \
134 LDFLAGS="%{rpmcflags} %{rpmldflags}"
136 %{__make} -C CPP/7zip/Compress/LZMA_Alone -f sqlzma.mk Sqlzma=$topdir \
140 OPTFLAGS="%{rpmcflags}" \
141 LDFLAGS="%{rpmcflags} %{rpmldflags}"
143 %{__make} -C squashfs-tools Sqlzma=$topdir \
144 LzmaAlone=../CPP/7zip/Compress/LZMA_Alone \
145 LzmaC=../C/Compress/Lzma \
148 DebugFlags="%{rpmcflags}"
152 %build_kernel_modules -C C/Compress/Lzma -m unlzma,sqlzma "EXTRA_CFLAGS+=-I$PWD/../../include"
153 cp C/Compress/Lzma/Module.symvers fs/squashfs
154 %build_kernel_modules -C fs/squashfs -m squashfs -c "EXTRA_CFLAGS+=-I$PWD/../../include"
155 mv fs/squashfs/squashfs{,_lzma}-dist.ko
159 rm -rf $RPM_BUILD_ROOT
161 %if %{with userspace}
162 install -d $RPM_BUILD_ROOT%{_sbindir}
163 install -p squashfs-tools/mksquashfs $RPM_BUILD_ROOT%{_sbindir}/mksquashfs_lzma
164 install -p squashfs-tools/unsquashfs $RPM_BUILD_ROOT%{_sbindir}/unsquashfs_lzma
168 %install_kernel_modules -m fs/squashfs/squashfs_lzma -d kernel/fs/squashfs
169 %install_kernel_modules -m C/Compress/Lzma/{unlzma,sqlzma} -d kernel/fs/squashfs
173 rm -rf $RPM_BUILD_ROOT
175 %post -n kernel%{_alt_kernel}-fs-squashfs_lzma
176 %depmod %{_kernel_ver}
178 %postun -n kernel%{_alt_kernel}-fs-squashfs_lzma
179 %depmod %{_kernel_ver}
181 %if %{with userspace}
183 %defattr(644,root,root,755)
184 %doc README ACKNOWLEDGEMENTS CHANGES
185 %attr(755,root,root) %{_sbindir}/*
189 %files -n kernel%{_alt_kernel}-fs-squashfs_lzma
190 %defattr(644,root,root,755)
191 # also %dir? it conflicts with standard squashfs
192 /lib/modules/%{_kernel_ver}/kernel/fs/squashfs/*lzma.ko*