Thanks. Actually I have seen that page earlier. There is a task named "command". That seems helpful to me. But the thing is that we need to include the spec file in each step as it is mandatory. That is kind of a problem. Because I want to have two tasks in ant file
1)ant install from spec file
2)Ant uninstall by simply running the Linux's rpm -e foobar command.
Don't confuse the "rpm" command with the "rpmbuild" command. Unless at long last they finally laid it to rest, the official RPM docs say that the command to build RPMs is "rpm -ba" and that hasn't been the case for years.
To create an RPM, use Ant's rpmbuild task. To install, update, validate or remove an RPM, use the OS "rpm" command via Ant's exec task.
An IDE is no substitute for an Intelligent Developer.