abuild: fixes for new install scripts
This commit is contained in:
parent
2b1fd46177
commit
2fb6e1a651
3
Makefile
3
Makefile
|
@ -2,7 +2,8 @@
|
||||||
PACKAGE=abuild
|
PACKAGE=abuild
|
||||||
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
|
VERSION:=$(shell awk -F= '$$1 == "abuild_ver" {print $$2}' abuild)
|
||||||
USR_BIN_FILES=abuild devbuild mkalpine buildrepo
|
USR_BIN_FILES=abuild devbuild mkalpine buildrepo
|
||||||
SAMPLES=sample.APKBUILD sample.initd sample.confd sample.install
|
SAMPLES=sample.APKBUILD sample.initd sample.confd sample.pre-install \
|
||||||
|
sample.post-install
|
||||||
DISTFILES=$(USR_BIN_FILES) $(SAMPLES) Makefile abuild.conf \
|
DISTFILES=$(USR_BIN_FILES) $(SAMPLES) Makefile abuild.conf \
|
||||||
|
|
||||||
|
|
||||||
|
|
16
abuild
16
abuild
|
@ -285,9 +285,14 @@ size = $size
|
||||||
EOF
|
EOF
|
||||||
local i deps
|
local i deps
|
||||||
deps="$depends"
|
deps="$depends"
|
||||||
if [ -n "$install" ] && head -n 1 "$srcdir/$install" | grep '^#' >/dev/null && ! depends_has busybox && [ "$pkgname" != "busybox" ]; then
|
if [ "$pkgname" != "busybox" ] && ! depends_has busbox; then
|
||||||
msg "Adding busybox to depends since we have an install script"
|
for i in $install; do
|
||||||
deps="$deps busybox"
|
if head -n 1 "$srcdir/$i" | grep '^#!/bin/sh' >/dev/null ; then
|
||||||
|
msg "Script found. busybox added as a dependency for $pkg"
|
||||||
|
deps="$deps busybox"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $license; do
|
for i in $license; do
|
||||||
|
@ -672,8 +677,9 @@ newaport() {
|
||||||
if [ -n "$cpinitd" ]; then
|
if [ -n "$cpinitd" ]; then
|
||||||
cp "$datadir"/sample.initd $pn.initd
|
cp "$datadir"/sample.initd $pn.initd
|
||||||
cp "$datadir"/sample.confd $pn.confd
|
cp "$datadir"/sample.confd $pn.confd
|
||||||
cp "$datadir"/sample.install $pn.install
|
cp "$datadir"/sample.pre-install $pn.pre-install
|
||||||
sed -i -e "s/^install=.*/install=\"$pn.install\"/" \
|
cp "$datadir"/sample.post-install $pn.post-install
|
||||||
|
sed -i -e "s/^install=.*/install=\"\$pkgname.pre-install \$pkgname.post-install\"/" \
|
||||||
-e "s/^source=\"\(.*\)\"/source=\"\1\n\t$pn.initd\n\t$pn.confd\n\t\$install\n\t\"/" \
|
-e "s/^source=\"\(.*\)\"/source=\"\1\n\t$pn.initd\n\t$pn.confd\n\t\$install\n\t\"/" \
|
||||||
APKBUILD
|
APKBUILD
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
pre_install)
|
|
||||||
# add something which happends before install
|
|
||||||
# $2 contains package version
|
|
||||||
;;
|
|
||||||
post_install)
|
|
||||||
# add something which happends after install
|
|
||||||
# $2 contains package version
|
|
||||||
;;
|
|
||||||
pre_upgrade)
|
|
||||||
# add something which happends before update
|
|
||||||
# $2 contains new package version
|
|
||||||
# $3 contains old package version
|
|
||||||
;;
|
|
||||||
post_upgrade)
|
|
||||||
# add something which happends after update
|
|
||||||
# $2 contains new package version
|
|
||||||
# $3 contains old package version
|
|
||||||
;;
|
|
||||||
pre_deinstall)
|
|
||||||
# add something which happends before delete
|
|
||||||
# $2 contains package version
|
|
||||||
;;
|
|
||||||
post_deinstall)
|
|
||||||
# add something which happends after delete
|
|
||||||
# $2 contains package version
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# add something which happends after install
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# add something which happends before install
|
||||||
|
|
Loading…
Reference in New Issue