41 lines
1000 B
Bash
Executable File
41 lines
1000 B
Bash
Executable File
#!/usr/bin/env sh
|
|
DIRECTORY='/usr/lib/distcc'
|
|
SYMLINKS='cc c++ gcc g++'
|
|
unset NOT_INSTALLED
|
|
if [ ! -d "$DIRECTORY" ]; then
|
|
if [ -w '/usr/lib' ]; then
|
|
install -d "$DIRECTORY"
|
|
if [ $? -gt 0 ]; then
|
|
echo "post-install: error creating '$DIRECTORY'."
|
|
else
|
|
echo "post-install: '$DIRECTORY' created."
|
|
fi
|
|
cd "$DIRECTORY"
|
|
for c in $SYMLINKS; do
|
|
if [ ! -e "$DIRECTORY/$c" ]; then
|
|
NOT_INSTALLED='yes'
|
|
fi
|
|
done
|
|
if [ "$NOT_INSTALLED" ]; then
|
|
echo "post-install: in directory '$DIRECTORY'."
|
|
fi
|
|
for c in $SYMLINKS; do
|
|
if [ ! -e "$DIRECTORY/$c" ]; then
|
|
ln -s '../../bin/distcc' "$c"
|
|
if [ $? -gt 0 ]; then
|
|
echo "post-install: error creating symlink '../../bin/distcc -> $c'."
|
|
exit 1
|
|
else
|
|
echo "post-install: create symlink '../../bin/distcc -> $c'."
|
|
fi
|
|
fi
|
|
done
|
|
cd - > /dev/null
|
|
else
|
|
echo "post-install: error no permission to create directory '$DIRECTORY'."
|
|
exit 1
|
|
fi
|
|
fi
|
|
unset NOT_INSTALLED SYMLINKS DIRECTORY
|
|
# End of file
|