]> git.pld-linux.org Git - SPECS.git/blob - squashfs_lzma.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / squashfs_lzma.spec
1 #
2 # NOTE: 
3 # - please don't cleanup this chaos since official 3.4 version will be released
4 #
5 # Conditional build:
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)
10
11 %if %{without kernel}
12 %undefine       with_dist_kernel
13 %endif
14
15 %define         origname        squashfs
16 %define         rel     1
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
19 Name:           squashfs_lzma
20 Version:        3.4
21 Release:        %{rel}
22 License:        GPL
23 Group:          Base/Utilities
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
38 Patch7:         libm.patch
39 URL:            http://www.squashfs-lzma.org/
40 BuildRequires:  patchutils
41 %if %{with kernel}
42 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.24}
43 BuildRequires:  rpmbuild(macros) >= 1.379
44 %endif
45 %if %{with userspace}
46 BuildRequires:  libstdc++-devel
47 #BuildRequires: lzma-devel >= 4.43-5
48 %endif
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 This package contains utilities for squashfs filesystem with lzma
53 compression.
54
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.
60
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.
65
66 %description -l pl.UTF-8
67 Zestaw narzędzi do tworzenia systemu plików squashfs z kompresją lzma.
68
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.
74
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).
79
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}
84 Group:          Base/Kernel
85 Requires(post,postun):  /sbin/depmod
86 %if %{with dist_kernel}
87 %requires_releq_kernel
88 Requires(postun):       %releq_kernel
89 %endif
90
91 %description -n kernel%{_alt_kernel}-fs-squashfs_lzma
92 This is driver for lzma-compressed squashfs for Linux.
93
94 This package contains Linux module.
95
96 %description -n kernel%{_alt_kernel}-fs-squashfs_lzma -l pl.UTF-8
97 Sterownik dla Linuksa do squashfs skompresowanego lzma.
98
99 Ten pakiet zawiera moduł jądra Linuksa.
100
101 %prep
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
108 %patch4 -p1
109
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
113 %patch5 -p1
114 ln -s ../../sqlzma.h fs/squashfs
115 ln -s ../../sqmagic.h fs/squashfs
116
117 #%patch1 -p1
118 #%patch2 -p1
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
123 %patch6 -p1
124 %patch7 -p1
125
126 %build
127 %if %{with userspace}
128 topdir=$(pwd)
129 %{__make} -C C/Compress/Lzma -f sqlzma.mk Sqlzma=$topdir \
130         CXX="%{__cxx}" \
131         CXX_C="%{__cc}" \
132         CC="%{__cc}" \
133         OPTFLAGS="%{rpmcflags}" \
134         LDFLAGS="%{rpmcflags} %{rpmldflags}"
135
136 %{__make} -C CPP/7zip/Compress/LZMA_Alone -f sqlzma.mk Sqlzma=$topdir \
137         CXX="%{__cxx}" \
138         CXX_C="%{__cc}" \
139         CC="%{__cc}" \
140         OPTFLAGS="%{rpmcflags}" \
141         LDFLAGS="%{rpmcflags} %{rpmldflags}"
142
143 %{__make} -C squashfs-tools Sqlzma=$topdir \
144         LzmaAlone=../CPP/7zip/Compress/LZMA_Alone \
145         LzmaC=../C/Compress/Lzma \
146         CC="%{__cc}" \
147         CXX="%{__cxx}" \
148         DebugFlags="%{rpmcflags}"
149 %endif
150
151 %if %{with kernel}
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
156 %endif
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160
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
165 %endif
166
167 %if %{with kernel}
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
170 %endif
171
172 %clean
173 rm -rf $RPM_BUILD_ROOT
174
175 %post   -n kernel%{_alt_kernel}-fs-squashfs_lzma
176 %depmod %{_kernel_ver}
177
178 %postun -n kernel%{_alt_kernel}-fs-squashfs_lzma
179 %depmod %{_kernel_ver}
180
181 %if %{with userspace}
182 %files
183 %defattr(644,root,root,755)
184 %doc README ACKNOWLEDGEMENTS CHANGES
185 %attr(755,root,root) %{_sbindir}/*
186 %endif
187
188 %if %{with kernel}
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*
193 %endif
This page took 0.059573 seconds and 3 git commands to generate.