2
1

add_new_package.wizard 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/sh
  2. echo "**** Autotools Add New Package Wizard ****"
  3. echo " This script will generate files to add a"
  4. echo " new package to buildroot."
  5. echo
  6. echo "What is the name of the package?"
  7. read PACKAGE_NAME
  8. echo "What is the version number?"
  9. read VERSION_NUM
  10. echo "What is the web address of the tarball?"
  11. read DOWNLOAD_LOC
  12. echo "Enter any known dependencies, separated"
  13. echo "by spaces, or just press enter."
  14. read EXTRA_DEPS
  15. echo "Enter a description of the package."
  16. read DESCRIPTION
  17. echo "Does autoreconf need to be run first? (y/n)"
  18. read ANSWER
  19. if [ "$ANSWER" = "y" ]; then
  20. RECONF="YES"
  21. else
  22. RECONF="NO"
  23. fi
  24. echo "Does it need to be installed to the staging dir?"
  25. echo "Say yes, if other packages depend on it."
  26. echo "(If not sure, just say yes. It will only use more"
  27. echo "space on your hard drive.)"
  28. read ANSWER
  29. if [ "$ANSWER" = "y" ]; then
  30. STAGING="YES"
  31. else
  32. STAGING="NO"
  33. fi
  34. echo "Enter any configure script options."
  35. read CONFIG_OPTIONS
  36. URL=${DOWNLOAD_LOC%/*}
  37. TARBALL=${DOWNLOAD_LOC##*/}
  38. EXTENSION=${TARBALL##*.tar.}
  39. NAME_UPPER=`echo ${PACKAGE_NAME} | tr a-z- A-Z_`
  40. mkdir ../package/${PACKAGE_NAME}
  41. cat > ../package/${PACKAGE_NAME}/${PACKAGE_NAME}.mk <<EOF
  42. #############################################################
  43. #
  44. # ${PACKAGE_NAME}
  45. #
  46. #############################################################
  47. ${NAME_UPPER}_VERSION = ${VERSION_NUM}
  48. ${NAME_UPPER}_SOURCE = ${PACKAGE_NAME}-\$(${NAME_UPPER}_VERSION).tar.${EXTENSION}
  49. ${NAME_UPPER}_SITE = ${URL}
  50. ${NAME_UPPER}_AUTORECONF = ${RECONF}
  51. ${NAME_UPPER}_INSTALL_STAGING = ${STAGING}
  52. ${NAME_UPPER}_INSTALL_TARGET = YES
  53. ${NAME_UPPER}_CONF_OPT = ${CONFIG_OPTIONS}
  54. ${NAME_UPPER}_DEPENDENCIES = uclibc ${EXTRA_DEPS}
  55. \$(eval \$(call AUTOTARGETS,package,${PACKAGE_NAME}))
  56. EOF
  57. cat > ../package/${PACKAGE_NAME}/Config.in <<EOF
  58. config BR2_PACKAGE_${NAME_UPPER}
  59. bool "${PACKAGE_NAME}"
  60. help
  61. ${DESCRIPTION}
  62. ${URL}
  63. EOF
  64. echo "Just add: source \"package/${PACKAGE_NAME}/Config.in\""
  65. echo "to the file package/Config.in in an appropriate"
  66. echo "location."
  67. echo
  68. echo "You are now ready to build ${PACKAGE_NAME}"
  69. echo "Just run make menuconfig and select your new"
  70. echo "package, then run make."