wok rev 10638

linux-libre: Fixed to only use tazwok if cook doesn't exist. Fixed also some typos.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu May 26 18:26:21 2011 +0000 (2011-05-26)
parents 7d021a3625d2
children 16413729582c
files linux-libre/receipt
line diff
     1.1 --- a/linux-libre/receipt	Fri May 27 00:23:00 2011 +0200
     1.2 +++ b/linux-libre/receipt	Thu May 26 18:26:21 2011 +0000
     1.3 @@ -4,8 +4,6 @@
     1.4  VERSION="2.6.37-libre"
     1.5  CATEGORY="base-system"
     1.6  SHORT_DESC="The Linux Libre kernel and modules."
     1.7 -DEPENDS="depmod"
     1.8 -BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
     1.9  MAINTAINER="gokhlayeh@slitaz.org"
    1.10  PROVIDE="linux"
    1.11  SOURCE="linux"
    1.12 @@ -14,30 +12,48 @@
    1.13  WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL"
    1.14  CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
    1.15  
    1.16 +DEPENDS="depmod"
    1.17 +BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
    1.18 +
    1.19  # Rules to configure and make the package.
    1.20  compile_rules()
    1.21  {
    1.22 -
    1.23 +	cd $src
    1.24  	# this is code to help update the kernel version faster
    1.25  	#for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
    1.26  	#do
    1.27  	#	sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
    1.28  	#done
    1.29 +	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report open-bloc
    1.30  
    1.31 +	# Check for Aufs and cook it if unbuilt.
    1.32 +	echo "Checking for Aufs packages..."
    1.33  	_AUFSVER=`grep  ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
    1.34 -	AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER}
    1.35 -	if [ -x /usr/bin/tazwok ]; then
    1.36 +	if [ -x /usr/bin/cook ]; then
    1.37 +		# Give info an redirect to /dev/null since aufs got it own log.
    1.38 +		AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}
    1.39 +		[ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
    1.40 +		echo "Cook: aufs $_AUFSVER"
    1.41 +		cook aufs > /dev/null
    1.42 +	elif [ -x /usr/bin/tazwok ]; then
    1.43 +		# we just need aufs source. Also cooking now is a bad idea since it
    1.44 +		# needs linux-module-headers. The one your cooking not the one from the web.
    1.45 +		AUFSDIR=$WOK/aufs/aufs-${_AUFSVER}
    1.46 +		[ -d "$AUFSDIR" ] && rm -rf $AUFSDIR
    1.47  		tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
    1.48  	fi
    1.49 +	
    1.50 +	echo "Copying Aufs files and patches..."
    1.51  	cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
    1.52 -	cp -a $AUFSDIR/*.patch $WOK/$PACKA$stuff
    1.53 -	cd $src
    1.54 +	cp -a $AUFSDIR/*.patch $stuff
    1.55 +
    1.56  	# SliTaz db
    1.57  	[ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
    1.58  	mkdir $WOK/$PACKAGE/slitaz
    1.59  	echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
    1.60  	cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
    1.61  	cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
    1.62 +	
    1.63  	# Apply patches
    1.64  	echo "Applying patches"
    1.65  	while read patch_file; do
    1.66 @@ -48,7 +64,11 @@
    1.67  			continue
    1.68  		fi
    1.69  		echo "Apply $patch_file"
    1.70 -		patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || exit 1
    1.71 +		if [ -x /usr/bin/cook ]; then
    1.72 +			patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || return 1
    1.73 +		elif [ -x /usr/bin/tazwok ]; then
    1.74 +			patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
    1.75 +		fi
    1.76  		touch done.$patch_file
    1.77  	done <<EOT
    1.78  $PACKAGE-diff-$VERSION.u
    1.79 @@ -63,43 +83,53 @@
    1.80  004-squashfs-add-xz-compression-support.patch
    1.81  005-squashfs-add-xz-compression-configuration-option.patch
    1.82  EOT
    1.83 -	echo "Make kernel proper and then build lguest"
    1.84 +	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
    1.85 +	
    1.86  	make mrproper
    1.87  	cd Documentation/lguest
    1.88 -	make lguest || exit 1
    1.89 +	if [ -x /usr/bin/cook ]; then
    1.90 +		make lguest || return 1
    1.91 +	elif [ -x /usr/bin/tazwok ]; then
    1.92 +		make lguest || { report close-bloc; return 1; }
    1.93 +	fi
    1.94  	cd $src
    1.95  
    1.96 -	echo "Make bzImage without modules first"
    1.97 +	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
    1.98 +	
    1.99  	# Build bzImage without modules first
   1.100  	cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
   1.101  	sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
   1.102 +	
   1.103  	# We can't keep every driver in staging 
   1.104  	sed -i -e 's/^CONFIG_RTL8192/#&/' \
   1.105  	       -e 's/^CONFIG_R8187SE/#&/' \
   1.106  	       -e 's/^CONFIG_RT2870/#&/' .config
   1.107  	yes '' | make oldconfig
   1.108 -	make -j 4 bzImage ||exit 1
   1.109 -	[ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
   1.110 -	mv arch/x86/boot/bzImage $PWD/_pkg
   1.111 +	make -j 4 bzImage || { report close-bloc; return 1; }
   1.112 +	[ -d $DESTDIR ] || mkdir -p $DESTDIR
   1.113 +	mv arch/x86/boot/bzImage $DESTDIR
   1.114  	mv System.map System.map-without-modules
   1.115  
   1.116 -	echo "Now build bzImage with modules"
   1.117 +	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report step "Now build bzImage with modules"
   1.118 +	
   1.119  	# Build bzImage with modules
   1.120  	cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
   1.121  	make oldconfig
   1.122  	ln .config $WOK/$PACKAGE/slitaz/config
   1.123  	make -j 4 bzImage &&
   1.124  	make -j 4 modules &&
   1.125 -	make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
   1.126 -	make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
   1.127 -	
   1.128 -	mkdir -p $PWD/_pkg/boot 2> /dev/null
   1.129 -	mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
   1.130 +	make INSTALL_MOD_PATH=$DESTDIR modules_install &&
   1.131 +	make INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
   1.132 +	#[ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
   1.133 +	mkdir -p $DESTDIR/boot 2> /dev/null
   1.134 +	mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
   1.135 +
   1.136  	# Compress all modules.
   1.137  	echo "Compressing all modules"
   1.138 -	$stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
   1.139 +	$stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
   1.140  	ln System.map System.map-modules
   1.141  	ln Module.symvers Module.symvers-modules
   1.142 +	[ -x /usr/bin/tazwok -a ! -x /usr/bin/cook ] && report close-bloc
   1.143  }
   1.144  
   1.145  # Rules to gen a SliTaz package suitable for Tazpkg.
   1.146 @@ -117,8 +147,8 @@
   1.147      export src
   1.148      export _pkg
   1.149      mkdir $WOK/$PACKAGE/tmp
   1.150 -    $WOK/$PACKA$stuff/list_modules.sh \
   1.151 -	$(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
   1.152 +    $stuff/list_modules.sh \
   1.153 +	$(cat $stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
   1.154      while read module; do
   1.155      	dir=$(dirname $module)
   1.156      	[ -d $path/$dir ] || mkdir -p $path/$dir