during package build two temp objects are created:
builder.XXXXXX for build output
and builder.XXXXXXX dir containing package.spec
it's annoying if they end up in current dir (package dir)
and if you abort the build, the temps are not even cleaned up
# create tempfile. as secure as possible
tempfile() {
- mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM.$$
+ mktemp --tmpdir -t builder.$PACKAGE_NAME.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM.$$
}
tempdir() {
- mktemp -d builder.XXXXXX
+ mktemp --tmpdir -d builder.$PACKAGE_NAME.XXXXXX
}
# inserts git log instead of %changelog