Permission denied creating file

I need to create a file in the build root for the compile to complete. Its only an issue with opensuse builds as ANT is unable to find the jar it needs.

So in my spec file I’ve added
%if %{_vendor} == suse
echo “xalan-j2-serializer.jar” > /etc/ant.d/xalan
%endif

Ant needs this to find the jar file during the make on suse.

But it then fails with “Permission Denied”.

How do I get this file added to the build environment?

FYI…I ended up fixing the underlining source package with the bug rather than work around it with the build process.