wok-next diff squashfs/receipt @ rev 2991

Up squashfs (4.0)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 11 19:12:26 2009 +0200 (2009-05-11)
parents 4e225981004f
children 214c9590a5e5
line diff
     1.1 --- a/squashfs/receipt	Sun Mar 29 11:34:34 2009 +0000
     1.2 +++ b/squashfs/receipt	Mon May 11 19:12:26 2009 +0200
     1.3 @@ -1,198 +1,31 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="squashfs"
     1.7 -VERSION="3.3"
     1.8 +VERSION="4.0"
     1.9  CATEGORY="base-system"
    1.10  SHORT_DESC="Linux squashfs userland tools."
    1.11  MAINTAINER="pascal.bellard@slitaz.org"
    1.12  WEB_SITE="http://$PACKAGE.sourceforge.net/"
    1.13 -TARBALL="squashfs$VERSION.tgz"
    1.14 +TARBALL="squashfs$VERSION.tar.gz"
    1.15  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.16 -DEPENDS="zlib squashfs-module"
    1.17 -BUILD_DEPENDS="zlib-dev patch lzma"
    1.18 +DEPENDS="zlib"
    1.19 +BUILD_DEPENDS="zlib-dev"
    1.20  PROVIDE="cromfs-or-squashfs"
    1.21 -CONFIG_FILES="/etc/filesystems"
    1.22 -
    1.23 -# Download a source tarball
    1.24 -. /etc/tazwok.conf
    1.25 -slitaz_wget()
    1.26 -{
    1.27 -	if [ ! -f $SOURCES_REPOSITORY/$(basename $2) ]; then
    1.28 -		local here=$(pwd)
    1.29 -		cd $SOURCES_REPOSITORY
    1.30 -		wget $1 $2
    1.31 -		cd $here
    1.32 -	fi
    1.33 -	cp $SOURCES_REPOSITORY/$(basename $2) .
    1.34 -}
    1.35  
    1.36  # Rules to configure and make the package.
    1.37  compile_rules()
    1.38  {
    1.39 -	local kver
    1.40 -	local patch_dir
    1.41 +	mv ${PACKAGE}${VERSION} $src 2> /dev/null
    1.42  
    1.43 -	if [ -L $(which patch) ]; then
    1.44 -		echo "Please reinstall patch !"
    1.45 -		return 1
    1.46 -	fi
    1.47 -	mkdir -p $src
    1.48 -	cd $src
    1.49 -	mv ../$PACKAGE$VERSION . 2> /dev/null
    1.50 -	# get kernel version
    1.51 -	if [ ! -d $WOK/linux/taz ]; then
    1.52 -		tazwok cook linux
    1.53 -	fi
    1.54 -	kver=$(grep "kernel version" $WOK/linux/$(ls $WOK/linux/taz)/.config)
    1.55 -	kver=${kver##* }
    1.56 -
    1.57 -	# Select patch according to kernel version
    1.58 -	patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-${kver%.*}
    1.59 -	i=${patch_dir##*.}
    1.60 -	while [ ! -d ${patch_dir%.*}.$i ]; do
    1.61 -		[ "$i" = "0" ] && break
    1.62 -		i=$(($i - 1))
    1.63 -	done
    1.64 -	patch_dir=${patch_dir%.*}.$i
    1.65 -	if [ -d ${PACKAGE}${VERSION}/kernel-patches/linux-$kver ]; then
    1.66 -		patch_dir=${PACKAGE}${VERSION}/kernel-patches/linux-$kver
    1.67 -	fi
    1.68 -	if [ ! -d $patch_dir ]; then
    1.69 -		echo "No squashfs patchset for kernel $ker. Abort."
    1.70 -		return 1
    1.71 -	fi
    1.72 -	[ -d _kernel ] && rm -rf _kernel
    1.73 -	mkdir _kernel
    1.74 -	cd _kernel
    1.75 -	ln -fs $WOK/linux/linux-$kver* src
    1.76 -
    1.77 -	# Copy files to be patched in local aera
    1.78 -	# Do not alter kernel sources !!
    1.79 -	for i in $(grep ^--- ../$patch_dir/${PACKAGE}${VERSION}-patch | \
    1.80 -    		awk '{ if ($3 != "1970-01-01") print $2 } '); do
    1.81 -		( cd src ; tar cf - ${i#*/}) | tar xf -
    1.82 -	done
    1.83 -
    1.84 -	# Apply squashfs patches in local aera
    1.85 -	#patch -p1 < ../$patch_dir/${PACKAGE}${VERSION}-patch
    1.86 -	echo "Apply $patch_dir..."
    1.87 -	awk 'BEGIN { keep=1} /^---/ { keep=(index($0,"/fs/squashfs/") || index($0,"/include/linux/"))} { if (keep) print }' < \
    1.88 -		../$patch_dir/${PACKAGE}${VERSION}-patch | patch -p1
    1.89 -
    1.90 -	extra_patch=../stuff/squashfs-patch-${kver%.*}
    1.91 -	if [ -e ../$extra_patch ]; then
    1.92 -		echo "Apply $extra_patch..."
    1.93 -		patch -p1 < ../$extra_patch || return 1
    1.94 -	fi
    1.95 -
    1.96 -	# Move every files in fs/squashfs directory
    1.97 -	mv include/linux/* fs/squashfs
    1.98 -	rmdir include/linux
    1.99 -	ln -s ../fs/squashfs include/linux
   1.100 -	ln -s . fs/squashfs/linux
   1.101 -	for i in fs/squashfs/*.c fs/squashfs/*.h ; do
   1.102 -		sed -i 's/#include <\(linux\/squashfs.*\)>.*/#include "\1"/g' $i
   1.103 -		sed -i 's/CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE/3/g' $i
   1.104 -	done
   1.105 -	
   1.106 -	# Apply lzma patches
   1.107 -	cd ..
   1.108 -	slitaz_wget -c $SF_MIRROR/sevenzip/lzma457.tar.bz2
   1.109 -	tar xjf lzma457.tar.bz2
   1.110 -	SQLZMA=ftp://ftp.slax.org/source/slax/sqlzma/old-versions-unsupported
   1.111 -	slitaz_wget -c $SQLZMA/sqlzma457-1/sqlzma3.3-457.tar.bz2
   1.112 -	tar xjf sqlzma3.3-457.tar.bz2
   1.113 -	rm -f $(grep ^+++ sqlzma1-449.patch | awk '{ print $2 }' | \
   1.114 -		sed 's|[^/]*/||') 2> /dev/null
   1.115 -	patch -p1 < sqlzma1-449.patch || return 1
   1.116 -	patch -p0 << EOT
   1.117 ---- _kernel/fs/squashfs/inode.c
   1.118 -+++ _kernel/fs/squashfs/inode.c
   1.119 -@@ -2153 +2153 @@
   1.120 --	printk(KERN_INFO "squashfs: version 3.3-CVS (2008/04/04) "
   1.121 -+	printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) "
   1.122 -@@ -2216 +2216 @@
   1.123 --MODULE_DESCRIPTION("squashfs 3.3, a compressed read-only filesystem");
   1.124 -+MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem");
   1.125 -
   1.126 ---- _kernel/fs/squashfs/squashfs_fs_sb.h
   1.127 -+++ _kernel/fs/squashfs/squashfs_fs_sb.h
   1.128 -@@ -26 +26 @@
   1.129 --#include "linux/squashfs_fs.h"
   1.130 -+#include <linux/squashfs_fs.h>
   1.131 -EOT
   1.132 -	( cd _kernel ; patch -p1 ) < sqlzma2k-3.3.patch || return 1
   1.133 -	patch -p0 << EOT
   1.134 ---- _kernel/fs/squashfs/squashfs_fs_sb.h
   1.135 -+++ _kernel/fs/squashfs/squashfs_fs_sb.h
   1.136 -@@ -26 +26 @@
   1.137 --#include <linux/squashfs_fs.h>
   1.138 -+#include "linux/squashfs_fs.h"
   1.139 -EOT
   1.140 -	cp sq*.h _kernel/fs/squashfs
   1.141 -	grep -q "sqlzma.h" squashfs3.3/squashfs-tools/mksquashfs.c ||
   1.142 -	patch -p0 << EOT
   1.143 ---- squashfs3.3/squashfs-tools/unsquashfs.c
   1.144 -+++ squashfs3.3/squashfs-tools/unsquashfs.c
   1.145 -@@ -326,2 +326,3 @@
   1.146 --		if((res = uncompress((unsigned char *) block, &bytes,
   1.147 --		(const unsigned char *) buffer, c_byte)) != Z_OK) {
   1.148 -+		res = uncompress((unsigned char *) block, &bytes, (const unsigned char *) buffer, c_byte);
   1.149 -+
   1.150 -+		if(res != Z_OK) {
   1.151 -@@ -365,2 +366,3 @@
   1.152 --		if((res = uncompress((unsigned char *) block, &bytes,
   1.153 --		(const unsigned char *) data, c_byte)) != Z_OK) {
   1.154 -+		res = uncompress((unsigned char *) block, &bytes, (const unsigned char *) data, c_byte);
   1.155 -+
   1.156 -+		if(res != Z_OK) {
   1.157 -EOT
   1.158 -	grep -q "sqlzma.h" squashfs3.3/squashfs-tools/mksquashfs.c ||
   1.159 -	patch -p0 < sqlzma2u-3.3.patch || return 1
   1.160 -	export LzmaC=$PWD/C/Compress/Lzma
   1.161 -	export LzmaAlone=$PWD/CPP/7zip/Compress/LZMA_Alone
   1.162 -	export Sqlzma=$PWD/_kernel/fs/squashfs
   1.163 -	for i in $LzmaC $LzmaAlone ; do
   1.164 -		make -C $i -f sqlzma.mk || return 1
   1.165 -	done
   1.166 -	rm -f $LzmaC/kmod/uncomp.c 2> /dev/null
   1.167 -	make -C $LzmaC KDir=$PWD/_kernel/src/. -f kmod.mk || return 1
   1.168 -	cp $LzmaC/kmod/Module.symvers $Sqlzma
   1.169 -	
   1.170 -	# Build kernel squashfs module
   1.171 -	cd _kernel
   1.172 -	make -C src/. SUBDIRS=$(pwd)/fs/squashfs/ CONFIG_SQUASHFS=m modules || return 1
   1.173 -	cd ..
   1.174 -	[ -d _pkg ] && rm -rf _pkg
   1.175 -	mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs
   1.176 -	mkdir -p _pkg/usr/sbin _pkg/sbin
   1.177 -	find . -name "*.ko" | while read module; do
   1.178 -		lzma e $module _pkg/lib/modules/$kver-slitaz/kernel/fs/squashfs/$(basename $module).gz
   1.179 -	done
   1.180 -
   1.181 -	# Build user land tools
   1.182 -	cd ${PACKAGE}${VERSION}/squashfs-tools
   1.183 +	cd $src/squashfs-tools
   1.184 +	mkdir -p ../_pkg/usr/sbin ../_pkg/sbin
   1.185  	make || return 1
   1.186 -	cp mksquashfs ../../_pkg/usr/sbin
   1.187 -	cp unsquashfs ../../_pkg/sbin
   1.188 +	cp mksquashfs ../_pkg/usr/sbin
   1.189 +	cp unsquashfs ../_pkg/sbin
   1.190  }
   1.191  
   1.192  # Rules to gen a SliTaz package suitable for Tazpkg.
   1.193  genpkg_rules()
   1.194  {
   1.195 -	mkdir $fs/etc
   1.196 -	touch $fs/etc/filesystems
   1.197  	cp -a $_pkg/usr $_pkg/sbin $fs
   1.198  }
   1.199 -
   1.200 -# Pre remove and post install commands for Tazpkg.
   1.201 -pre_remove()
   1.202 -{
   1.203 -	sed -i '/^$PACKAGE$/d' $1/etc/filesystems
   1.204 -}
   1.205 -
   1.206 -post_install()
   1.207 -{
   1.208 -	grep -qs ^$PACKAGE$ $1/etc/filesystems || \
   1.209 -		echo "$PACKAGE" >> $1/etc/filesystems
   1.210 -}