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:
parent
21b8a5418d
commit
e946ee7745
1 changed files with 47 additions and 16 deletions
|
@ -67,6 +67,7 @@ LOGGING=0
|
||||||
SOURCEONLY=0
|
SOURCEONLY=0
|
||||||
IGNOREARCH=0
|
IGNOREARCH=0
|
||||||
HOLDVER=0
|
HOLDVER=0
|
||||||
|
SPLITPKG=0
|
||||||
|
|
||||||
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
||||||
# when dealing with svn/cvs/etc PKGBUILDs.
|
# when dealing with svn/cvs/etc PKGBUILDs.
|
||||||
|
@ -1565,6 +1566,10 @@ if [ "$GENINTEG" = "1" ]; then
|
||||||
exit 0 # $E_OK
|
exit 0 # $E_OK
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${#pkgname[@]}" -gt "1" ]; then
|
||||||
|
SPLITPKG=1
|
||||||
|
fi
|
||||||
|
|
||||||
# check for no-no's in the build script
|
# check for no-no's in the build script
|
||||||
if [ -z "$pkgname" ]; then
|
if [ -z "$pkgname" ]; then
|
||||||
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
|
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
|
||||||
|
@ -1653,6 +1658,7 @@ fi
|
||||||
|
|
||||||
# Run the bare minimum in fakeroot
|
# Run the bare minimum in fakeroot
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
|
if [ "$SPLITPKG" = "0" ]; then
|
||||||
if [ "$REPKG" = "0" ]; then
|
if [ "$REPKG" = "0" ]; then
|
||||||
if [ "$(type -t package)" != "function" ]; then
|
if [ "$(type -t package)" != "function" ]; then
|
||||||
run_build
|
run_build
|
||||||
|
@ -1661,8 +1667,19 @@ if [ "$INFAKEROOT" = "1" ]; then
|
||||||
fi
|
fi
|
||||||
tidy_install
|
tidy_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
create_package
|
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.")"
|
msg "$(gettext "Leaving fakeroot environment.")"
|
||||||
exit 0 # $E_OK
|
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 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 [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
|
||||||
|
if [ "$SPLITPKG" = "0" ]; then
|
||||||
if [ "$REPKG" = "0" ]; then
|
if [ "$REPKG" = "0" ]; then
|
||||||
devel_update
|
devel_update
|
||||||
run_build
|
run_build
|
||||||
|
@ -1755,10 +1773,23 @@ else
|
||||||
fi
|
fi
|
||||||
tidy_install
|
tidy_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
create_package
|
create_package
|
||||||
else
|
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
|
devel_update
|
||||||
run_build
|
run_build
|
||||||
cd "$startdir"
|
cd "$startdir"
|
||||||
|
|
Loading…
Add table
Reference in a new issue