# This script runs after the %install scriptlet of the Desktop spec files,
# The purpose of the script is post-processing files before packaging.
#
# Currently it does two things:
#
# 1) delete CDDL header from text files, if found
# 2) validate smf manifests
#
# command line arguments:
#
# spec-post-install [DIR|FILE]...
#
# Processes a single file or all files in a directory, recursively
#
# returns 0 on success or 1 on failure (breaks the build)
#
# requires file/gnu-coreutils
# deletes the CDDL header from a text file
# returns 0 on success, 1 on error
chmod +w "$1"
|| return 1
return 0
}
# return 0 is arg is an integer number
}
# verifies if a given file needs the CDDL header removed
if [ $start_line -gt $end_line ]; then
return 1
fi
if [ $start_line -gt 15 ]; then
echo "WARNING: CDDL-like header starts after the 15th line"
return 1
fi
echo "WARNING: $1: unrecognised CDDL-like header, $diff lines long"
return 1
fi
}
# runs svccfg validate on arg
return 0
}
# processes a single file
echo "Deleting CDDL header from $1"
}
echo "Validating SMF manifest $1"
}
return 0
}
# processes all files in a directory, recursively
done
return 0
}
echo "Post-processing $arg"
if [ -d "$arg" ]; then
elif [ -f "$arg" ]; then
else
exit 1
fi
done