xbps-src: revamped build_style.

By default now it's assumed that if $build_style is not set, the template
uses 'custom-install' build, .e.g do_{build,configure,install}.

If it's set, a helper with the same name with .sh extension will be sourced
to set do_{build,configure,install} phases.

The exception is "meta-template" which currently it must be set via
build_style, probably will change in the future.
This commit is contained in:
Juan RP 2011-10-24 14:12:09 +02:00
parent 31452a3a22
commit 90204b7b28
9 changed files with 86 additions and 123 deletions

View file

@ -66,15 +66,11 @@ install_src_phase()
[ $? -eq 0 ] && touch -f $XBPS_PRE_INSTALL_DONE
fi
# Type of installation: custom, make or python.
if [ "$build_style" = "custom-install" ]; then
run_func do_install
elif [ "$build_style" = "python-module" ]; then
. $XBPS_HELPERSDIR/python-module.sh
run_func do_install
else
run_func make_install
# do_install()
if [ -r $XBPS_HELPERSDIR/${build_style}.sh ]; then
. $XBPS_HELPERSDIR/${build_style}.sh
fi
run_func do_install
cd ${wrksrc} || msg_error "can't change cwd to wrksrc!\n"
@ -106,10 +102,7 @@ install_src_phase()
find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \;
fi
msg_normal "$pkgver: installed into destdir.\n"
if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then
touch -f $XBPS_INSTALL_DONE
fi
touch -f $XBPS_INSTALL_DONE
#
# Build subpackages if found.
@ -141,21 +134,6 @@ install_src_phase()
done
}
#
# Installs a package via 'make install ...'.
#
make_install()
{
if [ -z "$make_install_target" ]; then
make_install_target="DESTDIR=${DESTDIR} install"
fi
[ -z "$make_cmd" ] && make_cmd=make
#
# Install package via make.
#
${make_cmd} ${make_install_target} ${make_install_args}
}
[ -z "$PKG_TMPLNAME" ] && exit 2
setup_tmpl $PKG_TMPLNAME