newapkbuild: support for creating sourceforge source urls

This commit is contained in:
Natanael Copa 2011-03-17 10:20:57 +00:00
parent 149521f2dc
commit f20d7983ae

View File

@ -52,6 +52,10 @@ newaport() {
mkdir -p "$pn"
cd "$pn"
if [ -z "$source" ] && [ -n "$sourceforge" ]; then
source="http://downloads.sourceforge.net/$pn/$pn-$pv.tar.gz"
fi
# replace pkgver in $source
if [ -n "$source" ]; then
source=$(echo "$source" | sed "s/$pv/\$pkgver/g")
@ -167,11 +171,12 @@ usage() {
echo " -h Show this help"
echo " -l Set package license to LICENSE"
echo " -u Set package URL"
echo " -s Use sourceforge source url"
echo ""
exit 0
}
while getopts "cd:fhl:u:" opt; do
while getopts "cd:fhl:u:s" opt; do
case $opt in
'c') cpinitd=1;;
'd') pkgdesc="$OPTARG";;
@ -179,6 +184,7 @@ while getopts "cd:fhl:u:" opt; do
'h') usage;;
'l') license="$OPTARG";;
'u') url="$OPTARG";;
's') sourceforge=1;;
esac
done
shift $(( $OPTIND - 1 ))