diff --git a/packaging/dist_pk.fish b/packaging/dist_pk.fish index 4dd6202..9a2ef74 100755 --- a/packaging/dist_pk.fish +++ b/packaging/dist_pk.fish @@ -12,42 +12,52 @@ require logging -set scr_dir (dirname (status -f)) +set scr_dir (realpath (dirname (status -f))) set scm 'git://github.com/blt4linux/blt4l.git' +set -q git_name; or set git_name master + info packaging! function chr_bld -a chroot_name info building $chroot_name - - set chroot_home $HOME - set pkbase $chroot_home/blt4l/ - set pkdir /var/chroots/$chroot_name/$pkbase/packaging - function chdo -S + + set chroot_data $scr_dir/chroot_data/$chroot_name/ + set pkbase $chroot_data/blt + set pkbin $chroot_data/bin + + test -d $chroot_data; or mkdir -p $chroot_data + test -d $pkbin; or mkdir -p $pkbin + + info "chroot data in $chroot_data" + info "repo base in $pkbase" + info "repo bin in $pkbin" + + function chgit -S info "($chroot_name) $argv" schroot --directory $pkbase -c $chroot_name -- $argv end # Remove repo - if [ -d /var/chroots/$chroot_name/$pkbase ] - chdo rm -rf $pkbase/.git - chdo rm -r $pkbase + if [ -d $pkbase ] + rm -rf $pkbase/.git + rm -r $pkbase end # Remove build dir - if [ -d $pkdir/package_build ] - rm -r $pkdir/package_build + if [ -d $pkbin ] + rm -r $pkbin end - + info checking out blt4l begin - if schroot --directory $chroot_home -c $chroot_name -- git clone --recursive $scm $pkbase - if chdo git checkout (chdo git tag | sort -V | tail -1) + if schroot --directory $chroot_data -c $chroot_name -- git clone --recursive $scm $pkbase + if chgit git checkout $git_name # Run build - if schroot --directory $pkbase/packaging -c $chroot_name ./package.sh + if schroot --directory $pkbase/packaging -c $chroot_name -- env BUILD_DIR="$pkbin" ./package.sh # Move artifacts out of chroot - mv $pkdir/*.tar.xz $scr_dir/ ^/dev/null + mv $pkbin/*.tar.xz $scr_dir/ ^/dev/null else error build in $chroot_name failed end @@ -63,10 +73,11 @@ end cd $scr_dir -chr_bld ubuntu_trusty -# chr_bld ubuntu_precise # steamrt +chr_bld ubuntu_precise # steamrt +chr_bld fc26 set -x CMAKE_CXX_COMPILER (which g++4.8) set -x CMAKE_C_COMPILER (which gcc-4.8) ./package.sh +cp ./package_build/*.xz .