mirror of the now-defunct rocklinux.org
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.

71 lines
2.5 KiB

  1. # This is the shortest possible target build.sh script. Some targets will
  2. # add code after calling pkgloop() or modify pkgloop's behavior by defining
  3. # a new pkgloop_action() function.
  4. #
  5. pkgloop
  6. echo_header "Finishing build."
  7. echo_status "Selecting bin packages ..."
  8. rm -rf build/${ROCKCFG_ID}/ROCK/pkgs_sel
  9. mkdir -p build/${ROCKCFG_ID}/ROCK/pkgs_sel
  10. (cd build/${ROCKCFG_ID}/ROCK/pkgs/;
  11. ls | xargs ln --target-directory="../pkgs_sel";)
  12. if [ "$ROCKCFG_TARGET_CRYSTAL_INCLUDEDOCS" != 1 ]; then
  13. # :doc packages are nice but in most cases never used
  14. (
  15. cd build/${ROCKCFG_ID}/ROCK/pkgs_sel/
  16. rm -f *:doc{-*,}.gem
  17. )
  18. fi
  19. # remove packages which haven't been built in stages 0-8
  20. if [ "$ROCKCFG_TARGET_CRYSTAL_BUILDADDONS" = 1 ]; then
  21. for gemfile in build/${ROCKCFG_ID}/ROCK/pkgs_sel/*.gem; do
  22. if ! mine -k packages $gemfile | grep -q '^Build \[[0-8]\] at '; then
  23. rm -f $gemfile
  24. fi
  25. done
  26. fi
  27. echo_status "Selecting info files ..."
  28. rm -rf build/${ROCKCFG_ID}/ROCK/info_sel
  29. mkdir -p build/${ROCKCFG_ID}/ROCK/info_sel
  30. cp -rl build/${ROCKCFG_ID}/var/adm/`
  31. `{cksums,dependencies,descs,flists,md5sums,packages,provides,requires,conflicts} \
  32. build/${ROCKCFG_ID}/ROCK/info_sel/.
  33. grep -hr '^Package Name and Version:' \
  34. build/${ROCKCFG_ID}/ROCK/info_sel/packages |
  35. awk '{ print $5 " " $6 "-" $7; }' |
  36. while read p v; do
  37. if [ ! -f build/${ROCKCFG_ID}/ROCK/pkgs_sel/$p-$v.gem ]; then
  38. echo build/${ROCKCFG_ID}/ROCK/info_sel/*/$p
  39. fi
  40. done | xargs -r rm
  41. echo_status "Creating package database (everything) ..."
  42. admdir="build/${ROCKCFG_ID}/var/adm"
  43. create_package_db $admdir build/${ROCKCFG_ID}/ROCK/pkgs
  44. echo_status "Creating package database (install media) ..."
  45. admdir="build/${ROCKCFG_ID}/ROCK/info_sel"
  46. create_package_db $admdir build/${ROCKCFG_ID}/ROCK/pkgs_sel
  47. echo_status "Creating isofs.txt file .."
  48. cat << EOT > build/${ROCKCFG_ID}/ROCK/isofs.txt
  49. DISK1 $admdir/cksums/ ${ROCKCFG_SHORTID}/info/cksums/
  50. DISK1 $admdir/dependencies/ ${ROCKCFG_SHORTID}/info/dependencies/
  51. DISK1 $admdir/descs/ ${ROCKCFG_SHORTID}/info/descs/
  52. DISK1 $admdir/flists/ ${ROCKCFG_SHORTID}/info/flists/
  53. DISK1 $admdir/md5sums/ ${ROCKCFG_SHORTID}/info/md5sums/
  54. DISK1 $admdir/packages/ ${ROCKCFG_SHORTID}/info/packages/
  55. DISK1 $admdir/provides/ ${ROCKCFG_SHORTID}/info/provides/
  56. DISK1 $admdir/requires/ ${ROCKCFG_SHORTID}/info/requires/
  57. DISK1 $admdir/conflicts/ ${ROCKCFG_SHORTID}/info/conflicts/
  58. EVERY build/${ROCKCFG_ID}/ROCK/pkgs_sel/packages.db ${ROCKCFG_SHORTID}/pkgs/packages.db
  59. SPLIT build/${ROCKCFG_ID}/ROCK/pkgs_sel/ ${ROCKCFG_SHORTID}/pkgs/
  60. EOT