Problem
packages/build-rpm-packages.sh and packages/build-deb-packages.sh create their build workspace with an absolute /tmp template:
tmpdir=`mktemp -d /tmp/gdr.XXXXXX`
Because the template is an absolute path, mktemp uses it verbatim and never consults TMPDIR. The entire build then runs under /tmp, where the RPM %build stage executes ./config_arch. On hosts that mount /tmp with noexec (common on hardened OS), that script can't execute, and the build fails:
make: ./config_arch: Permission denied
GDRAPI_ARCH=
...
undefined reference to `memcpy_uncached_store_neon' # arch never detected → wrong sources compiled
There is no way to redirect the build off /tmp today.
Fix
Let mktemp resolve the base directory itself, so it honors TMPDIR and falls back to /tmp when unset:
-tmpdir=`mktemp -d /tmp/gdr.XXXXXX`
+tmpdir=`mktemp -d --tmpdir gdr.XXXXXX`
Apply the same change in both packages/build-rpm-packages.sh and packages/build-deb-packages.sh.
Portability note
--tmpdir is a GNU coreutils extension. These are Linux-only rpm/deb packaging scripts, so GNU mktemp is a safe assumption. If you prefer to avoid the GNU-specific flag, the portable equivalent is:
-tmpdir=`mktemp -d /tmp/gdr.XXXXXX`
+tmpdir=`mktemp -d "${TMPDIR:-/tmp}/gdr.XXXXXX"`
Both fixes are functionally identical.
Problem
packages/build-rpm-packages.shandpackages/build-deb-packages.shcreate their build workspace with an absolute/tmptemplate:tmpdir=`mktemp -d /tmp/gdr.XXXXXX`Because the template is an absolute path,
mktempuses it verbatim and never consultsTMPDIR. The entire build then runs under/tmp, where the RPM%buildstage executes./config_arch. On hosts that mount/tmpwithnoexec(common on hardened OS), that script can't execute, and the build fails:There is no way to redirect the build off
/tmptoday.Fix
Let
mktempresolve the base directory itself, so it honorsTMPDIRand falls back to/tmpwhen unset:Apply the same change in both
packages/build-rpm-packages.shandpackages/build-deb-packages.sh.Portability note
--tmpdiris a GNU coreutils extension. These are Linux-only rpm/deb packaging scripts, so GNUmktempis a safe assumption. If you prefer to avoid the GNU-specific flag, the portable equivalent is:Both fixes are functionally identical.