summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-01 14:39:25 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-01 14:39:25 +0200
commiteba5688feb1c7333b415c444d44f2e9f9fbf03b5 (patch)
treec5a981fb71e1da0ce32443d07ea945d65a9a4185
parentc3ab87b44681453e2c38182b5397060a009b6c22 (diff)
bin/pkg: automatically use makefiles
-rwxr-xr-xbin/pkg15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/pkg b/bin/pkg
index 1d15938..7aabb4d 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -77,7 +77,12 @@ pkg_add () {
cd $PDIR || return 255
info "Retrieving package $1...\n"
$VCS_CMD $VCS_OPTIONS $VCS_ADD $PKG_ROOT/$1 || return 255
- if ([ -f $PDIR/$1/hooks/post-add ]) {
+ if ([ -r $PDIR/$1/Makefile ]) {
+ info "Building binaries\n"
+ cd $PDIR/$1
+ make
+ }
+ if ([ -r $PDIR/$1/hooks/post-add ]) {
info 'Executing post-add hook\n'
. $PDIR/$1/hooks/post-add
}
@@ -117,11 +122,15 @@ pkg_update () {
info "\rUpdating package $1 to $(echo $NEW | tail -n 1)"
$VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS
info "\rUpdated package $1 to $(echo $NEW | tail -n 1) \n"
- checklinks $CL_OPTIONS
- if ([ -f hooks/post-update ]) {
+ if ([ -r Makefile ]) {
+ info "Building binaries\n"
+ make
+ }
+ if ([ -r hooks/post-update ]) {
info 'Executing post-update hook\n'
. hooks/post-update
}
+ checklinks $CL_OPTIONS
} else {
info "\r \r"
}