Commit b936522c authored by Natanael Copa's avatar Natanael Copa

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"
parent c4f53cfa
...@@ -310,15 +310,24 @@ EOF ...@@ -310,15 +310,24 @@ EOF
done done
local metafiles=".PKGINFO" local metafiles=".PKGINFO"
if [ -n "$install" ]; then for i in $install; do
cp "$srcdir/$install" "$dir/.INSTALL" || return 1 script=${i#$name}
chmod +x "$dir/.INSTALL" case "$script" in
metafiles="$metafiles .INSTALL" .install)
fi warning "Deprecated .install script found."
script=.INSTALL
# for i in pre-install post-install pre-deinstall post-deinstall; do ;;
# [ -f ../$i ] && cp ../$i "$db"/ .pre-install|.post-install|.pre-upgrade|.post-upgrade|.pre-deinstall|.post-deinstall)
# done 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 * set *
[ "$1" = '*' ] && set -- [ "$1" = '*' ] && set --
...@@ -333,6 +342,7 @@ package() { ...@@ -333,6 +342,7 @@ package() {
# predefined splitfunc doc # predefined splitfunc doc
default_doc() { default_doc() {
depends="$depends_doc" depends="$depends_doc"
install="$install_doc"
local i local i
for i in doc man info html sgml licenses; do for i in doc man info html sgml licenses; do
if [ -d "$pkgdir/usr/share/$i" ]; then if [ -d "$pkgdir/usr/share/$i" ]; then
...@@ -361,6 +371,7 @@ doc() { ...@@ -361,6 +371,7 @@ doc() {
# predefined splitfunc mod # predefined splitfunc mod
default_mod() { default_mod() {
depends="$kernel $depends_mod" depends="$kernel $depends_mod"
install="$install_mod"
for i in firmware modules; do for i in firmware modules; do
if [ -d "$pkgdir/lib/$i" ]; then if [ -d "$pkgdir/lib/$i" ]; then
rm -rf "$subpkgdir/lib" rm -rf "$subpkgdir/lib"
...@@ -377,6 +388,7 @@ mod() { ...@@ -377,6 +388,7 @@ mod() {
# predefined splitfunc dev # predefined splitfunc dev
default_dev() { default_dev() {
depends="$pkgname $depends_dev" depends="$pkgname $depends_dev"
install="$install_dev"
cd "$pkgdir" || return 0 cd "$pkgdir" || return 0
for i in usr/include usr/lib/pkgconfig usr/share/aclocal\ for i in usr/include usr/lib/pkgconfig usr/share/aclocal\
usr/share/gettext usr/bin/*-config \ usr/share/gettext usr/bin/*-config \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment