#!/bin/sh

# Taken from Gentoo's pax-utils.eclass
list_paxables() {
       file "$@" 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//'
}

if test "@PAX_COMMAND@" != "not specified"; then
       for paxable in `list_paxables "${1}"/bin/* "${1}"/jre/bin/*`; do
               echo "PaX mark @PAX_COMMAND_ARGS@ ${paxable}"
               @PAX_COMMAND@ @PAX_COMMAND_ARGS@ "${paxable}"
       done
fi
