1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-03 02:41:53 -05:00

makepkg: implement creation of split packages

Adds the ability to create multiple packages from one PKGBUILD

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2009-01-16 22:32:05 +10:00
parent 21b8a5418d
commit e946ee7745

View File

@ -67,6 +67,7 @@ LOGGING=0
SOURCEONLY=0
IGNOREARCH=0
HOLDVER=0
SPLITPKG=0
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
# when dealing with svn/cvs/etc PKGBUILDs.
@ -1565,6 +1566,10 @@ if [ "$GENINTEG" = "1" ]; then
exit 0 # $E_OK
fi
if [ "${#pkgname[@]}" -gt "1" ]; then
SPLITPKG=1
fi
# check for no-no's in the build script
if [ -z "$pkgname" ]; then
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
@ -1653,6 +1658,7 @@ fi
# Run the bare minimum in fakeroot
if [ "$INFAKEROOT" = "1" ]; then
if [ "$SPLITPKG" = "0" ]; then
if [ "$REPKG" = "0" ]; then
if [ "$(type -t package)" != "function" ]; then
run_build
@ -1661,8 +1667,19 @@ if [ "$INFAKEROOT" = "1" ]; then
fi
tidy_install
fi
create_package
else
for pkg in ${pkgname[@]}; do
pkgdir="$pkgdir/$pkg"
mkdir -p "$pkgdir"
backup_package_variables
run_package $pkg
tidy_install
create_package $pkg
restore_package_variables
pkgdir="${pkgdir%/*}"
done
fi
msg "$(gettext "Leaving fakeroot environment.")"
exit 0 # $E_OK
@ -1747,6 +1764,7 @@ else
# if we are root or if fakeroot is not enabled, then we don't use it
if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
if [ "$SPLITPKG" = "0" ]; then
if [ "$REPKG" = "0" ]; then
devel_update
run_build
@ -1755,10 +1773,23 @@ else
fi
tidy_install
fi
create_package
else
if [ "$(type -t package)" == "function" ]; then
devel_update
run_build
for pkg in ${pkgname[@]}; do
pkgdir="$pkgdir/$pkg"
mkdir -p "$pkgdir"
backup_package_variables
run_package $pkg
tidy_install
create_package $pkg
restore_package_variables
pkgdir="${pkgdir%/*}"
done
fi
else
if [ "$(type -t package)" == "function" -o "$SPLITPKG" = "1" ]; then
devel_update
run_build
cd "$startdir"