OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: target/reference/build.sh
  5. # Copyright (C) 2007 - 2008 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. build_result="$build_toolchain/result"
  16. pkgloop_action() {
  17. # Rebuild command line without '$cmd_maketar'
  18. #
  19. cmd_buildpkg="./scripts/Build-Pkg -$stagelevel -cfg $config"
  20. cmd_buildpkg="$cmd_buildpkg $cmd_root $cmd_prefix $pkg_name"
  21. # Build package
  22. #
  23. $cmd_buildpkg ; rc=$?
  24. # Copy *.cache file
  25. #
  26. if [ -f "$build_root/var/adm/cache/$pkg_name" ] ; then
  27. dir="$build_result/package/$pkg_tree/$pkg_name" ; mkdir -p $dir
  28. cp $build_root/var/adm/cache/$pkg_name $dir/$pkg_name.cache
  29. fi
  30. return $rc
  31. }
  32. pkgloop
  33. echo_header "Finishing build."
  34. mkdir -p "$build_result/scripts"
  35. echo_status "Copying error logs and sde-debug data."
  36. mkdir -p $build_result/{errors,sde-debug,dep-debug}
  37. cp $build_root/var/adm/sde-debug/* $build_result/sde-debug/
  38. cp $build_root/var/adm/dep-debug/* $build_result/dep-debug/
  39. cp $build_root/var/adm/logs/*.err $build_result/errors/
  40. echo_status "Creating package database ..."
  41. admdir="build/${SDECFG_ID}/var/adm"
  42. ./bin/sde-create-pkgdb -c "$config"
  43. echo_status "Creating isofs.txt file .."
  44. cat << EOT > build/${SDECFG_ID}/TOOLCHAIN/isofs.txt
  45. DISK1 $admdir/cache/ ${SDECFG_SHORTID}/info/cache/
  46. DISK1 $admdir/cksums/ ${SDECFG_SHORTID}/info/cksums/
  47. DISK1 $admdir/dependencies/ ${SDECFG_SHORTID}/info/dependencies/
  48. DISK1 $admdir/descs/ ${SDECFG_SHORTID}/info/descs/
  49. DISK1 $admdir/flists/ ${SDECFG_SHORTID}/info/flists/
  50. DISK1 $admdir/md5sums/ ${SDECFG_SHORTID}/info/md5sums/
  51. DISK1 $admdir/packages/ ${SDECFG_SHORTID}/info/packages/
  52. EVERY build/${SDECFG_ID}/TOOLCHAIN/pkgs/packages.db ${SDECFG_SHORTID}/pkgs/packages.db
  53. SPLIT build/${SDECFG_ID}/TOOLCHAIN/pkgs/ ${SDECFG_SHORTID}/pkgs/
  54. EOT
  55. echo_header "Reference build finished."
  56. cat <<- EOT > build/${SDECFG_ID}/TOOLCHAIN/result/copy-cache.sh
  57. #!/bin/sh
  58. cd $base/build/${SDECFG_ID}/TOOLCHAIN/result
  59. find package -type f | while read fn
  60. do [ -f ../../../\${fn%.cache}.desc ] && cp -v \$fn ../../../\$fn; done
  61. cd ../../..
  62. EOT
  63. chmod +x build/${SDECFG_ID}/TOOLCHAIN/result/copy-cache.sh
  64. echo_status "Results are stored in the directory"
  65. echo_status "build/$SDECFG_ID/TOOLCHAIN/result/."