summaryrefslogtreecommitdiff
path: root/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-03-04 20:17:25 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-03-04 20:19:48 +0000
commitb936522cfde40b0b4825fe65fbb63ab0c73fb8e9 (patch)
tree1f51897392bc44e0a510764cd83f62ca2b43c125 /abuild
parentc4f53cfa1033c0fe956af7fa33a2edddf095e8cd (diff)
downloadabuild-b936522cfde40b0b4825fe65fbb63ab0c73fb8e9.tar.gz
abuild-b936522cfde40b0b4825fe65fbb63ab0c73fb8e9.tar.bz2
abuild-b936522cfde40b0b4825fe65fbb63ab0c73fb8e9.tar.xz
abuild-b936522cfde40b0b4825fe65fbb63ab0c73fb8e9.zip
abuild: new style install scripts
install scripts are splitted into separate scripts. The install variable should contain a list of the scripts. Each script should be the pkgname with action as suffix. I.E: install="$pkgname.pre-install $pkgname.post-install"
Diffstat (limited to 'abuild')
-rwxr-xr-xabuild30
1 files changed, 21 insertions, 9 deletions
diff --git a/abuild b/abuild
index 7085af5..23fc588 100755
--- a/abuild
+++ b/abuild
@@ -310,15 +310,24 @@ EOF
done
local metafiles=".PKGINFO"
- if [ -n "$install" ]; then
- cp "$srcdir/$install" "$dir/.INSTALL" || return 1
- chmod +x "$dir/.INSTALL"
- metafiles="$metafiles .INSTALL"
- fi
-
-# for i in pre-install post-install pre-deinstall post-deinstall; do
-# [ -f ../$i ] && cp ../$i "$db"/
-# done
+ for i in $install; do
+ script=${i#$name}
+ case "$script" in
+ .install)
+ warning "Deprecated .install script found."
+ script=.INSTALL
+ ;;
+ .pre-install|.post-install|.pre-upgrade|.post-upgrade|.pre-deinstall|.post-deinstall)
+ msg "Adding $script"
+ ;;
+ *) error "$script: Invalid install script"
+ return 1
+ ;;
+ esac
+ cp "$srcdir/$i" "$dir/$script" || return 1
+ chmod +x "$dir/$script"
+ metafiles="$metafiles $script"
+ done
set *
[ "$1" = '*' ] && set --
@@ -333,6 +342,7 @@ package() {
# predefined splitfunc doc
default_doc() {
depends="$depends_doc"
+ install="$install_doc"
local i
for i in doc man info html sgml licenses; do
if [ -d "$pkgdir/usr/share/$i" ]; then
@@ -361,6 +371,7 @@ doc() {
# predefined splitfunc mod
default_mod() {
depends="$kernel $depends_mod"
+ install="$install_mod"
for i in firmware modules; do
if [ -d "$pkgdir/lib/$i" ]; then
rm -rf "$subpkgdir/lib"
@@ -377,6 +388,7 @@ mod() {
# predefined splitfunc dev
default_dev() {
depends="$pkgname $depends_dev"
+ install="$install_dev"
cd "$pkgdir" || return 0
for i in usr/include usr/lib/pkgconfig usr/share/aclocal\
usr/share/gettext usr/bin/*-config \