bin_package.bbclass 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. # Common variable and task for the binary package recipe.
  5. # Basic principle:
  6. # * The files have been unpacked to ${S} by base.bbclass
  7. # * Skip do_configure and do_compile
  8. # * Use do_install to install the files to ${D}
  9. #
  10. # Note:
  11. # The "subdir" parameter in the SRC_URI is useful when the input package
  12. # is rpm, ipk, deb and so on, for example:
  13. #
  14. # SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0"
  15. #
  16. # Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise
  17. # they would be in ${WORKDIR}.
  18. #
  19. # Skip the unwanted steps
  20. do_configure[noexec] = "1"
  21. do_compile[noexec] = "1"
  22. # Install the files to ${D}
  23. bin_package_do_install () {
  24. # Do it carefully
  25. [ -d "${S}" ] || exit 1
  26. if [ -z "$(ls -A ${S})" ]; then
  27. bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S.
  28. fi
  29. cd ${S}
  30. install -d ${D}${base_prefix}
  31. tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
  32. | tar --no-same-owner -xpf - -C ${D}${base_prefix}
  33. }
  34. FILES:${PN} = "/"
  35. EXPORT_FUNCTIONS do_install