Update to latest libtool.
[minipack.git] / mp-unpack-source
blobb17d50e8869716c72acf8cce175ef94fc38e153b
1 #! /bin/sh
2 . mp-functions
4 unpack_source()
6 : ${source_package_type:=tar.gz}
7 : ${source:=$name-$version.$source_package_type}
8 : ${top_srcdir:=$name-$version}
10 sourcename=$sourcedir/$source
12 if [ ! -e $sourcename ]; then
13 echo >&2 "Could not find source for $name"
14 exit 1
17 buildroot=$builddir/$name-$version-$release
19 if [ ! -d $buildroot ]; then
20 mkdir $buildroot
23 cd $buildroot
25 if [ -d $top_srcdir ]; then
26 echo "source already unpacked"
27 exit
30 tar -zxf $sourcename
32 if [ $? != 0 ]; then
33 echo >&2 "Failed to unpack $sourcename"
34 exit 1
37 cd ${top_srcdir}
39 pkg_patchdir=$patchdir/$name
41 if [ -d $pkg_patchdir ]; then
42 find $pkg_patchdir -name '*.patch' -exec patch -p1 -i '{}' \;
45 src_prep
49 src_prep()
51 do_prep
54 do_prep()
59 if [ -z "$1" ]; then
60 echo "Usage: $0 package-name ..."
61 exit 1
63 name=$1
65 . $(get_recipe_name $name)
67 unpack_source