Added support to build subpackages from a single source.

proplib has been converted to see how it works.

--HG--
extra : convert_revision : dfcd1f547884108d69682e9e62b4aacfa431cc83
This commit is contained in:
Juan RP
2009-02-20 04:10:55 +01:00
parent 8cfe150f54
commit b225a1dc30
12 changed files with 133 additions and 8 deletions

View File

@@ -40,11 +40,33 @@ _EOF
}
xbps_write_metadata_pkg()
{
local subpkg=
for subpkg in ${subpackages}; do
. $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template
pkgname=${sourcepkg}-${subpkg}
xbps_write_metadata_pkg_real
run_template ${sourcepkg}
done
if [ -n "${subpackages}" ]; then
run_template ${sourcepkg}
rm -rf $XBPS_DESTDIR/${sourcepkg}-${version}/*
unset run_depends
fi
for subpkg in ${subpackages}; do
run_depends="$run_depends ${sourcepkg}-${subpkg}-${version}"
done
xbps_write_metadata_pkg_real
}
#
# This function writes the metadata files into package's destdir,
# these will be used for binary packages.
#
xbps_write_metadata_pkg()
xbps_write_metadata_pkg_real()
{
local destdir=$XBPS_DESTDIR/$pkgname-$version
local metadir=$destdir/var/db/xbps/metadata/$pkgname
@@ -203,11 +225,30 @@ _EOF
fi
}
xbps_make_binpkg()
{
local pkg="$1"
local subpkg=
for subpkg in ${subpackages}; do
if [ "$pkg" = "$pkgname-$subpkg" ]; then
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
pkgname=${sourcepkg}-${subpkg}
xbps_make_binpkg_real
return $?
fi
run_template ${sourcepkg}
done
xbps_make_binpkg_real
return $?
}
#
# This function builds a binary package from an installed xbps
# package in destdir.
#
xbps_make_binpkg()
xbps_make_binpkg_real()
{
local destdir=$XBPS_DESTDIR/$pkgname-$version
local binpkg=

View File

@@ -73,6 +73,18 @@ install_src_phase()
touch -f $XBPS_INSTALL_DONE
#
# Build subpackages if found.
#
for subpkg in ${subpackages}; do
msg_normal "Preparing $pkgname subpackage: $pkgname-$subpkg"
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
pkgname=${sourcepkg}-${subpkg}
run_func do_install
run_template ${sourcepkg}
done
[ -n "$subpackages" ] && setup_tmpl ${sourcepkg}
#
# Remove $wrksrc if -C not specified.
#

View File

@@ -23,11 +23,29 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#-
stow_pkg()
{
local pkg="$1"
local automatic="$2"
local subpkg=
for subpkg in ${subpackages}; do
. $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template
pkgname=${sourcepkg}-${subpkg}
stow_pkg_real ${pkg} ${automatic}
run_template ${sourcepkg}
done
stow_pkg_real ${pkg} ${automatic}
return $?
}
#
# Stow a package, i.e copy files from destdir into masterdir
# and register pkg into the package database.
#
stow_pkg()
stow_pkg_real()
{
local pkg="$1"
local automatic="$2"
@@ -74,7 +92,6 @@ stow_pkg()
#
# Run template postinstall helpers if requested.
#
run_template $pkgname
for i in ${postinstall_helpers}; do
local pihf="$XBPS_HELPERSDIR/$i"
[ -f "$pihf" ] && . $pihf

View File

@@ -68,7 +68,7 @@ reset_tmpl_vars()
build_depends libtool_fixup_la_stage no_fixup_libtool \
disable_parallel_build run_depends cross_compiler \
only_for_archs patch_args conf_files keep_dirs \
install_priority noarch \
install_priority noarch subpackages sourcepkg \
XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \
XBPS_BUILD_DONE XBPS_INSTALL_DONE"