summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexec.sh6
-rwxr-xr-xpackage.sh13
2 files changed, 18 insertions, 1 deletions
diff --git a/exec.sh b/exec.sh
index cbaecaa23..3810f8e65 100755
--- a/exec.sh
+++ b/exec.sh
@@ -16,6 +16,12 @@ PKG_INCL=
PKG_LIBS=
PKG_PKGS=
+if [[ -n ${FAKEROOTKEY} ]]; then
+ for i in "$(dirname $(which fakeroot))"/../lib{64,32,}/libfakeroot; do
+ PKG_LIBS=$i:${PKG_LIBS}
+ done
+fi
+
case "${PKG_NAME}" in
(-) deps=();;
(:*) deps=(${PKG_NAME//:/ });;
diff --git a/package.sh b/package.sh
index cea69c4f2..10775ddb2 100755
--- a/package.sh
+++ b/package.sh
@@ -7,13 +7,24 @@ if [[ $# == 0 ]]; then
exit
fi
+if [[ $UID -ne 0 ]]; then
+ exec fakeroot "$0" "$@"
+fi
+
export PKG_MAKE=$0
export PKG_NAME=${1%_}
export PKG_BASE=$(realpath "$(dirname "$0")")
source "${PKG_BASE}/helper.sh"
-./make.sh "${PKG_NAME}"
+# when running fakeroot, we shouldn't use the previous build result
+# as we don't have the fakeroot session info anymore
+
+if [[ -z ${FAKEROOTKEY} ]]; then
+ ./make.sh "${PKG_NAME}"
+else
+ ./remake.sh "${PKG_NAME}"
+fi
pkg: mkdir -p /DEBIAN
./control.sh "${PKG_NAME}" control >"$(pkg_ /DEBIAN/control)"