Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 76 lines (55 sloc) 1.09 KB
#!/bin/sh
PACKAGE="$1"
SECTION="$2"
if [ -z "$PACKAGE" ]; then
echo "Usage: newpackage <package_name> [section_name]"
exit 1
fi
if [ -z "$SECTION" ]; then
SECTION="misc"
fi
if [ ! -d "packages/$SECTION" ]; then
echo "Unknown section name: $SECTION"
exit 1
fi
PKGDIR="packages/$SECTION/$PACKAGE"
mkdir -p $PKGDIR
cat > $PKGDIR/meta <<EOF
PKG_NAME=$PACKAGE
PKG_VERSION=0.0invalid
PKG_URL="http://fill-in-$PACKAGE-$PKG_VERSION-download-url.invalid"
PKG_REV=1
PKG_DEPENDS="\$TARGET_LIBC"
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY=optional
PKG_SECTION=$SECTION
PKG_SHORTDESC="$PACKAGE (autogenerated)"
PKG_LONGDESC=""
EOF
cat > packages/$SECTION/$PACKAGE/build <<EOF
#!/bin/sh
. config/options
get_meta \$1
cd \$PKG_BUILD_DIR
do_configure
make
make_install
EOF
chmod +x $PKGDIR/build
cat > $PKGDIR/install <<EOF
#!/bin/sh
. config/options
get_meta \$1
cd \$PKG_BUILD_DIR
do_install usr/bin
EOF
chmod +x $PKGDIR/install
cat > $PKGDIR/installdev <<EOF
#!/bin/sh
. config/options
get_meta \$1
cd \$PKG_BUILD_DIR
do_installdev usr/include
do_installdev usr/lib
EOF
chmod +x $PKGDIR/installdev