summaryrefslogtreecommitdiff
path: root/newapkbuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-11-21 09:21:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-11-21 09:21:50 +0000
commit60dda6785fe21d7ee2996c4892cdb6a50fad6bb2 (patch)
treec8d5cdd7d6a07a52857a7ba074669792d765d377 /newapkbuild.in
parentb4fb3c6a81f974709821ae2b12ee3dd772730ff3 (diff)
downloadabuild-60dda6785fe21d7ee2996c4892cdb6a50fad6bb2.tar.gz
abuild-60dda6785fe21d7ee2996c4892cdb6a50fad6bb2.tar.bz2
abuild-60dda6785fe21d7ee2996c4892cdb6a50fad6bb2.tar.xz
abuild-60dda6785fe21d7ee2996c4892cdb6a50fad6bb2.zip
newapkbuild: detect github archives
Diffstat (limited to 'newapkbuild.in')
-rwxr-xr-xnewapkbuild.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/newapkbuild.in b/newapkbuild.in
index 66f634b..952980f 100755
--- a/newapkbuild.in
+++ b/newapkbuild.in
@@ -23,6 +23,13 @@ is_url() {
return 1
}
+is_github_url() {
+ case $1 in
+ https://github.com/*/*/archive/*.tar.gz) return 0;;
+ esac
+ return 1
+}
+
# Build sections
build_make() {
cat >>APKBUILD<<__EOF__
@@ -91,7 +98,15 @@ newaport() {
local source=
is_url "$1" && source="$1"
- if [ "$pn" != "$newname" ]; then
+ if is_github_url $source; then
+ if [ -z "$pkgname" ]; then
+ pkgname=${source%/archive/*}
+ pkgname=${pkgname##*/}
+ fi
+ pv=${newname%.t*} #strip .tar.gz .tgz .tar.bz2 etc
+ pv=${pv#*[a-z]}
+ source="$pkgname-$pv.tar.gz::$source"
+ elif [ "$pn" != "$newname" ]; then
pv=${newname#$pn-}
pv=${pv%.t*} #strip .tar.gz .tgz .tar.bz2 etc
fi