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.

66 lines
2.4 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. # :doc packages are nice but in most cases never used
  13. (cd build/${ROCKCFG_ID}/ROCK/pkgs_sel/; rm -f *:doc{-*,}.gem;)
  14. # remove packages which haven't been built in stages 0-8
  15. if [ "$ROCKCFG_TARGET_CRYSTAL_BUILDADDONS" = 1 ]; then
  16. for gemfile in build/${ROCKCFG_ID}/ROCK/pkgs_sel/*.gem; do
  17. if ! mine -k packages $gemfile | grep -q '^Build \[[0-8]\] at '; then
  18. rm -f $gemfile
  19. fi
  20. done
  21. fi
  22. # do not include the linux source package on the install media
  23. rm build/${ROCKCFG_ID}/ROCK/pkgs_sel/linux2?-source-*.gem
  24. echo_status "Selecting info files ..."
  25. rm -rf build/${ROCKCFG_ID}/ROCK/info_sel
  26. mkdir -p build/${ROCKCFG_ID}/ROCK/info_sel
  27. cp -rl build/${ROCKCFG_ID}/var/adm/`
  28. `{cksums,dependencies,descs,flists,md5sums,packages} \
  29. build/${ROCKCFG_ID}/ROCK/info_sel/.
  30. grep -hr '^Package Name and Version:' \
  31. build/${ROCKCFG_ID}/ROCK/info_sel/packages |
  32. awk '{ print $5 " " $6 "-" $7; }' |
  33. while read p v; do
  34. if [ ! -f build/${ROCKCFG_ID}/ROCK/pkgs_sel/$p-$v.gem ]; then
  35. echo build/${ROCKCFG_ID}/ROCK/info_sel/*/$p
  36. fi
  37. done | xargs -r rm
  38. echo_status "Creating package database (everything) ..."
  39. admdir="build/${ROCKCFG_ID}/var/adm"
  40. create_package_db $admdir build/${ROCKCFG_ID}/ROCK/pkgs
  41. echo_status "Creating package database (install media) ..."
  42. admdir="build/${ROCKCFG_ID}/ROCK/info_sel"
  43. create_package_db $admdir build/${ROCKCFG_ID}/ROCK/pkgs_sel
  44. echo_status "Creating isofs.txt file .."
  45. cat << EOT > build/${ROCKCFG_ID}/ROCK/isofs.txt
  46. DISK1 $admdir/cksums/ ${ROCKCFG_SHORTID}/info/cksums/
  47. DISK1 $admdir/dependencies/ ${ROCKCFG_SHORTID}/info/dependencies/
  48. DISK1 $admdir/descs/ ${ROCKCFG_SHORTID}/info/descs/
  49. DISK1 $admdir/flists/ ${ROCKCFG_SHORTID}/info/flists/
  50. DISK1 $admdir/md5sums/ ${ROCKCFG_SHORTID}/info/md5sums/
  51. DISK1 $admdir/packages/ ${ROCKCFG_SHORTID}/info/packages/
  52. EVERY build/${ROCKCFG_ID}/ROCK/pkgs_sel/packages.db ${ROCKCFG_SHORTID}/pkgs/packages.db
  53. SPLIT build/${ROCKCFG_ID}/ROCK/pkgs_sel/ ${ROCKCFG_SHORTID}/pkgs/
  54. EOT