3 # hdw - linux ./scripts/Create-Binary
5 # this script is used to create the binary packages
14 all) package=all ; shift 1 ;;
15 -package) package=$2 ; shift 2 ;;
16 -tar-name) tar_name=$2 ; shift 2 ;;
17 -root) my_root=$2 ; shift 2 ;;
19 echo "usage: $0 -package <package> -tar-name <tarname> -root <root>"
25 if [ -z "$package" ] ; then
26 echo "no package specified"
30 # how to call the packaged tar file (no .tar.bz2 ending!)
31 [ -z "$tar_name" ] && tar_name="$package"
33 # get Config & set hdw_home_dir
34 . ./Config && hdw_home_dir=`pwd`
37 [ ! -z "$my_root" ] && hdw_build_dir="$my_root"
39 # create binary directory
40 if [ ! -z "$hdw_arch_opt" ]; then
41 bin_dir=${hdw_arch}-${hdw_arch_opt}
43 bin_dir=${hdw_arch}-generic
45 pkg_dir=`echo $package | sed 's%-[0-9].%%'`
46 pkg_dir=`echo $pkg_dir | sed 's%-[0-9]%%'`
47 mkdir -p binaries/$bin_dir
50 if [ "$package" != "all" ] ; then
51 if [ -d ./binaries/$bin_dir/${pkg_dir} ] ; then
52 echo "$package binary already exists, skipped"
53 echo "(remove ./binaries/$bin_dir/${pkg_dir} to recreate it)"
57 if [ ! -f $hdw_build_dir/var/adm/flists/$package ] ; then
58 echo "package not build (moved flist file?)"
61 echo "creating binary tarball of $package"
62 mkdir -p $hdw_home_dir/binaries/$bin_dir/${pkg_dir} &&
64 # which files do we need?
65 fl_file="var/adm/flists/$package"
66 cat $fl_file | awk '{ print $2 }' | \
67 tar --no-recursion --use-compress-program=bzip2 \
68 -cf $hdw_home_dir/binaries/$bin_dir/${pkg_dir}/$tar_name.tar.bz2 \
70 cp $hdw_build_dir/var/adm/flists/$package \
71 $hdw_home_dir/binaries/$bin_dir/${pkg_dir}
77 elif [ "$package" = "all" ] ; then
80 for pkg in `ls -A $hdw_build_dir/var/adm/flists | grep -v '.stage'`; do
81 tar_name=`echo $pkg | awk -F- '{ print $1 }'`
82 ./scripts/Create-Binary -package $pkg -root $hdw_build_dir \
87 # add 00-dirtree, build in stage1
88 ./scripts/Create-Binary -package 00-dirtree.stage0-0 -tar-name 00-dirtree
91 echo "created $counter binaries, done"