From mboxrd@z Thu Jan 1 00:00:00 1970 From: ninevoltz at uclibc.org Date: Thu, 6 Mar 2008 09:52:39 -0800 (PST) Subject: [Buildroot] svn commit: trunk/buildroot: scripts Message-ID: <20080306175239.45593120159@busybox.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Author: ninevoltz Date: 2008-03-06 09:52:37 -0800 (Thu, 06 Mar 2008) New Revision: 21176 Log: some buildroot helper scripts Added: trunk/buildroot/scripts/ trunk/buildroot/scripts/add_new_package.wizard trunk/buildroot/scripts/build-ext3-img trunk/buildroot/scripts/create_ipkgs Changeset: Added: trunk/buildroot/scripts/add_new_package.wizard =================================================================== --- trunk/buildroot/scripts/add_new_package.wizard (rev 0) +++ trunk/buildroot/scripts/add_new_package.wizard 2008-03-06 17:52:37 UTC (rev 21176) @@ -0,0 +1,94 @@ +#!/bin/sh + +echo "**** Autotools Add New Package Wizard ****" +echo " This script will generate files to add a" +echo " new package to buildroot." +echo + +echo "What is the name of the package?" +read PACKAGE_NAME + +echo "What is the version number?" +read VERSION_NUM + +echo "What is the web address of the tarball?" +read DOWNLOAD_LOC + +echo "Enter any known dependencies, separated" +echo "by spaces, or just press enter." +read EXTRA_DEPS + +echo "Enter a description of the package." +read DESCRIPTION + +echo "Does autoreconf need to be run first? (y/n)" +read ANSWER + +if [ "$ANSWER" = "y" ]; then + RECONF="YES" +else + RECONF="NO" +fi + +echo "Does it need to be installed to the staging dir?" +echo "Say yes, if other packages depend on it." +echo "(If not sure, just say yes. It will only use more" +echo "space on your hard drive.)" +read ANSWER + +if [ "$ANSWER" = "y" ]; then + STAGING="YES" +else + STAGING="NO" +fi + +echo "Enter any configure script options." +read CONFIG_OPTIONS + +URL=${DOWNLOAD_LOC%/*} +TARBALL=${DOWNLOAD_LOC##*/} +EXTENSION=${TARBALL##*.tar.} +NAME_UPPER=`echo ${PACKAGE_NAME} | tr [a-z] [A-Z]` +NAME_UPPER=${NAME_UPPER//-/_} + +mkdir ../package/${PACKAGE_NAME} + +cat > ../package/${PACKAGE_NAME}/${PACKAGE_NAME}.mk < ../package/${PACKAGE_NAME}/Config.in < ${IMAGE_PATH}/buildroot.vmx < /dev/null + + # create the control file + cd ${BUILDROOT_DIR} + mkdir ${BUILDROOT_DIR}/ipkg-temp/CONTROL + + # find it's corresponding buildroot package directory + PACK_NAME=`find ./package -path './package/config' -prune -o -name ${NAME_WITHOUT_DIR}` + PACK_NAME=${PACK_NAME%./package/config} + PACK_NAME=${PACK_NAME#./package/config} + PACK_NAME=`echo -n ${PACK_NAME}` + + # there must be an better way to extract the description and + # dependencies from the Config.in and *.mk file. + # Haven't figured it out just yet. + CONF_FILE=`cat ${PACK_NAME}/Config.in` + #MAKE_FILE=`cat ${PACK_NAME}/*.mk` + HELP_STR=${CONF_FILE#*help} + HELP_STR=${HELP_STR%%comment*} + HELP_STR=${HELP_STR%%choice*} + HELP_STR=${HELP_STR%%depends*} + HELP_STR=${HELP_STR%%http*} + HELP_STR=`echo -n ${HELP_STR}` + + echo ${HELP_STR} + + if [ "${PACK_NAME}" != "" ]; then + echo "Creating ipkg of: ${PACKAGE}" + +cat > ${BUILDROOT_DIR}/ipkg-temp/CONTROL/control <