Added new build_style option "custom-install".
If a template uses this, it should provide a do_install() function to install all required stuff. --HG-- extra : convert_revision : ffbb388b83ac72e506c2c1fe98a942a41f3777d2
This commit is contained in:
parent
de7d1b10e7
commit
62defd3fd1
79
xbps.sh
79
xbps.sh
|
@ -704,10 +704,11 @@ configure_src_phase()
|
||||||
|
|
||||||
#
|
#
|
||||||
# There's nothing we can do if we are a meta template or an
|
# There's nothing we can do if we are a meta template or an
|
||||||
# only-install template.
|
# {custom,only}_install template.
|
||||||
#
|
#
|
||||||
[ "$build_style" = "meta-template" -o \
|
[ "$build_style" = "meta-template" -o \
|
||||||
"$build_style" = "only-install" ] && return 0
|
"$build_style" = "only-install" -o \
|
||||||
|
"$build_style" = "custom-install" ] && return 0
|
||||||
|
|
||||||
if [ ! -d $wrksrc ]; then
|
if [ ! -d $wrksrc ]; then
|
||||||
msg_error "unexistent build directory $wrksrc"
|
msg_error "unexistent build directory $wrksrc"
|
||||||
|
@ -810,10 +811,11 @@ build_src_phase()
|
||||||
|
|
||||||
#
|
#
|
||||||
# There's nothing of interest if we are a meta template or an
|
# There's nothing of interest if we are a meta template or an
|
||||||
# only-install template.
|
# {custom,only}-install template.
|
||||||
#
|
#
|
||||||
[ "$build_style" = "meta-template" -o \
|
[ "$build_style" = "meta-template" -o \
|
||||||
"$build_style" = "only-install" ] && return 0
|
"$build_style" = "only-install" -o \
|
||||||
|
"$build_style" = "custom-install" ] && return 0
|
||||||
|
|
||||||
if [ ! -d $wrksrc ]; then
|
if [ ! -d $wrksrc ]; then
|
||||||
msg_error "unexistent build directory: $wrksrc"
|
msg_error "unexistent build directory: $wrksrc"
|
||||||
|
@ -884,14 +886,6 @@ install_src_phase()
|
||||||
local i=
|
local i=
|
||||||
|
|
||||||
[ -z $pkg ] && [ -z $pkgname ] && return 1
|
[ -z $pkg ] && [ -z $pkgname ] && return 1
|
||||||
|
|
||||||
if [ -z "$make_install_target" ]; then
|
|
||||||
make_install_target="install prefix=$XBPS_DESTDIR/$pkgname-$version/usr"
|
|
||||||
make_install_target="$make_install_target sysconfdir=$XBPS_DESTDIR/$pkgname-$version/etc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "$make_cmd" ] && make_cmd=/usr/bin/make
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# There's nothing we can do if we are a meta template.
|
# There's nothing we can do if we are a meta template.
|
||||||
#
|
#
|
||||||
|
@ -906,6 +900,43 @@ install_src_phase()
|
||||||
|
|
||||||
msg_normal "Running install phase for: $pkgname-$version."
|
msg_normal "Running install phase for: $pkgname-$version."
|
||||||
|
|
||||||
|
if [ "$build_style" = "custom-install" ]; then
|
||||||
|
run_func do_install
|
||||||
|
else
|
||||||
|
make_install
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Run post_install helpers.
|
||||||
|
#
|
||||||
|
run_func post_install
|
||||||
|
|
||||||
|
msg_normal "Installed $pkgname-$version into $XBPS_DESTDIR."
|
||||||
|
|
||||||
|
touch -f $XBPS_INSTALL_DONE
|
||||||
|
|
||||||
|
#
|
||||||
|
# Remove $wrksrc if -C not specified.
|
||||||
|
#
|
||||||
|
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
|
||||||
|
rm -rf $wrksrc
|
||||||
|
[ $? -eq 0 ] && \
|
||||||
|
msg_normal "Removed $pkgname-$version build directory."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Installs a package via 'make install ...'.
|
||||||
|
#
|
||||||
|
make_install()
|
||||||
|
{
|
||||||
|
if [ -z "$make_install_target" ]; then
|
||||||
|
make_install_target="install prefix=$XBPS_DESTDIR/$pkgname-$version/usr"
|
||||||
|
make_install_target="$make_install_target sysconfdir=$XBPS_DESTDIR/$pkgname-$version/etc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z "$make_cmd" ] && make_cmd=/usr/bin/make
|
||||||
|
|
||||||
set_build_vars
|
set_build_vars
|
||||||
#
|
#
|
||||||
# Install package via make.
|
# Install package via make.
|
||||||
|
@ -925,28 +956,8 @@ install_src_phase()
|
||||||
unset eval ${f%=*}
|
unset eval ${f%=*}
|
||||||
done
|
done
|
||||||
|
|
||||||
#
|
|
||||||
# Run post_install helpers.
|
|
||||||
#
|
|
||||||
run_func post_install
|
|
||||||
|
|
||||||
# Unset build vars.
|
# Unset build vars.
|
||||||
unset_build_vars
|
unset_build_vars
|
||||||
|
|
||||||
msg_normal "Installed $pkgname-$version into $XBPS_DESTDIR."
|
|
||||||
|
|
||||||
touch -f $XBPS_INSTALL_DONE
|
|
||||||
|
|
||||||
#
|
|
||||||
# Remove $wrksrc if -C not specified.
|
|
||||||
#
|
|
||||||
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
|
|
||||||
rm -rf $wrksrc
|
|
||||||
[ "$?" -eq 0 ] && \
|
|
||||||
msg_normal "Removed $pkgname-$version build directory."
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $XBPS_BUILDDIR
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue