my requirement is that i want to print some message on screen if rpm install fails in any case at client machine.or display message on screen like rpm install fail due to any of the generated reasons.like other standard rpm gives.
and i am not making any c file or make command in my .spec file . Everything i was doing in spec file itself.plz suggest how to print such type of things in client console using spec file.
yes that is not my concern --test i have give just example.my excet requirement is below spec file content are.
#Pre-Uninstall section
%preun
Processes=`ps -Ao"%p:%a" --cols 150 |
egrep "Launcher|rmiregistry" | grep -v grep | cut -d ":" -f1`
if [ -n "$Processes" ]; then
echo 'xyz is running ,first stop it then uninstall.' > /dev/stderr;
exit 1;
else
echo 'xyz service is not running' >/dev/stdout;
fi
then i try to uninstall the rpm using command
rpm -ev xyz
output : both message are printed according to service status.i want if client uninstall with option -v then and then it display message on screen otherwise not. how can i do this?